Node.js / TypeScript
Install
npm install @selfxyz/enterprise-sdkpnpm add @selfxyz/enterprise-sdkyarn add @selfxyz/enterprise-sdkInitialize
import { SelfClient } from '@selfxyz/enterprise-sdk';
const self = new SelfClient({
apiKey: process.env.SELF_API_KEY!, // sk_test_... or sk_live_...
});Sessions
Create
const session = await self.sessions.create({
flowId: '9c0b4f1c-1d6c-4f1b-a8c4-9f0fa0a8d9e2',
externalUuid: 'a1b2c3d4-5678-4e9a-b012-3456789abcde', // a UUID, your stable id for the user
// optional:
expiresInSeconds: 3600,
metadata: { campaign: 'winter-2026' },
successUrl: 'https://app.example.com/verified',
failureUrl: 'https://app.example.com/failed',
});
session.verificationUrl; // give to the user
session.id; // store on your side
session.expiresAt; // ISO-8601Field
Notes
Get
Types
Webhook verification
Error handling
Last updated