Skip to main content

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.

Working with an AI assistant?

@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-browser

2. 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 view

3. 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;
}

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.mjs

You should see:

Event: page view

That 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

💡 Setting this up for production?
If your setup involves consent management, server-side pipelines, or custom destinations, the creators of walkerOS offer hands-on implementation support. Start with a free scoping call.