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
GuidesReference
GuidesReference
    • Core
      • Overview
    • Agents
      • Overview
      • AgentBase
      • AgentServer
      • Configuration
        • AuthHandler
          • expressMiddleware
          • getAuthInfo
          • hasApiKeyAuth
          • hasBasicAuth
          • hasBearerAuth
          • middleware
          • validate
          • verifyApiKey
          • verifyBasicAuth
          • verifyBearerToken
        • ConfigLoader
        • Environment Variables
        • Logging
        • PromptManager
        • SchemaUtils
        • ServerlessAdapter
        • SessionManager
        • SslConfig
      • ContextBuilder
      • DataMap
      • FunctionResult
      • Helper Functions & Utilities
      • LiveWire
      • PomBuilder
      • Prefabs
      • SkillBase
      • SkillManager
      • SkillRegistry
      • Skills
      • SwaigFunction
      • SwmlBuilder
      • SWMLService
    • RELAY
      • Overview
      • Actions
      • Call
      • Constants
      • Events
      • Message
      • RelayClient
      • RelayError
    • REST Client
      • Overview
      • Addresses
      • Calling
      • ChatResource
      • Compat
      • Datasphere
      • Fabric
      • ImportedNumbersResource
      • Logs
      • LookupResource
      • MFA
      • Number Groups
      • Phone Numbers
      • Project
      • PubSubResource
      • Queues
      • Recordings
      • Registry
      • RestClient
      • RestError
      • Short Codes
      • SIP Profile
      • Verified Callers
      • Video
LogoLogoSignalWire Docs
Log inSign up
Support
On this page
  • Returns
  • Example
AgentsConfigurationAuthHandler

getAuthInfo

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

hasApiKeyAuth

Next
Built with

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:

basic
{ enabled: true; username: string } | undefined

Present when Basic Auth is configured. Contains the configured username (the password is never returned).

bearer
{ enabled: true; hint: string } | undefined

Present when Bearer token auth is configured. hint is a human-readable string like "Use Authorization: Bearer <token>".

apiKey
{ enabled: true; header: string; hint: string } | undefined

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.

Example

1import { AuthHandler } from '@signalwire/sdk';
2
3const auth = new AuthHandler({
4 basicAuth: ['admin', 'secret'],
5 bearerToken: 'sk_live_abc123',
6});
7
8const info = auth.getAuthInfo();
9console.log(info);
10// {
11// basic: { enabled: true, username: 'admin' },
12// bearer: { enabled: true, hint: 'Use Authorization: Bearer <token>' }
13// }
14
15if (info.apiKey) {
16 console.log(`API key expected in header ${info.apiKey.header}`);
17}