diff --git a/AGENT.md b/AGENT.md index c7c40e055..a128dcb02 100644 --- a/AGENT.md +++ b/AGENT.md @@ -127,7 +127,7 @@ All events follow this consistent structure: ```typescript { - event: 'product view', // ENTITY ACTION format + name: 'product view', // ENTITY ACTION format data: { // Entity-specific properties id: 'P123', name: 'Laptop', @@ -488,7 +488,7 @@ it('processes events correctly', async () => { }); await collector.push('page view', {}); expect(mockDestination.push).toHaveBeenCalledWith( - expect.objectContaining({ event: 'page view' }), + expect.objectContaining({ name: 'page view' }), expect.any(Object), ); }); diff --git a/README.md b/README.md index 11ddef726..de675647f 100644 --- a/README.md +++ b/README.md @@ -1,92 +1,235 @@
-# Open-source event data collection and tag management - -[Request Feature](https://github.com/elbwalker/walkerOS/issues/new) ยท -[Report Bug](https://github.com/elbwalker/walkerOS/issues/new) ยท -[Say hello](https://calendly.com/elb-alexander/30min) +# walkerOS: Open-Source tagging and event data collection -# What is walkerOS +walkerOS captures, structures, and routes events with built-in support for +consent management โ all directly in your code. No fragile UI configs. No +black-box logic. Just **tracking infrastructure** you can version, test, and +trust. -walkerOS is a privacy-centric event data collection platform. It offers features -like data capturing, -[consent management](https://www.elbwalker.com/docs/consent_management/overview/), -data integration, and -[tag management](https://www.elbwalker.com/docs/destinations/event_mapping). -Fully configurable as code. +## Why walkerOS? -The project started as a web library -called walker.js and has evolved -into a complete first-party tracking system. +- **Independence**: Make your data collection independent from single vendor + specifications to reduce complexity and extra code whenever you add or remove + a new service. Keep maintenance effort to a minimum. +- **Scalability**: DOM-based, component-level frontend tagging makes tracking + user behavior declarative, reusable, and easy to maintain. +- **Privacy-first approach**: Built-in consent handling and privacy controls + help you meet compliance from day one. +- **Type-safe tracking**: Built with TypeScript to catch tracking errors at + compile time, not in production. Get IDE autocomplete for APIs and destination + configs, prevent data structure mistakes. -## Packages Overview +## How it works -- **Sources** ([docs](https://www.elbwalker.com/docs/sources/), - [code](./packages/sources/)): For data creation and state management. -- **Destinations** ([docs](https://www.elbwalker.com/docs/destinations/), - [code](./packages/destinations/)): Initialize, map and share events to - third-party tools. -- **Utils** ([docs](https://www.elbwalker.com/docs/utils/), - [code](./packages/utils/)): Enhance data collection with shared utilities. + -## Why walkerOS? +## Quick Start + +### npm -- **Sustainability**: Robust infrastructure for continuous data collection, even - amidst evolving data landscapes. -- **Privacy focus**: Strict privacy-by-design approach, in-build consent - management and various data protection features. -- **Complete data ownership**: Full control of your first-party data, no vendor - lock-in, and control of data processing. -- **Simplified data model**: Intuitive event model that streamlines data - collection, making analytics straightforward and efficient. -- **Flexible architecture**: Modular design adapting to your specific data needs - and allows growing step-by-step. - -## How walkerOS operates - -```mermaid ---- -title: Basic infrastructure ---- -flowchart LR - subgraph walkerOS - direction LR - subgraph Collection - Sources - end - subgraph Activation - Destinations - end - %%Utils - end - subgraph Tools - direction LR - storage["Storage"] - marketing["Marketing"] - analytics["Analytics"] - end - Sources --> Destinations - Destinations --> Tools +Install the required packages from npm: + +```bash +npm install @walkeros/collector @walkeros/web-source-browser +``` + +Initialize walkerOS in your project: + +```javascript +import { createCollector } from '@walkeros/collector'; +import { createSource } from '@walkeros/core'; +import { sourceBrowser } from '@walkeros/web-source-browser'; + +// Initialize walkerOS +export async function initializeWalker() { + const { collector } = await createCollector({ + sources: { + browser: createSource(sourceBrowser, { + settings: { + pageview: true, + session: true, + elb: 'elb', // Browser source will set window.elb automatically + }, + }), + }, + destinations: { + console: { + push: (event) => console.log('Event:', event), + }, + }, + }); +} ``` -## Installation +### script tag + +For websites without build tools, you can install from a CDN: + +```html + +``` + +## Example: React + +Here's a quick look at how to integrate walkerOS into a React application. + +**1. Create a walker setup file:** + +```tsx +// src/walker.ts +import type { Collector, WalkerOS } from '@walkeros/core'; +import { createCollector } from '@walkeros/collector'; +import { createSource } from '@walkeros/core'; +import { createTagger, sourceBrowser } from '@walkeros/web-source-browser'; + +declare global { + interface Window { + elb: WalkerOS.Elb; + walker: Collector.Instance; + } +} + +export async function initializeWalker(): Promise