Skip to content
Data
Skill

/walkeros-understanding-destinations

Destinations receive processed events from the collector and deliver them to third-party tools (analytics, marketing, data warehouses).

From plugin
walkeros
35122 skills

Claude Code

$ npx -y skills add elbwalker/walkerOS --skill walkeros-understanding-destinations --agent claude-code

SKILL.md

walkeros-understanding-destinations.SKILL.md
name: walkeros-understanding-destinations
description:
  Use when working with walkerOS destinations, understanding the destination
  interface, or learning about env pattern and configuration. Covers interface,
  lifecycle, env mocking, and paths.

Understanding walkerOS Destinations

Overview

Destinations receive processed events from the collector and deliver them to third-party tools (analytics, marketing, data warehouses).

**Core principle:** Destinations transform and deliver. They don't capture or process: that's sources and collector.

Destination Interface

See [packages/core/src/types/destination.ts](../../packages/core/src/types/destination.ts) for canonical interface.

| Method | Purpose | Required | | --------------------------- | -------------------------- | ------------ | | `init(context)` | Load scripts, authenticate | Optional | | `push(event, context)` | Transform and send event | **Required** | | `pushBatch(batch, context)` | Batch processing | Optional | | `destroy(context)` | Cleanup on shutdown | Optional | | `config` | Settings, mapping, consent | **Required** |

`destroy?: DestroyFn`: optional cleanup method. Called during `command('shutdown')`. Use to close DB connections, flush buffers, or release SDK clients. Receives `{ id, config, env, logger }`.

The env Pattern

Destinations use dependency injection via `env` for external APIs. This enables testing without mocking.

// Destination defines its env type
export interface Env extends DestinationWeb.Env {
  window: {
    gtag: Gtag.Gtag;
    dataLayer: unknown[];
  };
}

// Destination uses env, not globals
async function push(event, context) {
  const { env } = context;
  env.window.gtag('event', mappedName, mappedData);
}

Testing with env

**REQUIRED SKILL:** See [testing-strategy](../walkeros-testing-strategy/SKILL.md) for full testing patterns.

import { mockEnv } from '@walkeros/core';
import { examples } from '../dev';

const calls: Array<{ path: string[]; args: unknown[] }> = [];
const testEnv = mockEnv(examples.env.push, (path, args) => {
  calls.push({ path, args });
});

await destination.push(event, { ...context, env: testEnv });

expect(calls).toContainEqual({
  path: ['window', 'gtag'],
  args: ['event', 'purchase', expect.any(Object)],
});

The env as the simulation seam

The env pattern is also the interception seam for simulation: `walkeros push --simulate` and the conformance kit record the calls a destination makes on the paths its `examples.env.simulation` names. A destination that reaches its vendor through `env` is recorded; one that reaches a global directly, bypassing `env`, is not. This is one more reason to route every external call through `env`.

Rules that keep the seam intact:

  • **`init` keeps an injected env.** A client built in `init` (SDK client, auth

client, writer) is taken from `env` when present and created only otherwise (`env?.BigQuery ?? BigQuery`). Every key the mock env declares must be read as `env.<key>` in `src`.

  • **`simulation` names the request call** (`sendServer`,

`call:PubSub.topic.publishMessage`, `call:JSONWriter.appendRows`), not a constructor. The one recorder is `recordEnv` in `@walkeros/core`; it navigates constructors, factories and Promises, and records only the leaf.

  • **Clients built in `init`.** CLI and MCP simulate inject the mock env before

`init`, so a client built in `init` is recorded.

  • **Client IP and user agent.** Server conversion-API destinations (Meta,

TikTok, Snapchat, Pinterest, Bing, Reddit, Criteo, X, Data Manager, Piwik PRO) expose `ip` and `userAgent` settings (`Mapping.Value | false`), defaulting to `['ingest.ip', 'event.user.ip']` and `['ingest.userAgent', 'event.user.userAgent']`, resolved with `getMappingValue(createMappingRoot(ingest, event), setting, { collector })`. `false` disables, an explicit mapped vendor field wins, each package carries its own few lines (no shared helper). Data Manager fills them by default only when an entry of `settings.destinations` is `GOOGLE_ADS`; a Google Analytics-only step sends neither unless `ip` or `userAgent` is set or the field is mapped. Matomo, an analytics server destination, fills neither (ruling analytics-destinations-no-ip-autofill): Matomo has `ip` and `userAgent` settings without a default, and its `init` refuses `ip` without `credentials.token`, since Matomo rejects `cip` without a token.

Destination Config

config: {
  settings: { /* destination-specific */ },
  mapping: { /* event transformation rules */ },
  data: { /* global data mapping */ },
  consent: { /* required consent states */ },
  policy: { /* processing rules */ },
  queue: boolean,  // when added later, receive the run's earlier events (default true)
  timeout: number, // delivery timeout in ms (default 10000)
  queueMax: number,  // consent-queued events cap (default 1000)
  dlqMax: number,    // dead-letter queue cap (default 100)
}

Buffer bounds

Each destination keeps two internal buffers: `queuePush` (consent-denied events) and `dlq` (failed pushes). Both are size-bounded with FIFO drop-oldest eviction. Defaults: `queueMax: 1000`, `dlqMax: 100`. Set either on a destination's config to override per destination. Operators read drop counts from `collector.status.dropped[stepId('destination', id)]?.queue` (consent-denied evictions) and `?.dlq` (DLQ evictions). Build the key with `stepId()` from `@walkeros/core`. Point-in-time sizes stay on `collector.status.destinations[id].queuePushSize` / `dlqSize`.

`queuePush` drains back into the destination once consent allows delivery. The DLQ is never replayed: an event that reaches it is gone once it is evicted.

Delivery timeout

`config.timeout` bounds one delivery. A `push` or `pushBatch` that has not settled within it is

Read more
@elbwalker
Ships withwalkeros

From browser to BigQuery and ad platforms - warehouse-native, and ready for AI agents via MCP.

Stars on GitHub

Momentum

stars in total
351
Star history of elbwalker/walkerOS on GitHub, a chart by star-history.com

Other skills on walkeros.

walkeros-create-source

walkeros-create-source

Use when creating a new walkerOS source to capture events (browser source, dataLayer interception, server/HTTP source, webhook…

@elbwalker@elbwalkerInstall Skill

More skills from other plugins.

paddleocr-doc-parsing

paddleocr-doc-parsing

Use this skill to extract structured Markdown/JSON from PDFs and document images—tables with cell-level precision, formulas as…

paddleocr2mo93k
@paddlepaddle@paddlepaddleInstall Skill
context-loader
Auto-invoked

context-loader

Search memories from earlier Pi sessions in this repository. Use it when earlier work may already explain the code, error,…

mem02w69k
@mem0ai@mem0aiInstall Skill
analyzing-ai-citations

analyzing-ai-citations

Answer AI citation and answer engine optimization (AEO) questions in PostHog: whether AI answer engines (ChatGPT, Claude, and an…

posthog3w41k
@posthog@posthogInstall Skill

Questions about walkeros-understanding-destinations.

Which coding agents can use walkeros-understanding-destinations?
walkeros-understanding-destinations installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.