@traffical/node 0.12.0 → 0.12.1
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 +5 -5
- package/dist/client.d.ts +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
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: '
|
|
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: '
|
|
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
|
|
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: '
|
|
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: '
|
|
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+
|
|
100
|
+
* (same unit+policy+allocation won't fire again within TTL). Default: true.
|
|
101
101
|
*/
|
|
102
102
|
deduplicateAssignmentLogger?: boolean;
|
|
103
103
|
/**
|
package/dist/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "0.12.
|
|
1
|
+
export declare const SDK_VERSION = "0.12.1";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/dist/version.js
CHANGED