Function: initiateDeviceAuthorization()

May 28, 2025 ยท View on GitHub

๐Ÿ’— Help the project

Support from the community to continue maintaining and improving this module is welcome. If you find the module useful, please consider supporting the project by becoming a sponsor.


โ–ธ initiateDeviceAuthorization(config, parameters): Promise<DeviceAuthorizationResponse>

Initiates a Device Authorization Grant using parameters from the parameters argument.

Parameters

ParameterTypeDescription
configConfiguration-
parametersRecord<string, string> | URLSearchParamsAuthorization request parameters that will be sent to the device authorization endpoint

Returns

Promise<DeviceAuthorizationResponse>

Example

let config!: client.Configuration
let scope!: string

let deviceAuthorizationResponse =
  await client.initiateDeviceAuthorization(config, { scope })

let { user_code, verification_uri, verification_uri_complete } =
  deviceAuthorizationResponse

console.log({ user_code, verification_uri, verification_uri_complete })