Back to Node Auth0

Function withHeaders

docs/functions/management.withHeaders.html

5.9.1835 B
Original Source

Function withHeaders

withHeaders(headers: Record<string, string>): Partial<RequestOptions>

Configure requests with custom headers. Can be used directly in object literals with spread syntax.

Parameters

  • headers: Record<string, string>

Object containing header key-value pairs

Returns Partial<RequestOptions>

Partial request options with the specified headers

Example

const reqOptions = { ...withHeaders({ 'X-Request-ID': 'unique-id-123', 'X-Custom-Header': 'custom-value' }), timeoutInSeconds: 30};await client.actions.list({}, reqOptions);Copy

Settings

Member Visibility

  • Protected
  • Inherited

ThemeOSLightDark