createSession

View as MarkdownOpen in Claude

Return the given callId if provided, or generate a new random session identifier using base64url-encoded random bytes.

Parameters

callId
string

Existing call ID to reuse. If omitted, a new random ID is generated.

Returns

string — The call ID string.

Example

1import { SessionManager } from '@signalwire/sdk';
2
3const sm = new SessionManager();
4const id1 = sm.createSession('call-abc123'); // "call-abc123"
5const id2 = sm.createSession(); // random base64url ID