Capture, identify & alias
Server-side capture(), identify(), alias() — same shapes as the browser, with explicit ids on every call.
Same API as the browser: capture(), identify(), alias(). Pass distinctId (and optional anonymousId) per call or via setContext().
#Capture
Send custom events. Include anonymousId when linking to browser sessions — for example, when a server-side webhook needs to attach to a still-anonymous browser visitor.
vtilt.capture({
distinctId: 'user_123',
event: 'purchase',
properties: { amount: 99.99 },
anonymousId: 'anon_from_browser', // optional, for linking
})#Identify
Attach properties to a person record. Pass anonymousId to link an anonymous browser session to its newly-authenticated identity (e.g. immediately after login). The merge behaviour is the same as the browser identify() — see Browser SDK / Identify & alias for the full model.
vtilt.identify({
distinctId: 'user_123',
anonymousId: 'anon_from_cookie', // optional, for merge
properties: { name: 'Alice', plan: 'pro' },
})#Alias
Link two distinct ids — for example, joining a legacy auth id with a new SSO id, or stitching two known accounts together.
vtilt.alias({
distinctId: 'user_123',
alias: 'legacy_id_456',
})