Skip to content
This repository was archived by the owner on Jun 25, 2025. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export async function setupPlugin({ config, global }) {

try {
const eventNames = config.eventsToSend ? config.eventsToSend.split(',').filter(Boolean) : []
const excludedEventNames = config.eventsToExclude ? config.eventsToExclude.split(',').filter(Boolean) : [];

global.buffer = createBuffer({
limit: (1 / 5) * 1024 * 1024, // 200kb
Expand All @@ -40,6 +41,10 @@ export async function setupPlugin({ config, global }) {
continue
}

if (excludedEventNames.length > 0 && excludedEventNames.includes(event.event)) {
continue;
}

try {
await exportToCustomerio(event, global.customerioAuthHeader, config)
} catch (error) {
Expand Down
6 changes: 6 additions & 0 deletions plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@
"type": "string",
"hint": "Comma separated list of events to include if specified"
},
{
"key": "eventsToExclude",
"name": "List of events to be excluded from sending to Customer.io",
"type": "string",
"hint": "Comma separated list of events to exclude if specified"
},
{
"key": "sendEventsFromAnonymousUsers",
"name": "Send events from anonymous users to Customer.io",
Expand Down