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

# getAuthInfo

> Get structured metadata describing the enabled authentication methods.

Return structured metadata describing each enabled authentication method on
this handler. Useful for generating diagnostic pages, startup banners, or
developer-facing hints about which auth schemes are active. Missing entries
indicate the corresponding method is not configured.

## **Returns**

An object with three optional keys:

<ParamField path="basic" type="{ enabled: true; username: string } | undefined" toc={true}>
  Present when Basic Auth is configured. Contains the configured username (the
  password is never returned).
</ParamField>

<ParamField path="bearer" type="{ enabled: true; hint: string } | undefined" toc={true}>
  Present when Bearer token auth is configured. `hint` is a human-readable
  string like `"Use Authorization: Bearer <token>"`.
</ParamField>

<ParamField path="apiKey" type="{ enabled: true; header: string; hint: string } | undefined" toc={true}>
  Present when API key auth is configured. `header` is the configured header
  name (defaults to `"X-Api-Key"`). `hint` is a human-readable usage string.
</ParamField>

## **Example**

```typescript {9}
import { AuthHandler } from '@signalwire/sdk';

const auth = new AuthHandler({
  basicAuth: ['admin', 'secret'],
  bearerToken: 'sk_live_abc123',
});

const info = auth.getAuthInfo();
console.log(info);
// {
//   basic: { enabled: true, username: 'admin' },
//   bearer: { enabled: true, hint: 'Use Authorization: Bearer <token>' }
// }

if (info.apiKey) {
  console.log(`API key expected in header ${info.apiKey.header}`);
}
```