Skip to content

Commit

Permalink
client to source
Browse files Browse the repository at this point in the history
  • Loading branch information
alexanderkirtzel committed Nov 21, 2024
1 parent 0763358 commit 3064d5d
Show file tree
Hide file tree
Showing 18 changed files with 55 additions and 56 deletions.
2 changes: 1 addition & 1 deletion website/docs/destinations/_category_.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"label": "Destinations (Activating)",
"label": "Destinations",
"position": 3
}
18 changes: 9 additions & 9 deletions website/docs/destinations/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ Destinations initialize and process events **only if a user granted consent**.

## How to use

Destinations are added to a client
Destinations are added to a source
(see&nbsp;<Link to="/docs/sources/walkerjs/commands#destinations">web</Link>
or&nbsp;<Link to="/docs/sources/node/commands#destinations">node</Link>). Before
receiving events from the client, the proper consent states are checked each
receiving events from the source, the proper consent states are checked each
time automatically. Destinations receive events through the [`push`](#push)
interface. Each destination can have its own configuration, which is set up in
the [`config`](#configuration) object. This configuration includes general
Expand All @@ -40,12 +40,12 @@ title: Eventflow
---
flowchart LR
subgraph frontend["Frontend <small>(client-side)</small>"]
webC["walker.js<br>web client"]
webC["walker.js<br>web source"]
webD["<b>Web<br>Destinations</b>"]
webC -- consent<br>check --> webD
end
subgraph backend["Backend <small>(server-side)</small>"]
nodeC["Node<br>client"]
nodeC["Node<br>source"]
nodeD["<b>Node<br>Destinations</b>"]
nodeC -- consent<br>check --> nodeD
end
Expand Down Expand Up @@ -92,7 +92,7 @@ optional. A complete destination configuration might look like this:
onError: (error) => console.error("demo error", error),
onLog: (message) => console.log("demo log", message),
on: {
// Client-related on-events
// Source-related on-events
consent: [{ marketing: console.log }],
ready: [console.log],
run: [console.log],
Expand Down Expand Up @@ -120,15 +120,15 @@ Overview of all properties:
| **on** | On.Config | Rules for on-functions that gets triggered on specific events |

Call `elb('walker destination', { push: console.log }, config);` to add the
destination to a client. The destination will log all events straight to the
destination to a source. The destination will log all events straight to the
console. Edit a destinations configuration at runtime by accessing
`walkerjs.destinations.<id>`.

> To grant required consent call `elb('walker consent', { demo: true });`.
## Methods

A client communicates with a destination through the methods. It's also the
A source communicates with a destination through the methods. It's also the
sources job to check for proper consent, calling the `init` method or batching
events. The only required method is `push` to send events to the destination.

Expand Down Expand Up @@ -207,7 +207,7 @@ batch = {
### on

The `on` method is used to set up rules for on-functions that get triggered by
the client (individually for walker.js and node).
the source (individually for walker.js and node).

```js
const on = {
Expand All @@ -218,7 +218,7 @@ const on = {
};
```

Once a client triggers an event, the destinations `on` method gets called.
Once a source triggers an event, the destinations `on` method gets called.
Replace the `console.log` with your custom function.

## Available Destinations
Expand Down
2 changes: 1 addition & 1 deletion website/docs/destinations/node/bigquery.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,6 @@ for companies looking to centralize their data collection and analysis efforts.
Before using the BigQuery destination, ensure you have:

- Google Cloud Platform account
- walkerOS Node client installed
- walkerOS Node source installed
- Permissions to write to BigQuery
- Run the setup function to create the table
4 changes: 2 additions & 2 deletions website/docs/destinations/node/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@ extend your data pipeline.

### init

Before pushing events to a destination, the node client checks for an available
Before pushing events to a destination, the node source checks for an available
`init` function and calls it. This asynchronous function returns either `false`
if an error occurs, preventing any events from being processed, or a complete
destination `config` that will be used for pushing events.

### push

The node client calls `await destination.push([{ event, mapping }], config);` to
The node source calls `await destination.push([{ event, mapping }], config);` to
send events to destinations. This function is executed after checking for proper
consent settings. Events are processed in parallel, and the function supports
the batching of multiple events. The mapping parameter is optional and allows
Expand Down
2 changes: 1 addition & 1 deletion website/docs/destinations/node/meta.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ await elb('walker destination', destinationMeta, {

Before using the Meta destination, ensure you have:

- walkerOS Node client installed
- walkerOS Node source installed
- <Link to="https://developers.facebook.com/docs/marketing-api/conversions-api/get-started#requirements">
Conversion API requirements
</Link>
2 changes: 1 addition & 1 deletion website/docs/destinations/web/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import Link from '@docusaurus/Link';
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

Like the&nbsp;<Link to="/docs/sources/walkerjs">web client walker.js</Link>, the
Like the&nbsp;<Link to="/docs/sources/walkerjs">web source walker.js</Link>, the
web destinations run in a users browser directly. It's purpose is to initialize
a destination, <Link to="/docs/destinations/#mapping">map event</Link> data to
the destination's requirements, and send them.
Expand Down
14 changes: 7 additions & 7 deletions website/docs/sources/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ walkerOS sources work as an implementation layer for the **data creation** and
server-side application with Node.js or a client-side web application (with more
to come...).

## Client types
## Source types

Select the client that best fits your application's needs:
Select the source that best fits your application's needs:

- <Link to="/docs/sources/walkerjs/">**walker.js (web)**</Link>: Designed for
client-side web applications, SPAs, and websites.
Expand All @@ -28,15 +28,15 @@ Select the client that best fits your application's needs:
- **Consent handling**: Robustly manage user consent for privacy compliance.
- **Dynamic destinations**: Easily add destinations and map data.

### Walker.js Web Client Features
### Walker.js Web Source Features

- **Client-Side Tracking**: Capture detailed user interactions in the browser.
- **Source-Side Tracking**: Capture detailed user interactions in the browser.
- **Real-Time Analytics**: Gain instant insights into user behaviors.
- **Race conditions**: Automatically handle the order and status of events.
- **In-built triggers**: Optimized trigger initialization.
- **Tagging method**: Simplify event tagging using HTML attributes.

### Node Client Features
### Node Source Features

- **Server-Side Tracking**: Track server-side events.
- **Batch Processing**: Efficiently manage large data volumes.
Expand All @@ -46,6 +46,6 @@ Select the client that best fits your application's needs:

## Getting Started

To begin with, select your preferred client type and follow our detailed
documentation for setup and integration. Each client is designed for easy
To begin with, select your preferred source type and follow our detailed
documentation for setup and integration. Each source is designed for easy
implementation, ensuring a smooth integration into your projects.
2 changes: 1 addition & 1 deletion website/docs/sources/node/_category_.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"label": "Node (Server)",
"label": "Node",
"position": 2
}
12 changes: 6 additions & 6 deletions website/docs/sources/node/commands.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,26 @@ description: Ways to configure the walker.js

import Link from '@docusaurus/Link';

A node client can either be created with a
A node source can either be created with a
custom&nbsp;<Link to="/docs/sources/node/installation#configuration">config</Link>
during initialization or updated via commands using the `elb` function.

## elb

The `elb` function gets returned when creating a node client. It pushes events
The `elb` function gets returned when creating a node source. It pushes events
and commands to the instance and runs asynchronously by returning a promise.

```ts
import { nodeClient } from '@elbwalker/client-node';
const { elb } = nodeClient();
import { createSourceNode } from '@elbwalker/source-node';
const { elb } = createSourceNode();

const result = await elb('entity action', { foo: 'bar' });
```

## Configuration

To&nbsp;<Link to="/docs/sources/node/installation#configuration">configure</Link>
the node client either do it while creating an instance or use the
the node source either do it while creating an instance or use the
`walker config` command:

```js
Expand All @@ -48,7 +48,7 @@ elb('walker run');

## Destinations

The `walker destination` command adds a destination to the node client.
The `walker destination` command adds a destination to the node source.

```js
const destinationLog = { push: console.log };
Expand Down
10 changes: 5 additions & 5 deletions website/docs/sources/node/index.mdx
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
---
title: Node client
description: node client for server-side data processing with walkerOS.
title: Node source
description: node source for server-side data processing with walkerOS.
---

import Link from '@docusaurus/Link';
import PackageLink from '/src/components/docs/package-link';

<PackageLink github="packages/sources/node/" npm="@elbwalker/client-node" />
<PackageLink github="packages/sources/node/" npm="@elbwalker/source-node" />

The walkerOS node client is build for both, being used in a node app or as part
The walkerOS node source is build for both, being used in a node app or as part
of a serverless function. It's goal is to capture user events, state management,
and sending data to&nbsp;<Link to="/docs/destinations/node/">node
destinations</Link>.

## Event Lifecycle

1. **Run Initialization**: Similar to a web page view, each run reinitialize the
client's state.
source's state.
2. **Event Creation**: Events are formulated and queued internally.
3. **Consent Verification**: Consent is checked before pushing events.
4. **Destination Management**: Events are sent to destinations based on consent
Expand Down
22 changes: 11 additions & 11 deletions website/docs/sources/node/installation.mdx
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
---
title: Installation
sidebar_position: 1
description: Installation and configuration of the walkerOS node client.
description: Installation and configuration of the walkerOS node source.
---

import Link from '@docusaurus/Link';

Install the walkerOS node client, via NPM:
Install the walkerOS node source, via NPM:

```bash
npm install @elbwalker/client-node
npm install @elbwalker/source-node
```

Use the `nodeClient` function to create a new client instance. It returns the
`elb` function for configuration
Use the `createSourceNode` function to create a new source instance. It returns
the `elb` function for configuration
via&nbsp;<Link to="/docs/sources/node/commands">commands</Link> and pushing
events, and the `instance` itself.

```ts
import { nodeClient } from '@elbwalker/client-node';
const { elb, instance } = nodeClient({});
import { createSourceNode } from '@elbwalker/source-node';
const { elb, instance } = createSourceNode({});
```

## Configuration

There a few configuration options when creating a node client instance:
There a few configuration options when creating a node source instance:

| Option | Type | Description |
| ------------- | -------- | --------------------------------------------------------- |
Expand All @@ -38,7 +38,7 @@ There a few configuration options when creating a node client instance:
| verbose | boolean | To enable verbose mode |

```ts
const { instance } = nodeClient({
const { instance } = createSourceNode({
consent: {
functional: true,
},
Expand All @@ -55,10 +55,10 @@ const { instance } = nodeClient({
version: '3.1.4',
},
onError: (error) => {
console.error('node client', error);
console.error('node source', error);
},
onLog: (message) => {
console.log('node client', message);
console.log('node source', message);
},
source: {
type: 'server',
Expand Down
8 changes: 4 additions & 4 deletions website/docs/sources/walkerjs/index.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Web Client walker.js
description: walker.js web client for client-side data collection with walkerOS.
title: Web Source walker.js
description: walker.js web source for client-side data collection with walkerOS.
---

import Link from '@docusaurus/Link';
Expand Down Expand Up @@ -61,7 +61,7 @@ Add some tags in your HTML...
device: 'c00k131d',
session: 's3ss10n1d',
},
nested: [],
nested: [], // List of nested entities
consent: { functional: true }, // Status of the granted consent state(s)
id: '1647261462000-01b5e2-5', // Timestamp, group & count of the event
trigger: 'visible', // Name of the trigger that fired
Expand All @@ -73,7 +73,7 @@ Add some tags in your HTML...
count: 2, // Incremental counter of the events in the same run
version: {
// Information about the used implementation setup
client: 'X.X.X', // Semantic version of the used client
source: 'X.X.X', // Semantic version of the used source
tagging: 42, // A version number of the then-used tagging status
},
source: {
Expand Down
2 changes: 1 addition & 1 deletion website/docs/sources/walkerjs/installation/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description: How to install walker.js.

import Link from '@docusaurus/Link';

There are multiple ways to install and use the web client walker.js:
There are multiple ways to install and use the web source walker.js:

- **<Link to="/docs/sources/walkerjs/installation/gtm">Google Tag
Manager</Link>**: Use the GTM to load walker.js.
Expand Down
4 changes: 2 additions & 2 deletions website/docs/sources/walkerjs/tagging.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ Tag a page with...
device: 'c00k131d',
session: 's3ss10n1d',
},
nested: [],
nested: [], // List of nested entities
consent: { functional: true }, // Status of the granted consent state(s)
id: '1647261462000-01b5e2-5', // Timestamp, group & count of the event
trigger: 'visible', // Name of the trigger that fired
Expand All @@ -74,7 +74,7 @@ Tag a page with...
count: 2, // Incremental counter of the events in the same run
version: {
// Information about the used implementation setup
client: 'X.X.X', // Semantic version of the used client
source: 'X.X.X', // Semantic version of the used source
tagging: 42, // A version number of the then-used tagging status
},
source: {
Expand Down
2 changes: 1 addition & 1 deletion website/docs/sources/walkerjs/versions.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ description: walker.js changelog and version history.
- Push events via elb [#372](https://github.com/elbwalker/walkerOS/issues/372)
- sessionStart cb with defaultCb parameter
[#380](https://github.com/elbwalker/walkerOS/issues/380)
- Export more core functions with a client
- Export more core functions with a source
[#364](https://github.com/elbwalker/walkerOS/issues/364)
- separate code [#384](https://github.com/elbwalker/walkerOS/issues/384)
- Pulse and update support for sessionStart
Expand Down
2 changes: 1 addition & 1 deletion website/docs/walkeros/event-model.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ different value types.
count: 2, // Incremental counter of the events in the same run
version: {
// Information about the used implementation setup
client: 'X.X.X', // Semantic version of the used client
source: 'X.X.X', // Semantic version of the used source
tagging: 42, // A version number of the then-used tagging status
},
source: {
Expand Down
2 changes: 1 addition & 1 deletion website/docs/walkeros/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ flowchart LR
- **c**: Events
are&nbsp;<Link to="/docs/destinations/web/#create-your-own">formatted
correctly</Link> and get sent directly to the respective tools from the
client.
source.

### Server-side setups

Expand Down
1 change: 0 additions & 1 deletion website/src/components/services/projects.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React from 'react';
import { Button } from '../atoms/buttons';

import { CheckIcon } from '@heroicons/react/20/solid';

Expand Down

0 comments on commit 3064d5d

Please sign in to comment.