InvalidCredentialsError

View as MarkdownOpen in Claude

Raised when the auth backend rejects the credentials returned by the configured CredentialProvider — for example, an expired SAT, a revoked embed token, or a payload that fails schema validation. The reason property carries the server-reported cause when available.

Extends

  • Error

Constructors

Constructor

1new InvalidCredentialsError(reason?, options?): InvalidCredentialsError

Parameters

reason
string

Reason the auth backend rejected the credentials.

options
ErrorOptions

Standard ErrorOptions (e.g. cause).

Properties

reason
stringRequired

Reason the auth backend rejected the credentials.

Examples

1import { InvalidCredentialsError } from '@signalwire/js';
2
3try {
4 await client.connect();
5} catch (err) {
6 if (err instanceof InvalidCredentialsError) {
7 console.error('auth rejected:', err.reason);
8 await refreshCredentialProvider();
9 }
10}