@picked/analytics 0.0.101-next.1 → 0.0.101-next.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +28 -30
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -1,42 +1,40 @@
1
- # snowplow
1
+ # @picked/analytics
2
2
 
3
- ## Validating schemas
3
+ Tracks the events of the Picked client — experiences, steps, feature flags and commerce —
4
+ with Snowplow, so they reach your Picked analytics.
4
5
 
5
- `Igluctl` is required to validate schema. Check the official documentation for installation
6
- instructions: [https://github.com/snowplow/igluctl](https://github.com/snowplow/igluctl).
7
-
8
- Unzip the `igluctl` binary and place it in the `packages/analytics` directory.
9
-
10
- You may need to update the `igluctl` binary permissions to make it executable:
6
+ ## Install
11
7
 
12
8
  ```bash
13
- chmod +x ./igluctl
9
+ npm install picked @picked/analytics
14
10
  ```
15
11
 
16
- ## Testing schemas
17
-
18
- Use Snowplow Micro for testing schemas. Check the official documentation for installation
19
- instructions: [https://github.com/snowplow-incubator/snowplow-micro](https://github.com/snowplow-incubator/snowplow-micro).
20
-
21
- ## Local development
12
+ ## Usage
22
13
 
23
- Install the [Snowplow Debugger chrome extension](https://chromewebstore.google.com/detail/jbnlcgeengmijcghameodeaenefieedm?utm_source=item-share-cb)
14
+ ```typescript
15
+ import { createClient } from 'picked'
16
+ import { analyticsPlugin } from '@picked/analytics/plugins/analytics'
24
17
 
25
- Build the schemas locally `pnpm run build:schema` and copy the output directory path for Snowplow debugger
26
-
27
- - If testing on staging use `https://sc-metadata-production.s3-us-west-2.amazonaws.com`
28
-
29
- Run Snowplow Micro server `pnpm run dev:micro`
30
-
31
- Set `collectorUrl` to `http://localhost:9090` in the tracker options when loading analytics plugin.
18
+ export const picked = createClient({
19
+ projectId: 'your-project-id',
20
+ plugins: [analyticsPlugin({ trackerOptions: { deployment: { env: 'production' } } })],
21
+ })
22
+ ```
32
23
 
33
- ## Deployment
24
+ The tracker takes the project ID from the client.
34
25
 
35
- [Navigate to the evnts.pckd.dev Collector](https://app.snowcatcloud.com/collectors)
26
+ | Option | Description |
27
+ | ------------------------------- | ------------------------------------------------------------------------------------- |
28
+ | `trackerOptions.deployment.env` | Required. The environment of this deployment, such as `production`. |
29
+ | `trackerOptions.collectorUrl` | The Snowplow collector. Defaults to Picked's. |
30
+ | `trackerOptions.collectorPath` | The collector path, when your own origin proxies the collector. |
31
+ | `trackerOptions.track*` | Turn individual Snowplow trackers on or off, such as `trackErrors` and `trackVitals`. |
32
+ | `enableInteractionListeners` | Track clicks and other interactions: `true`, or a list of interaction names. |
33
+ | `enableDocumentListeners` | Track page visibility, online and offline, resize and unload events. |
36
34
 
37
- *Update schema*
35
+ ## Docs
38
36
 
39
- 1. Click on the latest version pill of the schema.
40
- 2. Increment the version in the dropdown.
41
- 3. Paste the output from the schema build and validate.
42
- 4. Toggle `In Production` to deploy to production.
37
+ - **Web:** [Analytics events](https://docs.picked.app/reference/sdk/analytics-events)
38
+ - **Local:** `node_modules/picked/docs/reference/sdk/analytics-events.md`. The `picked` package carries every page under `node_modules/picked/docs/`.
39
+ - **CLI:** `npx picked docs read /reference/sdk/analytics-events`. `npx picked docs list [words]` lists the pages.
40
+ - **MCP:** call `read_picked_doc` with `{ "path": "/reference/sdk/analytics-events" }`; `list_picked_docs` lists the pages. Add the server with `claude mcp add --transport http picked https://api.picked.app/mcp`, or see [How to connect the MCP server](https://docs.picked.app/how-to/connect-the-mcp-server) for other tools.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@picked/analytics",
3
3
  "description": "Picked Analytics",
4
- "version": "0.0.101-next.1",
4
+ "version": "0.0.101-next.3",
5
5
  "dependencies": {
6
6
  "@snowplow/browser-plugin-button-click-tracking": "^4.10.0",
7
7
  "@snowplow/browser-plugin-error-tracking": "^4.10.0",
@@ -74,7 +74,7 @@
74
74
  "main": "./dist/cjs/index.js",
75
75
  "module": "./dist/esm/index.js",
76
76
  "peerDependencies": {
77
- "@picked/client": "0.0.101-next.1",
77
+ "@picked/client": "0.0.101-next.3",
78
78
  "effector": "^23.4.4"
79
79
  },
80
80
  "private": false,