> Part of the walkerOS documentation. Project overview and full index: <https://www.walkeros.io/llms.txt>

# Bundled mode

In Bundled mode, you configure walkerOS with JSON files and build standalone bundles using the CLI. The output is a separate file that can be deployed independently of your application.

## Quickstart[​](#quickstart "Direct link to Quickstart")

### 1. Install the CLI[​](#1-install-the-cli "Direct link to 1. Install the CLI")

```
npm install -g @walkeros/cli

# Verify installation
walkeros --version
```

### 2. Create a flow configuration[​](#2-create-a-flow-configuration "Direct link to 2. Create a flow configuration")

Create `flow.json`:

* Web (browser)
* Server (Node.js)

```
{
  "version": 4,
  "flows": {
    "default": {
      "config": {
        "platform": "web",
        "bundle": {
          "packages": {
            "@walkeros/collector": {},
            "@walkeros/web-source-browser": {}
          }
        }
      },
      "sources": {
        "browser": {
          "package": "@walkeros/web-source-browser",
          "config": {
            "settings": {
              "pageview": true,
              "session": true
            }
          }
        }
      },
      "collector": { "run": true }
    }
  }
}
```

```
{
  "version": 4,
  "flows": {
    "default": {
      "config": {
        "platform": "server",
        "bundle": {
          "packages": {
            "@walkeros/collector": {},
            "@walkeros/server-source-express": {},
            "@walkeros/destination-demo": {}
          }
        }
      },
      "sources": {
        "http": {
          "package": "@walkeros/server-source-express",
          "config": {
            "settings": { "path": "/collect", "port": 8080 }
          }
        }
      },
      "destinations": {
        "console": {
          "package": "@walkeros/destination-demo",
          "config": {
            "settings": { "name": "Event Logger" }
          }
        }
      },
      "collector": { "run": true }
    }
  }
}
```

### 3. Build the bundle[​](#3-build-the-bundle "Direct link to 3. Build the bundle")

```
walkeros bundle flow.json
```

This writes the bundle to stdout. Use `-o` to write to a file:

* **Web**: `-o ./dist/walker.js` (IIFE format, loadable via script tag)
* **Server**: `-o ./dist/bundle.mjs` (ESM format, runnable with Node.js)

### 4. Deploy[​](#4-deploy "Direct link to 4. Deploy")

* Web
* Server

Add to your HTML:

```
<script src="/walker.js"></script>
```

Run directly:

```
node ./dist/bundle.mjs
```

Or with Docker:

```
walkeros run flow.json
```

***

## Adding destinations[​](#adding-destinations "Direct link to Adding destinations")

Add destinations to your `flow.json`:

```
{
  "version": 4,
  "flows": {
    "default": {
      "config": {
        "platform": "web",
        "bundle": {
          "packages": {
            "@walkeros/collector": {},
            "@walkeros/web-source-browser": {},
            "@walkeros/web-destination-api": {},
            "@walkeros/web-destination-gtag": {}
          }
        }
      },
      "sources": {
        "browser": {
          "package": "@walkeros/web-source-browser",
          "config": { "settings": { "pageview": true } }
        }
      },
      "destinations": {
        "api": {
          "package": "@walkeros/web-destination-api",
          "config": {
            "settings": { "url": "https://your-api.com/events" }
          }
        },
        "ga4": {
          "package": "@walkeros/web-destination-gtag",
          "config": {
            "settings": {
              "ga4": { "measurementId": "G-XXXXXXXXXX" }
            }
          }
        }
      },
      "collector": { "run": true }
    }
  }
}
```

Rebuild: `walkeros bundle flow.json`

***

## Adding consent[​](#adding-consent "Direct link to Adding consent")

Add consent requirements in the destination config:

```
"destinations": {
  "api": {
    "package": "@walkeros/web-destination-api",
    "config": {
      "settings": { "url": "https://your-api.com/events" },
      "consent": { "functional": true }
    }
  },
  "ga4": {
    "package": "@walkeros/web-destination-gtag",
    "config": {
      "settings": { "ga4": { "measurementId": "G-XXXXXXXXXX" } },
      "consent": { "analytics": true }
    }
  }
}
```

Set consent at runtime:

```
// After loading walker.js

elb('walker consent', { functional: true, analytics: true });
```

***

## Key concepts[​](#key-concepts "Direct link to Key concepts")

### The `package:` property[​](#the-package-property "Direct link to the-package-property")

In Bundled mode, you reference packages by name:

