Collector
The collector is the central processing engine of walkerOS that receives events from sources, enriches them with additional data, applies consent rules, and routes them to destinations. It acts as the intelligent middleware between event capture and event delivery.
What it does
The Collector transforms raw events into enriched, compliant data streams by:
- Event processing - Validates, normalizes, and enriches incoming events
- Consent management - Applies privacy rules and user consent preferences
- Data enrichment - Adds session data, user context, and custom properties
- Destination routing - Sends processed events to configured analytics platforms
Key features
- Compatibility - Works in both web browsers and server environments
- Privacy-first - Built-in consent management and data protection
- Event validation - Ensures data quality and consistency
- Flexible routing - Send events to multiple destinations simultaneously
Role in architecture
In the walkerOS data flow, the collector sits between sources and destinations:
Sources → Collector → Destinations
Sources capture events and send them to the collector, which processes and routes them to your chosen destinations like Google Analytics, custom APIs, or data warehouses.
Installation
npm install @walkeros/collector
Basic setup
import { createCollector } from '@walkeros/collector';
const config = {
run: true,
consent: { functional: true },
sources: [
// add your event sources
]
},
};
const { collector, elb } = await createCollector(config);
Configuration reference
Property | Type | Description | More |
---|---|---|---|
run | boolean | Automatically start the collector pipeline on initialization | |
sources | array | Configurations for sources providing events to the collector | |
destinations | array | Configurations for destinations receiving processed events | |
consent | object | Initial consent state to control routing of events | |
verbose | boolean | Enable verbose logging for debugging | |
onError | function | Error handler triggered when the collector encounters failures | |
onLog | function | Custom log handler for collector messages |
Advanced setup
import { createCollector } from '@walkeros/collector';
const { collector, elb } = await createCollector({
run: true,
consent: { functional: true },
sources: [
// add your event sources
],
destinations: [
// add your event destinations
],
verbose: true,
onError: (error: unknown) => {
console.error('Collector error:', error);
},
onLog: (message: string, level: 'debug' | 'info' | 'warn' | 'error') => {
console.log(`[${level}] ${message}`);
},
});
💡 Need Professional Support?
Need professional support with your walkerOS implementation? Check out our services.