> Fetch clean Markdown by appending `.md` to any page URL under https://signalwire.com/docs or requesting it with the HTTP header `Accept: text/markdown`. The root index at https://signalwire.com/docs/llms.txt lists the available documentation indexes. # getBasicAuthCredentials > Retrieve the HTTP Basic Auth credentials for the service. [ref-swmlservice]: /docs/server-sdks/reference/typescript/agents/swml-service Retrieve the current HTTP Basic Auth credentials used by this service. Every [`SWMLService`][ref-swmlservice] instance has auth credentials -- either explicitly provided in the constructor, read from environment variables, or generated at startup. ## **Parameters** **`includeSource`** `boolean` — default: false When `true`, returns a 3-tuple that includes the credential source as the third element. The source is one of: * `"provided"` -- credentials were passed through constructor options * `"environment"` -- credentials came from `SWML_BASIC_AUTH_USER` and `SWML_BASIC_AUTH_PASSWORD` environment variables * `"generated"` -- credentials were randomly generated at startup --- ## **Returns** `[string, string]` -- A `[username, password]` tuple when `includeSource` is `false` or omitted. `[string, string, 'provided' | 'environment' | 'generated']` -- A `[username, password, source]` tuple when `includeSource` is `true`. ## **Example** ```typescript {6,10} import { SWMLService } from '@signalwire/sdk'; const service = new SWMLService({ name: 'my-service' }); // Get credentials const [username, password] = service.getBasicAuthCredentials(); console.log(`Auth: ${username}:${password}`); // Get credentials with source information const [user, pass, source] = service.getBasicAuthCredentials(true); console.log(`Auth source: ${source}`); // "provided", "environment", or "generated" ``` > Retrieve the HTTP Basic Auth credentials for the service.