> For a complete index of all SignalWire documentation pages, fetch https://signalwire.com/docs/llms.txt

# InvalidCredentialsError

> Thrown when the SDK is rejected by the auth backend.

Raised when the auth backend rejects the credentials returned by the configured [`CredentialProvider`](/docs/browser-sdk/v4/reference/interfaces/credential-provider) — 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

```ts
new InvalidCredentialsError(reason?, options?): InvalidCredentialsError
```

### Parameters

Reason the auth backend rejected the credentials.

Standard `ErrorOptions` (e.g. `cause`).

## **Properties**

Reason the auth backend rejected the credentials.

## **Examples**

```ts
import { InvalidCredentialsError } from '@signalwire/js';

try {
  await client.connect();
} catch (err) {
  if (err instanceof InvalidCredentialsError) {
    console.error('auth rejected:', err.reason);
    await refreshCredentialProvider();
  }
}
```