@traffical/node 0.12.0 → 0.12.2

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.
package/README.md CHANGED
@@ -16,7 +16,7 @@ bun add @traffical/node
16
16
  import { TrafficalClient } from '@traffical/node';
17
17
 
18
18
  const client = new TrafficalClient({
19
- apiKey: 'sk_...', // Server-side API key
19
+ apiKey: 'traffical_sk_…', // Server-side API key
20
20
  });
21
21
 
22
22
  // Get parameters for a user
@@ -47,7 +47,7 @@ const client = new TrafficalClient({
47
47
  orgId: 'org_...',
48
48
  projectId: 'proj_...',
49
49
  env: 'production',
50
- apiKey: 'sk_...',
50
+ apiKey: 'traffical_sk_…',
51
51
 
52
52
  // Optional
53
53
  baseUrl: 'https://sdk.traffical.io', // Custom edge endpoint
@@ -83,7 +83,7 @@ const decision = await client.decide({
83
83
  'feature.enabled': true,
84
84
  'ui.theme': 'dark',
85
85
  },
86
- exposures: [...] // Which experiments the user is in
86
+ exposures: [...] // Which policies the user is in
87
87
  }
88
88
  ```
89
89
 
@@ -115,7 +115,7 @@ The Node SDK automatically batches events for efficiency:
115
115
 
116
116
  ```typescript
117
117
  const client = new TrafficalClient({
118
- apiKey: 'sk_...',
118
+ apiKey: 'traffical_sk_…',
119
119
  batchSize: 10, // Events per batch (default: 10)
120
120
  flushIntervalMs: 30000, // Flush interval in ms (default: 30s)
121
121
  });
@@ -183,7 +183,7 @@ type TypedTrack = <E extends Extract<keyof TrafficalEventProperties, string>>(
183
183
  }
184
184
  ) => Promise<void>;
185
185
 
186
- const client = new TrafficalClient({ apiKey: 'sk_...' });
186
+ const client = new TrafficalClient({ apiKey: 'traffical_sk_…' });
187
187
  export const track = client.track.bind(client) as unknown as TypedTrack;
188
188
  ```
189
189
 
package/dist/client.d.ts CHANGED
@@ -97,7 +97,7 @@ export interface TrafficalClientOptions extends CoreClientOptions {
97
97
  disableCloudEvents?: boolean;
98
98
  /**
99
99
  * When true, assignment logger calls are deduplicated via in-memory LRU
100
- * (same unit+policy+variant won't fire again within TTL). Default: true.
100
+ * (same unit+policy+allocation won't fire again within TTL). Default: true.
101
101
  */
102
102
  deduplicateAssignmentLogger?: boolean;
103
103
  /**
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Tests for the Node SDK exposure path (enh #3 — parity with the browser SDK):
3
- * - trackExposure() skips `attributionOnly` layers (experiments the user was
3
+ * - trackExposure() skips `attributionOnly` layers (policies the user was
4
4
  * assigned to for attribution but not actually shown).
5
5
  * - trackExposure() deduplicates per (unit, policy, allocation) within a session.
6
6
  * - getUnitKeyField() / getParameterLayerId() read the loaded bundle.
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Tests for the Node SDK exposure path (enh #3 — parity with the browser SDK):
3
- * - trackExposure() skips `attributionOnly` layers (experiments the user was
3
+ * - trackExposure() skips `attributionOnly` layers (policies the user was
4
4
  * assigned to for attribution but not actually shown).
5
5
  * - trackExposure() deduplicates per (unit, policy, allocation) within a session.
6
6
  * - getUnitKeyField() / getParameterLayerId() read the loaded bundle.
package/dist/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const SDK_VERSION = "0.12.0";
1
+ export declare const SDK_VERSION = "0.12.2";
2
2
  //# sourceMappingURL=version.d.ts.map
package/dist/version.js CHANGED
@@ -1,3 +1,3 @@
1
1
  // Auto-generated from package.json — do not edit manually.
2
- export const SDK_VERSION = "0.12.0";
2
+ export const SDK_VERSION = "0.12.2";
3
3
  //# sourceMappingURL=version.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@traffical/node",
3
- "version": "0.12.0",
3
+ "version": "0.12.2",
4
4
  "description": "Traffical SDK for Node.js - HTTP client with caching and event tracking",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -23,8 +23,8 @@
23
23
  "typecheck": "bun run generate-version && tsc --noEmit"
24
24
  },
25
25
  "dependencies": {
26
- "@traffical/core": "0.12.0",
27
- "@traffical/core-io": "0.7.1"
26
+ "@traffical/core": "0.12.1",
27
+ "@traffical/core-io": "0.7.2"
28
28
  },
29
29
  "devDependencies": {
30
30
  "@types/bun": "latest",