Skip to main content

Commands

A node source can either be created with a custom config during initialization or updated via commands using the elb function.

elb

The elb function gets returned when creating a node source. It pushes events and commands to the instance and runs asynchronously by returning a promise.

import { createSourceNode } from '@elbwalker/source-node';
const { elb } = createSourceNode();

const result = await elb('entity action', { foo: 'bar' });

config

To configure the node source either do it while creating an instance or use the walker config command:

elb('walker config', {
globalsStatic: {}, // Static attributes added to each event
onError: console.log, // Custom error handler
onLog: console.error, // Custom logging
});

run

A run can be seen like a cycle where all events are processed in the same group. A run is required to start the processing of events. Before starting a run all IDs and configurations should be set.

elb('walker run');

destination

The walker destination command adds a destination to the node source.

const destinationLog = { push: console.log };
elb('walker destination', destinationLog, {
/* destination config */
});

Names can be defined arbitrarily, but common groups are functional, analytics, and marketing. Values are booleans, and once a value is set to true it's treated as consent being granted. Previously pushed events during a run are now shared with existing destinations and new ones.

elb('walker consent', { marketing: true, randomTool: true });

Setting a consent state to false will immediately stop a destination from processing any events.

tip

Learn more about consent management.

user

There are three levels for user identification. Typically, the user is a company's internal ID. The device ID can be treated as a value stored in a cookie for a more extended period, and the session can be used for temporary identification.

elb('walker user', {
id: 'us3r',
device: 'c00k13',
session: 's3ss10n',
hash: getHash(str),
});

User IDs will be added to each event.

{
"event": "entity action",
"user": {
"id": "us3r",
"device": "c00k13",
"session": "s3ss10n"
"hash": "h4sh3d"
}
// other properties omitted
}
warning

Only use fully anonymized & arbitrary IDs by default and check your options with persistent user IDs with your data protection officer.

tip

Learn more about identification and user stitching

info

If you need professional support with your walkerOS implementation, check out our services.