For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Log inSign up
Support
GuidesReferenceClick-to-Call
GuidesReferenceClick-to-Call
  • Core
    • Overview
  • Entities
    • SignalWire
    • Address
    • Participant
    • ClientPreferences
    • SelfCapabilities
    • SelfParticipant
    • User
    • WebRTCCall
      • EmbedTokenCredentialProvider
        • authenticate
        • refresh
      • StaticCredentialProvider
  • Web Components
    • Overview
    • sw-audio-level
    • sw-call-controls
    • sw-call-dialpad
    • sw-call-media
    • sw-call-provider
    • sw-call-status
    • sw-call-widget
    • sw-click-to-call
    • sw-device-selector
    • sw-directory
    • sw-local-camera
    • sw-participant-controls
    • sw-participants
    • sw-self-media
    • sw-ui-alert
    • sw-ui-background
    • sw-ui-call-layout
    • sw-ui-content-drawer
    • sw-ui-control-bar
    • sw-ui-dialpad
    • sw-ui-dropup
    • sw-ui-icon
    • sw-ui-modal
    • sw-ui-responsive-container
    • sw-ui-split-button
    • sw-ui-transcript-view
LogoLogoSignalWire Docs
Log inSign up
Support
On this page
  • Returns
  • Examples
EntitiesCredentialProvidersEmbedTokenCredentialProvider

authenticate

|View as Markdown|Open in Claude|
Was this page helpful?
Edit this page
Previous

refresh

Next
Built with
1authenticate(): Promise<{ expiry_at: number; token: string; }>

Obtains the initial credentials. Called once during client initialization.

Implementor responsibilities:

  • Resolve with a valid SDKCredential on success.
  • Reject (throw) on failure — this will cause client initialization to fail.
  • When context.fingerprint is provided, forward it to the server-side token endpoint with scope: "sat:refresh" to enable automatic token refresh.

SDK behavior:

  • Awaits this method before establishing the WebSocket connection.
  • On rejection, propagates the error to the caller of SignalWire().

Returns

Promise<{ expiry_at: number; token: string; }>

Examples

1import { EmbedTokenCredentialProvider } from '@signalwire/js';
2
3const provider = new EmbedTokenCredentialProvider({
4 token: 'YOUR_EMBED_TOKEN',
5 host: 'your-space.signalwire.com',
6});
7
8// Called by the SDK during `new SignalWire(provider)` — typically not
9// invoked directly by application code.
10const credential = await provider.authenticate({ /* AuthenticateContext */ });