Quickstart
Get started with walkerOS in minutes. These examples provide working code that you can copy, paste, and run immediately. All examples are maintained in our quickstart app and tested with every release.
This quickstart uses integrated mode: the collector runs inside your own code. You can switch how you package it later, see operating modes.
@walkeros/mcp runs locally without an account. Install the plugin and describe the flow you want: With an AI assistant.
1. Install packages
Install the collector package from npm:
npm install @walkeros/collector @walkeros/web-source-browser2. Create basic setup
Send your first event with a collector and a single console destination. This first snippet stays DOM-free so it runs in Node; the browser source for automatic DOM capture comes in the next step.
import { startFlow } from '@walkeros/collector';
const { elb } = await startFlow({
destinations: {
console: {
code: {
type: 'console',
config: {},
push: (event) => console.log('Event:', event.name),
},
},
},
});
await elb('page view', { title: 'Home' });
// -> logs: Event: page view3. Add destinations
Install destination packages and add them to your setup:
import { startFlow } from '@walkeros/collector';
import { sourceBrowser } from '@walkeros/web-source-browser';
import { destinationGtag } from '@walkeros/web-destination-gtag';
import { destinationAPI } from '@walkeros/web-destination-api';
export async function initializeWalker(): Promise<void> {
const { collector, elb } = await startFlow({
sources: {
browser: {
code: sourceBrowser,
config: {
settings: {
pageview: true,
session: true,
elb: 'elb',
},
},
},
},
destinations: {
// Send events to your API
api: {
code: destinationAPI,
config: {
settings: {
url: 'https://your-api.com/events',
},
},
},
// Send to Google Analytics 4
ga4: {
code: destinationGtag,
config: {
settings: {
ga4: { measurementId: 'G-XXXXXXXXXX' },
},
},
},
},
});
window.walker = collector;
}4. Add consent management
Add consent requirements to your destinations:
export async function initializeWalker(): Promise<void> {
const { collector, elb } = await startFlow({
sources: {
browser: {
code: sourceBrowser,
config: {
settings: {
pageview: true,
session: true,
elb: 'elb',
},
},
},
},
destinations: {
// API destination - requires functional consent
api: {
code: destinationAPI,
config: {
settings: {
url: 'https://your-api.com/events',
},
consent: {
functional: true,
},
},
},
// GA4 - requires analytics consent
ga4: {
code: destinationGtag,
config: {
settings: {
ga4: { measurementId: 'G-XXXXXXXXXX' },
},
consent: {
analytics: true,
},
},
},
},
});
window.walker = collector;
// Set consent when user accepts/denies
// This would typically come from your consent banner
function handleConsentAccept() {
elb('walker consent', {
functional: true,
analytics: true,
marketing: true,
});
}
function handleConsentDeny() {
elb('walker consent', {
functional: true,
analytics: false,
marketing: false,
});
}
}See your event
The step 2 setup runs directly in Node. Save it as index.mjs (the import and top-level await need ES modules) and run:
node index.mjsYou should see:
Event: page viewThat is the whole loop: an event pushed with elb reaching a destination. The browser setups in steps 3 and 4 verify the same way in your browser console once your app runs. To test flows offline with the CLI instead, see bundled mode.
Next steps
- Send it to GA4: the same event arriving live in GA4 DebugView
- DOM-based tagging: automatic tracking via data-elb attributes
- Event mapping: transform events before sending
- Operating modes: choose how to package and deploy