Quick start
AStack’s live renderer is available by invitation. Use the API endpoint and two SDK tarballs from your invitation.
Get your API key
Use the scoped API key from your invitation. Keep the key and private API endpoint on your backend. Before your integration slot, give the pilot organizer your app’s HTTPS origin, including any non-default port. Open the app at that same origin for the call.
Install the SDKs
Use Node.js 22 or later on the backend. Copy both tarballs into your app directory and install them together.
npm install ./aether-stack-dev-client-sdk-1.4.1-pilot.1631.1.tgz ./aether-stack-dev-developer-sdk-0.5.1-pilot.1631.1.tgz
Create a session (server)
Use authenticated POST and DELETE handlers. Reuse one attempt ID through Start retries and record the session ID against the signed-in user. Resolve that ID on the backend when Stop is requested.
import { AStackSDK } from '@aether-stack-dev/developer-sdk';const sdk = new AStackSDK({apiKey: process.env.ASTACK_API_KEY!,apiEndpoint: process.env.ASTACK_API_ENDPOINT!,});export async function startSession(userId: string, attemptId: string) {const { session, token, credentials } = await sdk.createSession(userId, {ttl: 300,quality: 'premium',idempotencyKey: attemptId,});return {sessionId: session.id,sessionToken: token,gatewayUrl: credentials.gatewayUrl,gatewayTransport: credentials.gatewayTransport,gatewayWsUrl: credentials.gatewayWsUrl,rendererPlayerUrl: credentials.rendererPlayerUrl,expiresAt: credentials.expiresAt,};}export async function stopSession(ownedSessionId: string) {await sdk.terminateSession(ownedSessionId);}
Connect from the client
Pass the session returned by your backend to the browser SDK. Start from a button click and use an iframe with an accessible title and allow="autoplay". Use the same backend release handler after a failed Start and when the user selects Stop.
import { AStackCSRClient, type AStackGatewaySession } from '@aether-stack-dev/client-sdk';export async function startAvatar(session: AStackGatewaySession,player: HTMLIFrameElement,releaseSession: () => Promise<void>,onCallStarted: () => void,) {let client: AStackCSRClient | undefined;try {client = new AStackCSRClient({ session, enableImageCapture: false, autoReconnect: false });const playerUrl = client.getRendererPlayerUrl();if (!playerUrl) throw new Error('Avatar player is unavailable');client.on('callStarted', onCallStarted);await client.connect();player.src = playerUrl;await client.startCall();return client;} catch (error) {try {await stopAvatar(client, player, releaseSession);} catch (cleanupError) {throw new AggregateError([error, cleanupError], 'Start and release failed');}throw error;}}export async function stopAvatar(client: AStackCSRClient | undefined,player: HTMLIFrameElement,releaseSession: () => Promise<void>,) {try {await client?.disconnect();} finally {player.removeAttribute('src');await releaseSession();}}
React integration
Use the React hook to track call state. Call your backend’s release handler after Stop.