@gurulu/node 0.1.0 → 0.1.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/dist/{node-sdk/src/business-events.d.ts → business-events.d.ts} +2 -2
- package/dist/{node-sdk/src/business-events.js → business-events.js} +2 -4
- package/dist/client.d.ts +150 -0
- package/dist/{node-sdk/src/client.js → client.js} +189 -2
- package/dist/{node-sdk/src/index.d.ts → index.d.ts} +3 -2
- package/dist/{node-sdk/src/index.js → index.js} +10 -1
- package/dist/middleware.d.ts +31 -0
- package/dist/middleware.js +138 -0
- package/dist/{node-sdk/src/types.d.ts → types.d.ts} +2 -0
- package/package.json +14 -1
- package/dist/node-sdk/src/client.d.ts +0 -70
- package/dist/shared-core/src/canonical-events.d.ts +0 -35
- package/dist/shared-core/src/canonical-events.js +0 -225
- package/dist/shared-core/src/envelope.d.ts +0 -91
- package/dist/shared-core/src/envelope.js +0 -341
- package/dist/shared-core/src/index.d.ts +0 -6
- package/dist/shared-core/src/index.js +0 -22
- package/dist/shared-core/src/server-event.d.ts +0 -37
- package/dist/shared-core/src/server-event.js +0 -6
- /package/dist/{node-sdk/src/types.js → types.js} +0 -0
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @gurulu/node — server-side SDK client.
|
|
3
|
-
*
|
|
4
|
-
* Responsibilities (Phase 10 W4.2):
|
|
5
|
-
* - Queue + batch server events.
|
|
6
|
-
* - Auto-flush at batchSize boundary and on a periodic timer.
|
|
7
|
-
* - Exponential-backoff retry (200ms, 600ms, 1800ms — 3 attempts total) on
|
|
8
|
-
* 5xx / network errors. No retry on 4xx.
|
|
9
|
-
* - Attach deterministic Idempotency-Key headers so the server can dedupe
|
|
10
|
-
* replayed batches across retries.
|
|
11
|
-
* - Dead-letter callback for batches that exhaust retries or are rejected
|
|
12
|
-
* with a client error.
|
|
13
|
-
* - Flush on process.beforeExit + SIGTERM.
|
|
14
|
-
*
|
|
15
|
-
* Event shapes are pulled from @gurulu/shared-core (W1.2). Only the transport
|
|
16
|
-
* config (`GuruluClientConfig`) is local.
|
|
17
|
-
*
|
|
18
|
-
* Related docs: PHASE-10-ROADMAP.md §W4.2
|
|
19
|
-
*/
|
|
20
|
-
import type { ServerEvent } from '@gurulu/shared-core';
|
|
21
|
-
import type { GuruluClientConfig } from './types';
|
|
22
|
-
export interface GuruluClient {
|
|
23
|
-
track(event: ServerEvent): void;
|
|
24
|
-
flush(): Promise<void>;
|
|
25
|
-
shutdown(): Promise<void>;
|
|
26
|
-
/** Current queue length — exposed for tests and observability. */
|
|
27
|
-
readonly queueSize: number;
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Deterministic idempotency key for a server event. Hashes the tuple
|
|
31
|
-
* (site_id, event_name, timestamp, anonymous_id/user_id) so replayed events
|
|
32
|
-
* across retries produce the same key and the server can dedupe.
|
|
33
|
-
*/
|
|
34
|
-
export declare function createIdempotencyKey(event: ServerEvent, siteId: string): string;
|
|
35
|
-
export declare class Gurulu implements GuruluClient {
|
|
36
|
-
private readonly siteId;
|
|
37
|
-
private readonly apiKey;
|
|
38
|
-
private readonly endpoint;
|
|
39
|
-
private readonly flushInterval;
|
|
40
|
-
private readonly batchSize;
|
|
41
|
-
private readonly timeout;
|
|
42
|
-
private readonly onError?;
|
|
43
|
-
private readonly onDeadLetter?;
|
|
44
|
-
private readonly fetchImpl;
|
|
45
|
-
private readonly debug;
|
|
46
|
-
private queue;
|
|
47
|
-
private flushTimer;
|
|
48
|
-
private inFlight;
|
|
49
|
-
private shutdownHandlers;
|
|
50
|
-
constructor(config: GuruluClientConfig);
|
|
51
|
-
get queueSize(): number;
|
|
52
|
-
/**
|
|
53
|
-
* Enqueue a server event. Auto-flushes synchronously when the queue reaches
|
|
54
|
-
* `batchSize`. Each event is stamped with a timestamp if missing so the
|
|
55
|
-
* idempotency key is stable across retries.
|
|
56
|
-
*/
|
|
57
|
-
track(event: ServerEvent): void;
|
|
58
|
-
/**
|
|
59
|
-
* POST all queued events in one batch. On 5xx / network error retries with
|
|
60
|
-
* exponential backoff (200ms, 600ms, 1800ms). On 4xx drops the batch and
|
|
61
|
-
* fires the dead-letter callback. Concurrent flush calls are serialized.
|
|
62
|
-
*/
|
|
63
|
-
flush(): Promise<void>;
|
|
64
|
-
private sendBatch;
|
|
65
|
-
/**
|
|
66
|
-
* Stop the periodic flush timer, detach process listeners, and perform a
|
|
67
|
-
* final flush. Safe to call multiple times.
|
|
68
|
-
*/
|
|
69
|
-
shutdown(): Promise<void>;
|
|
70
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Canonical Event Catalog — standardised event names and typed property
|
|
3
|
-
* schemas shared across all Gurulu SDKs (web, iOS, Android, server).
|
|
4
|
-
*
|
|
5
|
-
* Every SDK exposes typed convenience helpers that delegate to the generic
|
|
6
|
-
* `track()` method using the `$`-prefixed event names defined here. Users
|
|
7
|
-
* can still call `track('$purchase', { ... })` directly; the helpers are
|
|
8
|
-
* purely ergonomic.
|
|
9
|
-
*
|
|
10
|
-
* Property names are **snake_case** on all platforms.
|
|
11
|
-
*/
|
|
12
|
-
export interface EventPropertySchema {
|
|
13
|
-
name: string;
|
|
14
|
-
type: 'string' | 'number' | 'boolean' | 'array' | 'object';
|
|
15
|
-
required: boolean;
|
|
16
|
-
description: string;
|
|
17
|
-
}
|
|
18
|
-
export type EventCategory = 'core' | 'acquisition' | 'activation' | 'revenue' | 'engagement' | 'retention' | 'referral';
|
|
19
|
-
export interface CanonicalEvent {
|
|
20
|
-
/** Dollar-prefixed canonical name, e.g. `$purchase`. */
|
|
21
|
-
name: string;
|
|
22
|
-
/** Human-readable label for dashboards. */
|
|
23
|
-
displayName: string;
|
|
24
|
-
/** AARRR pirate-metrics category. */
|
|
25
|
-
category: EventCategory;
|
|
26
|
-
description: string;
|
|
27
|
-
properties: EventPropertySchema[];
|
|
28
|
-
}
|
|
29
|
-
export declare const CANONICAL_EVENTS: CanonicalEvent[];
|
|
30
|
-
/** Retrieve a canonical event definition by its `$`-prefixed name. */
|
|
31
|
-
export declare function getCanonicalEvent(name: string): CanonicalEvent | undefined;
|
|
32
|
-
/** All canonical event names as a typed union. */
|
|
33
|
-
export type CanonicalEventName = (typeof CANONICAL_EVENTS)[number]['name'];
|
|
34
|
-
/** Set of all canonical event names for quick membership checks. */
|
|
35
|
-
export declare const CANONICAL_EVENT_NAMES: ReadonlySet<string>;
|
|
@@ -1,225 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Canonical Event Catalog — standardised event names and typed property
|
|
4
|
-
* schemas shared across all Gurulu SDKs (web, iOS, Android, server).
|
|
5
|
-
*
|
|
6
|
-
* Every SDK exposes typed convenience helpers that delegate to the generic
|
|
7
|
-
* `track()` method using the `$`-prefixed event names defined here. Users
|
|
8
|
-
* can still call `track('$purchase', { ... })` directly; the helpers are
|
|
9
|
-
* purely ergonomic.
|
|
10
|
-
*
|
|
11
|
-
* Property names are **snake_case** on all platforms.
|
|
12
|
-
*/
|
|
13
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
-
exports.CANONICAL_EVENT_NAMES = exports.CANONICAL_EVENTS = void 0;
|
|
15
|
-
exports.getCanonicalEvent = getCanonicalEvent;
|
|
16
|
-
// ── Helper to reduce boilerplate ────────────────────────────────────────────
|
|
17
|
-
function prop(name, type, description, required = false) {
|
|
18
|
-
return { name, type, required, description };
|
|
19
|
-
}
|
|
20
|
-
// ── Catalog ─────────────────────────────────────────────────────────────────
|
|
21
|
-
exports.CANONICAL_EVENTS = [
|
|
22
|
-
// ─── Core ───────────────────────────────────────────────────────────────
|
|
23
|
-
{
|
|
24
|
-
name: '$page_view',
|
|
25
|
-
displayName: 'Page View',
|
|
26
|
-
category: 'core',
|
|
27
|
-
description: 'Fired when a user views a page or screen.',
|
|
28
|
-
properties: [
|
|
29
|
-
prop('url', 'string', 'Full URL of the page', true),
|
|
30
|
-
prop('title', 'string', 'Document title'),
|
|
31
|
-
prop('referrer', 'string', 'Referring URL'),
|
|
32
|
-
],
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
name: '$session_start',
|
|
36
|
-
displayName: 'Session Start',
|
|
37
|
-
category: 'core',
|
|
38
|
-
description: 'Marks the beginning of a new session.',
|
|
39
|
-
properties: [],
|
|
40
|
-
},
|
|
41
|
-
{
|
|
42
|
-
name: '$session_end',
|
|
43
|
-
displayName: 'Session End',
|
|
44
|
-
category: 'core',
|
|
45
|
-
description: 'Marks the end of a session.',
|
|
46
|
-
properties: [
|
|
47
|
-
prop('duration_sec', 'number', 'Total session duration in seconds'),
|
|
48
|
-
],
|
|
49
|
-
},
|
|
50
|
-
// ─── Acquisition ────────────────────────────────────────────────────────
|
|
51
|
-
{
|
|
52
|
-
name: '$signup',
|
|
53
|
-
displayName: 'Sign Up',
|
|
54
|
-
category: 'acquisition',
|
|
55
|
-
description: 'User created a new account.',
|
|
56
|
-
properties: [
|
|
57
|
-
prop('method', 'string', 'Authentication method (email, google, apple, github)'),
|
|
58
|
-
],
|
|
59
|
-
},
|
|
60
|
-
{
|
|
61
|
-
name: '$app_install',
|
|
62
|
-
displayName: 'App Install',
|
|
63
|
-
category: 'acquisition',
|
|
64
|
-
description: 'Native app was installed on the device.',
|
|
65
|
-
properties: [
|
|
66
|
-
prop('install_source', 'string', 'Attribution source (e.g. play_store, app_store, ad_network)'),
|
|
67
|
-
prop('referrer_url', 'string', 'Install referrer URL'),
|
|
68
|
-
],
|
|
69
|
-
},
|
|
70
|
-
{
|
|
71
|
-
name: '$first_open',
|
|
72
|
-
displayName: 'First Open',
|
|
73
|
-
category: 'acquisition',
|
|
74
|
-
description: 'First time the app is opened after install.',
|
|
75
|
-
properties: [],
|
|
76
|
-
},
|
|
77
|
-
// ─── Activation ─────────────────────────────────────────────────────────
|
|
78
|
-
{
|
|
79
|
-
name: '$login',
|
|
80
|
-
displayName: 'Login',
|
|
81
|
-
category: 'activation',
|
|
82
|
-
description: 'User authenticated into an existing account.',
|
|
83
|
-
properties: [
|
|
84
|
-
prop('method', 'string', 'Authentication method (email, google, apple, github)'),
|
|
85
|
-
],
|
|
86
|
-
},
|
|
87
|
-
{
|
|
88
|
-
name: '$onboarding_complete',
|
|
89
|
-
displayName: 'Onboarding Complete',
|
|
90
|
-
category: 'activation',
|
|
91
|
-
description: 'User finished the onboarding flow.',
|
|
92
|
-
properties: [],
|
|
93
|
-
},
|
|
94
|
-
// ─── Revenue ────────────────────────────────────────────────────────────
|
|
95
|
-
{
|
|
96
|
-
name: '$purchase',
|
|
97
|
-
displayName: 'Purchase',
|
|
98
|
-
category: 'revenue',
|
|
99
|
-
description: 'A completed purchase or transaction.',
|
|
100
|
-
properties: [
|
|
101
|
-
prop('value', 'number', 'Monetary value of the transaction', true),
|
|
102
|
-
prop('currency', 'string', 'ISO 4217 currency code', true),
|
|
103
|
-
prop('transaction_id', 'string', 'Unique transaction identifier'),
|
|
104
|
-
prop('items', 'array', 'Array of purchased item objects'),
|
|
105
|
-
prop('payment_method', 'string', 'Payment method (credit_card, paypal, etc.)'),
|
|
106
|
-
],
|
|
107
|
-
},
|
|
108
|
-
{
|
|
109
|
-
name: '$add_to_cart',
|
|
110
|
-
displayName: 'Add to Cart',
|
|
111
|
-
category: 'revenue',
|
|
112
|
-
description: 'Item added to shopping cart.',
|
|
113
|
-
properties: [
|
|
114
|
-
prop('value', 'number', 'Monetary value of the item'),
|
|
115
|
-
prop('currency', 'string', 'ISO 4217 currency code'),
|
|
116
|
-
prop('item_id', 'string', 'Unique item identifier'),
|
|
117
|
-
prop('item_name', 'string', 'Human-readable item name'),
|
|
118
|
-
],
|
|
119
|
-
},
|
|
120
|
-
{
|
|
121
|
-
name: '$remove_from_cart',
|
|
122
|
-
displayName: 'Remove from Cart',
|
|
123
|
-
category: 'revenue',
|
|
124
|
-
description: 'Item removed from shopping cart.',
|
|
125
|
-
properties: [
|
|
126
|
-
prop('value', 'number', 'Monetary value of the item'),
|
|
127
|
-
prop('item_id', 'string', 'Unique item identifier'),
|
|
128
|
-
],
|
|
129
|
-
},
|
|
130
|
-
{
|
|
131
|
-
name: '$begin_checkout',
|
|
132
|
-
displayName: 'Begin Checkout',
|
|
133
|
-
category: 'revenue',
|
|
134
|
-
description: 'User started the checkout flow.',
|
|
135
|
-
properties: [
|
|
136
|
-
prop('value', 'number', 'Total cart value'),
|
|
137
|
-
prop('currency', 'string', 'ISO 4217 currency code'),
|
|
138
|
-
prop('item_count', 'number', 'Number of items in the cart'),
|
|
139
|
-
],
|
|
140
|
-
},
|
|
141
|
-
{
|
|
142
|
-
name: '$subscribe',
|
|
143
|
-
displayName: 'Subscribe',
|
|
144
|
-
category: 'revenue',
|
|
145
|
-
description: 'User started a recurring subscription.',
|
|
146
|
-
properties: [
|
|
147
|
-
prop('value', 'number', 'Subscription price', true),
|
|
148
|
-
prop('currency', 'string', 'ISO 4217 currency code', true),
|
|
149
|
-
prop('plan_id', 'string', 'Plan or tier identifier'),
|
|
150
|
-
prop('interval', 'string', 'Billing interval (monthly, yearly)'),
|
|
151
|
-
],
|
|
152
|
-
},
|
|
153
|
-
{
|
|
154
|
-
name: '$refund',
|
|
155
|
-
displayName: 'Refund',
|
|
156
|
-
category: 'revenue',
|
|
157
|
-
description: 'A refund was issued.',
|
|
158
|
-
properties: [
|
|
159
|
-
prop('value', 'number', 'Refund amount', true),
|
|
160
|
-
prop('currency', 'string', 'ISO 4217 currency code'),
|
|
161
|
-
prop('transaction_id', 'string', 'Original transaction identifier'),
|
|
162
|
-
],
|
|
163
|
-
},
|
|
164
|
-
// ─── Engagement ─────────────────────────────────────────────────────────
|
|
165
|
-
{
|
|
166
|
-
name: '$search',
|
|
167
|
-
displayName: 'Search',
|
|
168
|
-
category: 'engagement',
|
|
169
|
-
description: 'User performed a search.',
|
|
170
|
-
properties: [
|
|
171
|
-
prop('query', 'string', 'Search query string', true),
|
|
172
|
-
prop('results_count', 'number', 'Number of results returned'),
|
|
173
|
-
],
|
|
174
|
-
},
|
|
175
|
-
{
|
|
176
|
-
name: '$share',
|
|
177
|
-
displayName: 'Share',
|
|
178
|
-
category: 'engagement',
|
|
179
|
-
description: 'User shared content.',
|
|
180
|
-
properties: [
|
|
181
|
-
prop('method', 'string', 'Share method (copy_link, twitter, email, etc.)'),
|
|
182
|
-
prop('content_type', 'string', 'Type of content shared'),
|
|
183
|
-
prop('item_id', 'string', 'Identifier of the shared item'),
|
|
184
|
-
],
|
|
185
|
-
},
|
|
186
|
-
{
|
|
187
|
-
name: '$rate',
|
|
188
|
-
displayName: 'Rate',
|
|
189
|
-
category: 'engagement',
|
|
190
|
-
description: 'User rated an item or experience.',
|
|
191
|
-
properties: [
|
|
192
|
-
prop('value', 'number', 'Rating value', true),
|
|
193
|
-
prop('item_id', 'string', 'Identifier of the rated item'),
|
|
194
|
-
],
|
|
195
|
-
},
|
|
196
|
-
{
|
|
197
|
-
name: '$content_view',
|
|
198
|
-
displayName: 'Content View',
|
|
199
|
-
category: 'engagement',
|
|
200
|
-
description: 'User viewed a specific content item.',
|
|
201
|
-
properties: [
|
|
202
|
-
prop('content_type', 'string', 'Type of content (article, video, product, etc.)'),
|
|
203
|
-
prop('content_id', 'string', 'Unique content identifier'),
|
|
204
|
-
prop('content_name', 'string', 'Human-readable content name'),
|
|
205
|
-
],
|
|
206
|
-
},
|
|
207
|
-
// ─── Retention ──────────────────────────────────────────────────────────
|
|
208
|
-
{
|
|
209
|
-
name: '$app_open',
|
|
210
|
-
displayName: 'App Open',
|
|
211
|
-
category: 'retention',
|
|
212
|
-
description: 'App was opened (not first open).',
|
|
213
|
-
properties: [],
|
|
214
|
-
},
|
|
215
|
-
];
|
|
216
|
-
// ── Lookup helpers ──────────────────────────────────────────────────────────
|
|
217
|
-
const _byName = new Map();
|
|
218
|
-
for (const ev of exports.CANONICAL_EVENTS)
|
|
219
|
-
_byName.set(ev.name, ev);
|
|
220
|
-
/** Retrieve a canonical event definition by its `$`-prefixed name. */
|
|
221
|
-
function getCanonicalEvent(name) {
|
|
222
|
-
return _byName.get(name);
|
|
223
|
-
}
|
|
224
|
-
/** Set of all canonical event names for quick membership checks. */
|
|
225
|
-
exports.CANONICAL_EVENT_NAMES = new Set(exports.CANONICAL_EVENTS.map((e) => e.name));
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Canonical Event Envelope — Phase 10, W1.1
|
|
3
|
-
*
|
|
4
|
-
* Single source of truth for the event shape flowing through every ingest
|
|
5
|
-
* lane (web SDK, server SDK, future app SDK). Pure module: no DB, no logging,
|
|
6
|
-
* no side effects. Must run in Node (ingest routes) and be safe to bundle
|
|
7
|
-
* into esbuild for the browser SDK.
|
|
8
|
-
*
|
|
9
|
-
* Related docs: PHASE-10-ROADMAP.md §W1.1
|
|
10
|
-
*/
|
|
11
|
-
export type EventTier = 'raw' | 'inferred' | 'verified';
|
|
12
|
-
export type EventSource = 'client_sdk' | 'server_sdk' | 'system_inferred' | 'user_confirmed';
|
|
13
|
-
export type ConsentLevel = 'pending' | 'accepted' | 'rejected';
|
|
14
|
-
/**
|
|
15
|
-
* Granular consent level for the pseudonymized identity graph.
|
|
16
|
-
* - none: anonymous aggregate analytics only, no identity processing
|
|
17
|
-
* - analytics: session/pageview/events allowed, anonymous_id claim only
|
|
18
|
-
* - marketing: marketing identifiers allowed (email, phone for campaigns)
|
|
19
|
-
* - full: all processing including profiling, cross-device, recommendations
|
|
20
|
-
*/
|
|
21
|
-
export type GranularConsentLevel = 'none' | 'analytics' | 'marketing' | 'full';
|
|
22
|
-
export interface Envelope {
|
|
23
|
-
event_id: string;
|
|
24
|
-
timestamp: string;
|
|
25
|
-
site_id: string;
|
|
26
|
-
anonymous_id: string;
|
|
27
|
-
canonical_id?: string;
|
|
28
|
-
session_id: string;
|
|
29
|
-
event_type: string;
|
|
30
|
-
event_name: string;
|
|
31
|
-
event_tier: EventTier;
|
|
32
|
-
event_source: EventSource;
|
|
33
|
-
correlation_id?: string;
|
|
34
|
-
parent_event_id?: string;
|
|
35
|
-
consent_level: ConsentLevel;
|
|
36
|
-
granular_consent_level?: GranularConsentLevel;
|
|
37
|
-
sdk_version: string;
|
|
38
|
-
config_version?: string;
|
|
39
|
-
page_url: string;
|
|
40
|
-
page_title?: string;
|
|
41
|
-
referrer?: string;
|
|
42
|
-
utm_source?: string;
|
|
43
|
-
utm_medium?: string;
|
|
44
|
-
utm_campaign?: string;
|
|
45
|
-
utm_term?: string;
|
|
46
|
-
utm_content?: string;
|
|
47
|
-
device_type?: string;
|
|
48
|
-
browser?: string;
|
|
49
|
-
os?: string;
|
|
50
|
-
screen_width?: number;
|
|
51
|
-
screen_height?: number;
|
|
52
|
-
device_id?: string;
|
|
53
|
-
phone?: string;
|
|
54
|
-
event_source_platform?: 'web' | 'ios' | 'android' | 'react_native' | 'flutter' | 'server';
|
|
55
|
-
properties: Record<string, unknown>;
|
|
56
|
-
}
|
|
57
|
-
export type ParseSuccess = {
|
|
58
|
-
ok: true;
|
|
59
|
-
value: Envelope;
|
|
60
|
-
};
|
|
61
|
-
export type ParseError = {
|
|
62
|
-
ok: false;
|
|
63
|
-
errors: string[];
|
|
64
|
-
};
|
|
65
|
-
export type ParseResult = ParseSuccess | ParseError;
|
|
66
|
-
/**
|
|
67
|
-
* Strict parser. Accepts only already-canonical envelopes. Used on internal
|
|
68
|
-
* pipeline boundaries where we know producers emit the full shape.
|
|
69
|
-
*
|
|
70
|
-
* Throws-in-return-value: never throws, returns ParseError on failure.
|
|
71
|
-
*/
|
|
72
|
-
export declare function parseEnvelope(raw: unknown): ParseResult;
|
|
73
|
-
/**
|
|
74
|
-
* Accepts the loose JSON shape that the current `sdk/tracker.ts` sends and
|
|
75
|
-
* promotes it to a canonical Envelope, filling defaults for fields the legacy
|
|
76
|
-
* shape doesn't know about. Use this on ingest boundaries during the
|
|
77
|
-
* migration window (Phase 10 Wave 1 → Wave 3).
|
|
78
|
-
*/
|
|
79
|
-
export declare function normalizeLegacy(raw: unknown): ParseResult;
|
|
80
|
-
export interface CreateEnvelopeInput extends Partial<Envelope> {
|
|
81
|
-
site_id: string;
|
|
82
|
-
event_name: string;
|
|
83
|
-
anonymous_id: string;
|
|
84
|
-
session_id: string;
|
|
85
|
-
}
|
|
86
|
-
/**
|
|
87
|
-
* Server-side helper for constructing envelopes from partial input. Fills
|
|
88
|
-
* event_id, timestamp, and all enum defaults. Not used on the client SDK hot
|
|
89
|
-
* path.
|
|
90
|
-
*/
|
|
91
|
-
export declare function createEnvelope(partial: CreateEnvelopeInput): Envelope;
|