```
"sources": {

  "browser": {

    "package": "@walkeros/web-source-browser"

  }

}
```

The CLI downloads and bundles the package. This differs from Integrated mode where you use `code:` with a direct import.

### Variables and environment[​](#variables-and-environment "Direct link to Variables and environment")

Use variables for environment-specific values:

```
{
  "version": 4,
  "variables": {
    "GA_ID": "$env.GA_MEASUREMENT_ID:G-DEFAULT",
    "API_URL": "$env.API_ENDPOINT:https://api.example.com"
  },
  "flows": {
    "default": {
      "destinations": {
        "ga4": {
          "config": {
            "settings": { "ga4": { "measurementId": "$var.GA_ID" } }
          }
        }
      }
    }
  }
}
```

Environment variables (`$env.NAME:default`) are resolved at build time. Config variables (`$var.name`) reference values from the `variables` section.

### Multiple flows[​](#multiple-flows "Direct link to Multiple flows")

Define different flows for different environments:

```
{
  "version": 4,
  "flows": {
    "development": {
      "config": { "platform": "web" },
      "destinations": {
        "console": { "package": "@walkeros/destination-demo" }
      }
    },
    "production": {
      "config": { "platform": "web" },
      "destinations": {
        "ga4": { "package": "@walkeros/web-destination-gtag" }
      }
    }
  }
}
```

Build specific flow: `walkeros bundle flow.json --flow production`

***

## CLI commands[​](#cli-commands "Direct link to CLI commands")

| Command                    | Purpose                      |
| -------------------------- | ---------------------------- |
| `walkeros bundle`          | Build production bundle      |
| `walkeros push --simulate` | Test with mocked events      |
| `walkeros push`            | Test with real API calls     |
| `walkeros run`             | Start HTTP collection server |

See [CLI documentation](https://www.walkeros.io/docs/apps/cli.md) for full details.

***

## Docker deployment[​](#docker-deployment "Direct link to Docker deployment")

For production server deployments:

```
# Build the bundle
walkeros bundle flow.json

# Run with Docker
docker run -d -p 8080:8080 \
  -v $(pwd)/dist/bundle.mjs:/app/flow.mjs \
  -e BUNDLE=/app/flow.mjs \
  walkeros/flow:latest
```

See [Docker documentation](https://www.walkeros.io/docs/apps/docker.md) for complete deployment guides.

***

## See your event[​](#see-your-event "Direct link to See your event")

Before you build and deploy, run the event through the flow offline with the named destination mocked.

* Web (browser)
* Server (Node.js)

Using the flow\.json with destinations you created above, `push` builds the flow and runs the event through it with the named destination mocked. Nothing is sent to a vendor.

```
npx walkeros push flow.json \
  -e '{"name":"page view"}' \
  --simulate destination.ga4
```

Using the **server** `flow.json` above (which defines the `console` destination), `push` builds and simulates it:

```
npx walkeros push flow.json \
  -e '{"name":"page view"}' \
  --simulate destination.console
```

`push --simulate` builds the flow, runs the event through it with `destination.console` replaced by a mock, and prints the resolved outcome (`success` and `Duration`); add `--json` to get the same result as JSON. Nothing is sent to a vendor. Event names use a space (`page view`).

***

## Observe a running flow[​](#observe-a-running-flow "Direct link to Observe a running flow")

To watch a deployed web bundle's events live, add the public connect pair to the flow's `config` and rebuild once:

```
"config": {
  "platform": "web",
  "observe": {
    "url": "https://observer.example.com",
    "binding": "pb_x"
  }
}
```

Rebuild: `walkeros bundle flow.json`

Both values are public and safe to commit; set both, a partial pair warns at build time and wires nothing. The bundle never contains a credential: the per-session credential arrives at runtime via a `?elbObserve=` URL parameter. See [Observe](https://www.walkeros.io/docs/getting-started/observe.md) for the full setup and the credential lifecycle.

***

## Next steps[​](#next-steps "Direct link to Next steps")

* [**CLI documentation**](https://www.walkeros.io/docs/apps/cli.md): All CLI commands and options
* [**Docker deployment**](https://www.walkeros.io/docs/apps/docker.md): Production container deployment
* [**Mapping**](https://www.walkeros.io/docs/mapping.md): Transform events for destinations

***

## See also[​](#see-also "Direct link to See also")

* [**Integrated mode**](https://www.walkeros.io/docs/getting-started/modes/integrated.md): Build into your app with TypeScript
* [**Collector reference**](https://www.walkeros.io/docs/collector.md): Understanding the collector engine
