[**Documentation**](index.md) *** [Documentation](packages.md) / Vonage Auth # Vonage Auth SDK for Node.js ![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/vonage/vonage-node-sdk/ci.yml?branch=3.x) [![Codecov](https://img.shields.io/codecov/c/github/vonage/vonage-node-sdk?label=Codecov&logo=codecov&style=flat-square)](https://codecov.io/gh/Vonage/vonage-server-sdk) ![Latest Release](https://img.shields.io/npm/v/@vonage/auth?label=%40vonage%2Fauth&style=flat-square) [![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-v2.0%20adopted-ff69b4.svg?style=flat-square)](../../CODE_OF_CONDUCT.md) [![License](https://img.shields.io/npm/l/@vonage/accounts?label=License&style=flat-square)][license] Vonage This is the Vonage Auth SDK for Node.js for creating authentication headers and signature for use with [Vonage APIs](https://www.vonage.com/). To use it you will need a Vonage account. Sign up [for free at vonage.com][signup]. We recommend using this package as part of the overall [`@vonage/server-sdk` package](https://github.com/vonage/vonage-node-sdk). For full API documentation refer to [developer.vonage.com](https://developer.nexmo.com/). * [Installation](#installation) * [Usage](#usage) * [Options](#options) * [Testing](#testing) ## Installation We recommend using this SDK as part of the overall [`@vonage/server-sdk` package](https://github.com/vonage/vonage-node-sdk). Please see the main package for installation. You can also use this SDK standalone if you only need access to just the Auth SDK. ### With NPM ```bash npm install @vonage/auth ``` ### With Yarn ```bash yarn add @vonage/auth ``` ## Usage ### As part of the Vonage Server SDK If you are using this SDK as part of the Vonage Server SDK, you can access it as the `auth` property off of the client that you instantiate. The SDK can be used standalone from the main [Vonage Server SDK for Node.js](https://github.com/vonage/vonage-node-sdk) if you only need to use the Auth API. All you need to do is `require('@vonage/auth')`, and use the returned object to create your own client. ```js const { Auth } = require('@vonage/server-sdk'); // Or if standalone const { Auth } = require('@vonage/auth'); const vonageAuth = new Auth({ apiKey: API_KEY, apiSecret: API_SECRET, applicationId: APP_ID, privateKey: PRIVATE_KEY_PATH, }); (async () => { const basicHeader = vonageAuth.createBasicHeader(); console.log(basicHeader); })() ``` ### Options Options is an object with the following properties: * `apiKey` - API Key from Vonage API. If `applicationId` and `privateKey` are present, `apiKey` is optional. * `apiSecret` - API Secret from Vonage API. If `applicationId` and `privateKey` are present, `apiSecret` is optional. * `applicationId` - (optional) The Vonage API Application ID to be used when creating JWTs. * `privateKey` - (optional) The Private Key to be used when creating JWTs. You can specify the key as any of the following: * A [Buffer](https://nodejs.org/api/buffer.html#buffer_class_method_buffer_from_string_encoding) containing the file contents. * A String containing the path to the key file on disk. * A String containing the key itself. ## Testing Run: ```bash npm run test ``` [signup]: https://dashboard.nexmo.com/sign-up?utm_source=DEV_REL&utm_medium=github&utm_campaign=node-server-sdk [license]: _media/LICENSE.txt ## Enumerations ### AlgorithmTypes Defined in: [packages/auth/lib/enums/AlgroithmTypes.ts:8](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/auth/lib/enums/AlgroithmTypes.ts#L8) Enumeration of supported algorithm types for HMAC hashing. #### Remarks Ensure to select an algorithm that adheres to your security requirements and is supported by the API endpoint you're interacting with. #### Enumeration Members | Enumeration Member | Value | Description | Defined in | | ------ | ------ | ------ | ------ | | `md5hash` | `"MD5HASH"` | Represents the MD5 hash algorithm | [packages/auth/lib/enums/AlgroithmTypes.ts:10](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/auth/lib/enums/AlgroithmTypes.ts#L10) | | `md5hmac` | `"MD5HMAC"` | Represents the HMAC-MD5 hash algorithm, which uses a secret key for hashing. | [packages/auth/lib/enums/AlgroithmTypes.ts:13](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/auth/lib/enums/AlgroithmTypes.ts#L13) | | `sha1hmac` | `"SHA1HMAC"` | Represents the HMAC-SHA1 hash algorithm, which uses a secret key for hashing. | [packages/auth/lib/enums/AlgroithmTypes.ts:16](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/auth/lib/enums/AlgroithmTypes.ts#L16) | | `sha256hmac` | `"SHA256HMAC"` | Represents the HMAC-SHA256 hash algorithm, which uses a secret key for hashing. | [packages/auth/lib/enums/AlgroithmTypes.ts:19](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/auth/lib/enums/AlgroithmTypes.ts#L19) | | `sha512hmac` | `"SHA512HMAC"` | Represents the HMAC-SHA512 hash algorithm, which uses a secret key for hashing. | [packages/auth/lib/enums/AlgroithmTypes.ts:22](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/auth/lib/enums/AlgroithmTypes.ts#L22) | ## Classes ### Auth Defined in: [packages/auth/lib/auth.ts:45](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/auth/lib/auth.ts#L45) Authentication class used for generating Authentication headers and query parameters. #### Remarks This client is only available as a standalone client. It cannot be instantiated from the server-sdk package. #### Example Create a standard authentication object. ```ts import { Auth } from '@vonage/auth'; const auth = new Auth({ apiKey: VONAGE_API_KEY, apiSecret: VONAGE_API_SECRET, applicationId: VONAGE_APPLICATION_ID, privateKey: VONAGE_APPLICATION_PRIVATE_KEY_PATH, }); ``` #### Implements - [`AuthInterface`](#authinterface) #### Constructors ##### Constructor ```ts new Auth(opts?): Auth; ``` Defined in: [packages/auth/lib/auth.ts:79](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/auth/lib/auth.ts#L79) ###### Parameters ###### opts? [`AuthParams`](#authparams) ###### Returns [`Auth`](#auth) #### Properties ##### apiKey ```ts apiKey: string; ``` Defined in: [packages/auth/lib/auth.ts:49](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/auth/lib/auth.ts#L49) The API key used to authenticate requests. It may be omitted if using JWT or signature authentication. This value can be found in your Vonage Developer Dashboard. ###### Implementation of [`AuthInterface`](#authinterface).[`apiKey`](#apikey-1) ##### apiSecret ```ts apiSecret: string; ``` Defined in: [packages/auth/lib/auth.ts:54](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/auth/lib/auth.ts#L54) The API secret used to authenticate requests. It may be omitted if using JWT or signature authentication. This value can be found in your Vonage Developer Dashboard. ###### Implementation of [`AuthInterface`](#authinterface).[`apiSecret`](#apisecret-1) ##### applicationId? ```ts optional applicationId: null | string; ``` Defined in: [packages/auth/lib/auth.ts:66](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/auth/lib/auth.ts#L66) The application ID used in conjunction with the private key for JWT authentication. It may be omitted if using API key/secret or signature authentication. This value can be found in your Vonage Developer Dashboard. ###### Implementation of [`AuthInterface`](#authinterface).[`applicationId`](#applicationid-1) ##### jwtOptions ```ts jwtOptions: GeneratorOptions; ``` Defined in: [packages/auth/lib/auth.ts:77](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/auth/lib/auth.ts#L77) Options for generating JWTs, including the JWT issuer (application ID) and subject (user ID). ###### Implementation of [`AuthInterface`](#authinterface).[`jwtOptions`](#jwtoptions-1) ##### privateKey? ```ts optional privateKey: null | string; ``` Defined in: [packages/auth/lib/auth.ts:60](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/auth/lib/auth.ts#L60) The private key used for JWT authentication. It can be provided as a string (read from a file) or as a Buffer (opened directly from a file). This key is downloaded when you create an application in your Vonage Developer Dashboard and may be omitted if using API key/secret or signature authentication. ###### Implementation of [`AuthInterface`](#authinterface).[`privateKey`](#privatekey-1) ##### signature? ```ts optional signature: null | SignedHashParams; ``` Defined in: [packages/auth/lib/auth.ts:72](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/auth/lib/auth.ts#L72) An object containing parameters for signature authentication, including the secret and algorithm. It may be omitted if using API key/secret or JWT authentication. ###### Implementation of [`AuthInterface`](#authinterface).[`signature`](#signature-1) #### Methods ##### createBasicHeader() ```ts createBasicHeader(): Promise; ``` Defined in: [packages/auth/lib/auth.ts:174](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/auth/lib/auth.ts#L174) Generates a basic authentication header. ###### Returns `Promise`\<`string`\> - A promise that resolves with the generated basic authentication header. ###### Throws - Thrown when the API key is missing. ###### Throws - Thrown when the API secret is missing. ###### Throws - Thrown when the API key is not a valid string. ###### Throws - Thrown when the API secret is not a valid string. ###### Example Generate a basic authentication headers ```ts const basicAuthHeader = await auth.createBasicHeader(); ``` ###### Implementation of [`AuthInterface`](#authinterface).[`createBasicHeader`](#createbasicheader-2) ##### createBearerHeader() ```ts createBearerHeader(): Promise; ``` Defined in: [packages/auth/lib/auth.ts:209](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/auth/lib/auth.ts#L209) Generates a bearer authentication header. ###### Returns `Promise`\<`string`\> - A promise that resolves with the generated bearer authentication header. ###### Example Generate a bearer authentication headers ```ts const bearerAuthHeader = await auth.createBearerHeader(); ``` ###### Implementation of [`AuthInterface`](#authinterface).[`createBearerHeader`](#createbearerheader-2) ##### createSignatureHash() ```ts createSignatureHash(params): Promise; ``` Defined in: [packages/auth/lib/auth.ts:248](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/auth/lib/auth.ts#L248) Generates a signature hash for authentication, merging it with provided parameters. ###### Type Parameters ###### T `T` Type of the parameters to merge with. ###### Parameters ###### params [`AuthSignedParams`](#authsignedparams) & `T` Parameters to merge with the generated signature hash. ###### Returns `Promise`\<[`AuthSignedParams`](#authsignedparams) & `T`\> - A promise that resolves with the merged signature hash and parameters. ###### Throws - Thrown when the API key is missing. ###### Throws - Thrown when the API key is not a valid string. ###### Throws - Thrown when the signature algorithm is missing. ###### Throws - Thrown when the API secret is missing. ###### Throws - Thrown when the API secret is not a valid string. ###### Throws - Thrown when an invalid signature algorithm is provided. ###### Example Generate a signature hash ```ts const signatureHash = await auth.createSignatureHash({ to: '15555555555', from: '15555555556', text: 'Hello from Vonage SMS API', timestamp: '1516878400', sig: 'a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6', }); ``` ###### Implementation of [`AuthInterface`](#authinterface).[`createSignatureHash`](#createsignaturehash-2) ##### getQueryParams() ```ts getQueryParams(params?): Promise; ``` Defined in: [packages/auth/lib/auth.ts:130](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/auth/lib/auth.ts#L130) Generates query parameters for authentication, optionally merging with provided parameters. ###### Type Parameters ###### T `T` ###### Parameters ###### params? [`AuthQueryParams`](#authqueryparams) & `T` Additional parameters to merge with the generated authentication query parameters. ###### Returns `Promise`\<[`AuthQueryParams`](#authqueryparams) & `T`\> - A promise that resolves with the merged authentication query parameters. ###### Throws - Thrown when the API key is missing. ###### Throws - Thrown when the API secret is missing. ###### Throws - Thrown when the API key is not a valid string. ###### Throws - Thrown when the API secret is not a valid string. ###### Examples Generate query parameters ```ts const queryParams = await auth.getQueryParams(); ``` Generate query parameters and merge with additional Parameters ```ts const queryParams = await auth.getQueryParams({ to: '15555555555', from: '15555555556', text: 'Hello from Vonage SMS API' }); ``` ###### Implementation of [`AuthInterface`](#authinterface).[`getQueryParams`](#getqueryparams-2) *** ### InvalidApiKeyError Defined in: [packages/auth/lib/errors/InvalidApiKeyError.ts:10](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/auth/lib/errors/InvalidApiKeyError.ts#L10) Error class representing a specific error scenario where an API key is provided but is not a valid string. This error is thrown when an API request is made with an API key that does not meet the expected format or type (string). #### Extends - `Error` #### Constructors ##### Constructor ```ts new InvalidApiKeyError(): InvalidApiKeyError; ``` Defined in: [packages/auth/lib/errors/InvalidApiKeyError.ts:11](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/auth/lib/errors/InvalidApiKeyError.ts#L11) ###### Returns [`InvalidApiKeyError`](#invalidapikeyerror) ###### Overrides ```ts Error.constructor ``` #### Properties ##### cause? ```ts optional cause: unknown; ``` Defined in: node\_modules/typescript/lib/lib.es2022.error.d.ts:24 ###### Inherited from ```ts Error.cause ``` ##### message ```ts message: string; ``` Defined in: node\_modules/typescript/lib/lib.es5.d.ts:1077 ###### Inherited from ```ts Error.message ``` ##### name ```ts name: string; ``` Defined in: node\_modules/typescript/lib/lib.es5.d.ts:1076 ###### Inherited from ```ts Error.name ``` ##### stack? ```ts optional stack: string; ``` Defined in: node\_modules/typescript/lib/lib.es5.d.ts:1078 ###### Inherited from ```ts Error.stack ``` ##### stackTraceLimit ```ts static stackTraceLimit: number; ``` Defined in: packages/auth/node\_modules/@types/node/globals.d.ts:149 The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. ###### Inherited from ```ts Error.stackTraceLimit ``` #### Methods ##### captureStackTrace() ```ts static captureStackTrace(targetObject, constructorOpt?): void; ``` Defined in: packages/auth/node\_modules/@types/node/globals.d.ts:133 Creates a `.stack` property on `targetObject`, which when accessed returns a string representing the location in the code at which `Error.captureStackTrace()` was called. ```js const myObject = {}; Error.captureStackTrace(myObject); myObject.stack; // Similar to `new Error().stack` ``` The first line of the trace will be prefixed with `${myObject.name}: ${myObject.message}`. The optional `constructorOpt` argument accepts a function. If given, all frames above `constructorOpt`, including `constructorOpt`, will be omitted from the generated stack trace. The `constructorOpt` argument is useful for hiding implementation details of error generation from the user. For instance: ```js function a() { b(); } function b() { c(); } function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error; } a(); ``` ###### Parameters ###### targetObject `object` ###### constructorOpt? `Function` ###### Returns `void` ###### Inherited from ```ts Error.captureStackTrace ``` ##### prepareStackTrace() ```ts static prepareStackTrace(err, stackTraces): any; ``` Defined in: packages/auth/node\_modules/@types/node/globals.d.ts:137 ###### Parameters ###### err `Error` ###### stackTraces `CallSite`[] ###### Returns `any` ###### See https://v8.dev/docs/stack-trace-api#customizing-stack-traces ###### Inherited from ```ts Error.prepareStackTrace ``` *** ### InvalidApiSecretError Defined in: [packages/auth/lib/errors/InvalidApiSecretError.ts:10](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/auth/lib/errors/InvalidApiSecretError.ts#L10) Error class representing a specific error scenario where an API secret is provided but is not a valid string. This error is thrown when an API request is made with an API secret that does not meet the expected format or type (string). #### Extends - `Error` #### Constructors ##### Constructor ```ts new InvalidApiSecretError(): InvalidApiSecretError; ``` Defined in: [packages/auth/lib/errors/InvalidApiSecretError.ts:11](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/auth/lib/errors/InvalidApiSecretError.ts#L11) ###### Returns [`InvalidApiSecretError`](#invalidapisecreterror) ###### Overrides ```ts Error.constructor ``` #### Properties ##### cause? ```ts optional cause: unknown; ``` Defined in: node\_modules/typescript/lib/lib.es2022.error.d.ts:24 ###### Inherited from ```ts Error.cause ``` ##### message ```ts message: string; ``` Defined in: node\_modules/typescript/lib/lib.es5.d.ts:1077 ###### Inherited from ```ts Error.message ``` ##### name ```ts name: string; ``` Defined in: node\_modules/typescript/lib/lib.es5.d.ts:1076 ###### Inherited from ```ts Error.name ``` ##### stack? ```ts optional stack: string; ``` Defined in: node\_modules/typescript/lib/lib.es5.d.ts:1078 ###### Inherited from ```ts Error.stack ``` ##### stackTraceLimit ```ts static stackTraceLimit: number; ``` Defined in: packages/auth/node\_modules/@types/node/globals.d.ts:149 The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. ###### Inherited from ```ts Error.stackTraceLimit ``` #### Methods ##### captureStackTrace() ```ts static captureStackTrace(targetObject, constructorOpt?): void; ``` Defined in: packages/auth/node\_modules/@types/node/globals.d.ts:133 Creates a `.stack` property on `targetObject`, which when accessed returns a string representing the location in the code at which `Error.captureStackTrace()` was called. ```js const myObject = {}; Error.captureStackTrace(myObject); myObject.stack; // Similar to `new Error().stack` ``` The first line of the trace will be prefixed with `${myObject.name}: ${myObject.message}`. The optional `constructorOpt` argument accepts a function. If given, all frames above `constructorOpt`, including `constructorOpt`, will be omitted from the generated stack trace. The `constructorOpt` argument is useful for hiding implementation details of error generation from the user. For instance: ```js function a() { b(); } function b() { c(); } function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error; } a(); ``` ###### Parameters ###### targetObject `object` ###### constructorOpt? `Function` ###### Returns `void` ###### Inherited from ```ts Error.captureStackTrace ``` ##### prepareStackTrace() ```ts static prepareStackTrace(err, stackTraces): any; ``` Defined in: packages/auth/node\_modules/@types/node/globals.d.ts:137 ###### Parameters ###### err `Error` ###### stackTraces `CallSite`[] ###### Returns `any` ###### See https://v8.dev/docs/stack-trace-api#customizing-stack-traces ###### Inherited from ```ts Error.prepareStackTrace ``` *** ### InvalidSignatureAlgorithmError Defined in: [packages/auth/lib/errors/InvalidSignatureAlgroithmError.ts:10](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/auth/lib/errors/InvalidSignatureAlgroithmError.ts#L10) Error class representing a specific error scenario where an invalid signature algorithm is provided. This error is thrown when an API request is made with a signature algorithm that is not supported or recognized. #### Extends - `Error` #### Constructors ##### Constructor ```ts new InvalidSignatureAlgorithmError(): InvalidSignatureAlgorithmError; ``` Defined in: [packages/auth/lib/errors/InvalidSignatureAlgroithmError.ts:11](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/auth/lib/errors/InvalidSignatureAlgroithmError.ts#L11) ###### Returns [`InvalidSignatureAlgorithmError`](#invalidsignaturealgorithmerror) ###### Overrides ```ts Error.constructor ``` #### Properties ##### cause? ```ts optional cause: unknown; ``` Defined in: node\_modules/typescript/lib/lib.es2022.error.d.ts:24 ###### Inherited from ```ts Error.cause ``` ##### message ```ts message: string; ``` Defined in: node\_modules/typescript/lib/lib.es5.d.ts:1077 ###### Inherited from ```ts Error.message ``` ##### name ```ts name: string; ``` Defined in: node\_modules/typescript/lib/lib.es5.d.ts:1076 ###### Inherited from ```ts Error.name ``` ##### stack? ```ts optional stack: string; ``` Defined in: node\_modules/typescript/lib/lib.es5.d.ts:1078 ###### Inherited from ```ts Error.stack ``` ##### stackTraceLimit ```ts static stackTraceLimit: number; ``` Defined in: packages/auth/node\_modules/@types/node/globals.d.ts:149 The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. ###### Inherited from ```ts Error.stackTraceLimit ``` #### Methods ##### captureStackTrace() ```ts static captureStackTrace(targetObject, constructorOpt?): void; ``` Defined in: packages/auth/node\_modules/@types/node/globals.d.ts:133 Creates a `.stack` property on `targetObject`, which when accessed returns a string representing the location in the code at which `Error.captureStackTrace()` was called. ```js const myObject = {}; Error.captureStackTrace(myObject); myObject.stack; // Similar to `new Error().stack` ``` The first line of the trace will be prefixed with `${myObject.name}: ${myObject.message}`. The optional `constructorOpt` argument accepts a function. If given, all frames above `constructorOpt`, including `constructorOpt`, will be omitted from the generated stack trace. The `constructorOpt` argument is useful for hiding implementation details of error generation from the user. For instance: ```js function a() { b(); } function b() { c(); } function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error; } a(); ``` ###### Parameters ###### targetObject `object` ###### constructorOpt? `Function` ###### Returns `void` ###### Inherited from ```ts Error.captureStackTrace ``` ##### prepareStackTrace() ```ts static prepareStackTrace(err, stackTraces): any; ``` Defined in: packages/auth/node\_modules/@types/node/globals.d.ts:137 ###### Parameters ###### err `Error` ###### stackTraces `CallSite`[] ###### Returns `any` ###### See https://v8.dev/docs/stack-trace-api#customizing-stack-traces ###### Inherited from ```ts Error.prepareStackTrace ``` *** ### MissingApiKeyError Defined in: [packages/auth/lib/errors/MissingApiKeyError.ts:10](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/auth/lib/errors/MissingApiKeyError.ts#L10) Error class representing a specific error scenario where an API key is missing in the request. This error is thrown when an API request is made without providing the necessary API key for authentication. #### Extends - `Error` #### Constructors ##### Constructor ```ts new MissingApiKeyError(): MissingApiKeyError; ``` Defined in: [packages/auth/lib/errors/MissingApiKeyError.ts:11](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/auth/lib/errors/MissingApiKeyError.ts#L11) ###### Returns [`MissingApiKeyError`](#missingapikeyerror) ###### Overrides ```ts Error.constructor ``` #### Properties ##### cause? ```ts optional cause: unknown; ``` Defined in: node\_modules/typescript/lib/lib.es2022.error.d.ts:24 ###### Inherited from ```ts Error.cause ``` ##### message ```ts message: string; ``` Defined in: node\_modules/typescript/lib/lib.es5.d.ts:1077 ###### Inherited from ```ts Error.message ``` ##### name ```ts name: string; ``` Defined in: node\_modules/typescript/lib/lib.es5.d.ts:1076 ###### Inherited from ```ts Error.name ``` ##### stack? ```ts optional stack: string; ``` Defined in: node\_modules/typescript/lib/lib.es5.d.ts:1078 ###### Inherited from ```ts Error.stack ``` ##### stackTraceLimit ```ts static stackTraceLimit: number; ``` Defined in: packages/auth/node\_modules/@types/node/globals.d.ts:149 The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. ###### Inherited from ```ts Error.stackTraceLimit ``` #### Methods ##### captureStackTrace() ```ts static captureStackTrace(targetObject, constructorOpt?): void; ``` Defined in: packages/auth/node\_modules/@types/node/globals.d.ts:133 Creates a `.stack` property on `targetObject`, which when accessed returns a string representing the location in the code at which `Error.captureStackTrace()` was called. ```js const myObject = {}; Error.captureStackTrace(myObject); myObject.stack; // Similar to `new Error().stack` ``` The first line of the trace will be prefixed with `${myObject.name}: ${myObject.message}`. The optional `constructorOpt` argument accepts a function. If given, all frames above `constructorOpt`, including `constructorOpt`, will be omitted from the generated stack trace. The `constructorOpt` argument is useful for hiding implementation details of error generation from the user. For instance: ```js function a() { b(); } function b() { c(); } function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error; } a(); ``` ###### Parameters ###### targetObject `object` ###### constructorOpt? `Function` ###### Returns `void` ###### Inherited from ```ts Error.captureStackTrace ``` ##### prepareStackTrace() ```ts static prepareStackTrace(err, stackTraces): any; ``` Defined in: packages/auth/node\_modules/@types/node/globals.d.ts:137 ###### Parameters ###### err `Error` ###### stackTraces `CallSite`[] ###### Returns `any` ###### See https://v8.dev/docs/stack-trace-api#customizing-stack-traces ###### Inherited from ```ts Error.prepareStackTrace ``` *** ### MissingApiSecretError Defined in: [packages/auth/lib/errors/MissingApiSecretError.ts:10](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/auth/lib/errors/MissingApiSecretError.ts#L10) Error class representing a specific error scenario where an API secret is missing in the request. This error is thrown when an API request is made without providing the necessary API secret for authentication. #### Extends - `Error` #### Constructors ##### Constructor ```ts new MissingApiSecretError(): MissingApiSecretError; ``` Defined in: [packages/auth/lib/errors/MissingApiSecretError.ts:11](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/auth/lib/errors/MissingApiSecretError.ts#L11) ###### Returns [`MissingApiSecretError`](#missingapisecreterror) ###### Overrides ```ts Error.constructor ``` #### Properties ##### cause? ```ts optional cause: unknown; ``` Defined in: node\_modules/typescript/lib/lib.es2022.error.d.ts:24 ###### Inherited from ```ts Error.cause ``` ##### message ```ts message: string; ``` Defined in: node\_modules/typescript/lib/lib.es5.d.ts:1077 ###### Inherited from ```ts Error.message ``` ##### name ```ts name: string; ``` Defined in: node\_modules/typescript/lib/lib.es5.d.ts:1076 ###### Inherited from ```ts Error.name ``` ##### stack? ```ts optional stack: string; ``` Defined in: node\_modules/typescript/lib/lib.es5.d.ts:1078 ###### Inherited from ```ts Error.stack ``` ##### stackTraceLimit ```ts static stackTraceLimit: number; ``` Defined in: packages/auth/node\_modules/@types/node/globals.d.ts:149 The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. ###### Inherited from ```ts Error.stackTraceLimit ``` #### Methods ##### captureStackTrace() ```ts static captureStackTrace(targetObject, constructorOpt?): void; ``` Defined in: packages/auth/node\_modules/@types/node/globals.d.ts:133 Creates a `.stack` property on `targetObject`, which when accessed returns a string representing the location in the code at which `Error.captureStackTrace()` was called. ```js const myObject = {}; Error.captureStackTrace(myObject); myObject.stack; // Similar to `new Error().stack` ``` The first line of the trace will be prefixed with `${myObject.name}: ${myObject.message}`. The optional `constructorOpt` argument accepts a function. If given, all frames above `constructorOpt`, including `constructorOpt`, will be omitted from the generated stack trace. The `constructorOpt` argument is useful for hiding implementation details of error generation from the user. For instance: ```js function a() { b(); } function b() { c(); } function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error; } a(); ``` ###### Parameters ###### targetObject `object` ###### constructorOpt? `Function` ###### Returns `void` ###### Inherited from ```ts Error.captureStackTrace ``` ##### prepareStackTrace() ```ts static prepareStackTrace(err, stackTraces): any; ``` Defined in: packages/auth/node\_modules/@types/node/globals.d.ts:137 ###### Parameters ###### err `Error` ###### stackTraces `CallSite`[] ###### Returns `any` ###### See https://v8.dev/docs/stack-trace-api#customizing-stack-traces ###### Inherited from ```ts Error.prepareStackTrace ``` *** ### MissingSignatureError Defined in: [packages/auth/lib/errors/MissingSignatureError.ts:12](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/auth/lib/errors/MissingSignatureError.ts#L12) Error class representing a specific error scenario where a signature algorithm is expected but missing in the request. This error is thrown when an API request is made without providing the necessary signature algorithm for authentication. Users should select a value from the AlgorithmTypes enum. #### Extends - `Error` #### Constructors ##### Constructor ```ts new MissingSignatureError(): MissingSignatureError; ``` Defined in: [packages/auth/lib/errors/MissingSignatureError.ts:13](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/auth/lib/errors/MissingSignatureError.ts#L13) ###### Returns [`MissingSignatureError`](#missingsignatureerror) ###### Overrides ```ts Error.constructor ``` #### Properties ##### cause? ```ts optional cause: unknown; ``` Defined in: node\_modules/typescript/lib/lib.es2022.error.d.ts:24 ###### Inherited from ```ts Error.cause ``` ##### message ```ts message: string; ``` Defined in: node\_modules/typescript/lib/lib.es5.d.ts:1077 ###### Inherited from ```ts Error.message ``` ##### name ```ts name: string; ``` Defined in: node\_modules/typescript/lib/lib.es5.d.ts:1076 ###### Inherited from ```ts Error.name ``` ##### stack? ```ts optional stack: string; ``` Defined in: node\_modules/typescript/lib/lib.es5.d.ts:1078 ###### Inherited from ```ts Error.stack ``` ##### stackTraceLimit ```ts static stackTraceLimit: number; ``` Defined in: packages/auth/node\_modules/@types/node/globals.d.ts:149 The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. ###### Inherited from ```ts Error.stackTraceLimit ``` #### Methods ##### captureStackTrace() ```ts static captureStackTrace(targetObject, constructorOpt?): void; ``` Defined in: packages/auth/node\_modules/@types/node/globals.d.ts:133 Creates a `.stack` property on `targetObject`, which when accessed returns a string representing the location in the code at which `Error.captureStackTrace()` was called. ```js const myObject = {}; Error.captureStackTrace(myObject); myObject.stack; // Similar to `new Error().stack` ``` The first line of the trace will be prefixed with `${myObject.name}: ${myObject.message}`. The optional `constructorOpt` argument accepts a function. If given, all frames above `constructorOpt`, including `constructorOpt`, will be omitted from the generated stack trace. The `constructorOpt` argument is useful for hiding implementation details of error generation from the user. For instance: ```js function a() { b(); } function b() { c(); } function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error; } a(); ``` ###### Parameters ###### targetObject `object` ###### constructorOpt? `Function` ###### Returns `void` ###### Inherited from ```ts Error.captureStackTrace ``` ##### prepareStackTrace() ```ts static prepareStackTrace(err, stackTraces): any; ``` Defined in: packages/auth/node\_modules/@types/node/globals.d.ts:137 ###### Parameters ###### err `Error` ###### stackTraces `CallSite`[] ###### Returns `any` ###### See https://v8.dev/docs/stack-trace-api#customizing-stack-traces ###### Inherited from ```ts Error.prepareStackTrace ``` ## Interfaces ### AuthInterface Defined in: [packages/auth/lib/interfaces/AuthInterface.ts:10](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/auth/lib/interfaces/AuthInterface.ts#L10) Interface defining the methods for handling various authentication mechanisms and parameter generation. #### Extends - [`AuthParams`](#authparams) #### Properties ##### apiKey? ```ts optional apiKey: null | string; ``` Defined in: [packages/auth/lib/types/AuthParams.ts:13](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/auth/lib/types/AuthParams.ts#L13) The API key used to authenticate requests. It may be omitted if using JWT or signature authentication. This value can be found in your Vonage Developer Dashboard. ###### Inherited from [`AuthParams`](#authparams).[`apiKey`](#apikey-2) ##### apiSecret? ```ts optional apiSecret: null | string; ``` Defined in: [packages/auth/lib/types/AuthParams.ts:20](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/auth/lib/types/AuthParams.ts#L20) The API secret used to authenticate requests. It may be omitted if using JWT or signature authentication. This value can be found in your Vonage Developer Dashboard. ###### Inherited from [`AuthParams`](#authparams).[`apiSecret`](#apisecret-2) ##### applicationId? ```ts optional applicationId: null | string; ``` Defined in: [packages/auth/lib/types/AuthParams.ts:36](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/auth/lib/types/AuthParams.ts#L36) The application ID used in conjunction with the private key for JWT authentication. It may be omitted if using API key/secret or signature authentication. This value can be found in your Vonage Developer Dashboard. ###### Inherited from [`AuthParams`](#authparams).[`applicationId`](#applicationid-2) ##### jwtOptions? ```ts optional jwtOptions: GeneratorOptions; ``` Defined in: [packages/auth/lib/types/AuthParams.ts:49](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/auth/lib/types/AuthParams.ts#L49) Options for generating JWTs, including the JWT issuer (application ID) and subject (user ID). ###### Inherited from [`AuthParams`](#authparams).[`jwtOptions`](#jwtoptions-2) ##### privateKey? ```ts optional privateKey: null | string | Buffer; ``` Defined in: [packages/auth/lib/types/AuthParams.ts:29](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/auth/lib/types/AuthParams.ts#L29) The private key used for JWT authentication. It can be provided as a string (read from a file) or as a Buffer (opened directly from a file). This key is downloaded when you create an application in your Vonage Developer Dashboard and may be omitted if using API key/secret or signature authentication. ###### Inherited from [`AuthParams`](#authparams).[`privateKey`](#privatekey-2) ##### signature? ```ts optional signature: null | SignedHashParams; ``` Defined in: [packages/auth/lib/types/AuthParams.ts:43](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/auth/lib/types/AuthParams.ts#L43) An object containing parameters for signature authentication, including the secret and algorithm. It may be omitted if using API key/secret or JWT authentication. ###### Inherited from [`AuthParams`](#authparams).[`signature`](#signature-2) #### Methods ##### createBasicHeader() ```ts createBasicHeader(): Promise; ``` Defined in: [packages/auth/lib/interfaces/AuthInterface.ts:41](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/auth/lib/interfaces/AuthInterface.ts#L41) Asynchronously generates a basic authentication header. ###### Returns `Promise`\<`string`\> - A promise that resolves with the generated basic authentication header. ##### createBearerHeader() ```ts createBearerHeader(): Promise; ``` Defined in: [packages/auth/lib/interfaces/AuthInterface.ts:49](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/auth/lib/interfaces/AuthInterface.ts#L49) Asynchronously generates a bearer authentication header. ###### Returns `Promise`\<`string`\> - A promise that resolves with the generated bearer authentication header. ##### createSignatureHash() ```ts createSignatureHash(params): Promise; ``` Defined in: [packages/auth/lib/interfaces/AuthInterface.ts:33](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/auth/lib/interfaces/AuthInterface.ts#L33) Asynchronously generates a signature hash for authentication, merging it with provided parameters. ###### Type Parameters ###### T `T` Type of the parameters to merge with. ###### Parameters ###### params `T` Parameters to merge with the generated signature hash. ###### Returns `Promise`\<[`AuthSignedParams`](#authsignedparams) & `T`\> - A promise that resolves with the merged signature hash and parameters. ##### getQueryParams() ```ts getQueryParams(params?): Promise; ``` Defined in: [packages/auth/lib/interfaces/AuthInterface.ts:21](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/auth/lib/interfaces/AuthInterface.ts#L21) Asynchronously generates query parameters for authentication, optionally merging with provided parameters. ###### Type Parameters ###### T `T` Type of the additional parameters to merge with. ###### Parameters ###### params? `T` Additional parameters to merge with the generated authentication query parameters. ###### Returns `Promise`\<[`AuthQueryParams`](#authqueryparams) & `T`\> - A promise that resolves with the merged authentication query parameters. ## Type Aliases ### AuthParams ```ts type AuthParams = object; ``` Defined in: [packages/auth/lib/types/AuthParams.ts:7](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/auth/lib/types/AuthParams.ts#L7) Represents the authentication parameters required for API requests. #### Extended by - [`AuthInterface`](#authinterface) #### Properties ##### apiKey? ```ts optional apiKey: string | null; ``` Defined in: [packages/auth/lib/types/AuthParams.ts:13](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/auth/lib/types/AuthParams.ts#L13) The API key used to authenticate requests. It may be omitted if using JWT or signature authentication. This value can be found in your Vonage Developer Dashboard. ##### apiSecret? ```ts optional apiSecret: string | null; ``` Defined in: [packages/auth/lib/types/AuthParams.ts:20](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/auth/lib/types/AuthParams.ts#L20) The API secret used to authenticate requests. It may be omitted if using JWT or signature authentication. This value can be found in your Vonage Developer Dashboard. ##### applicationId? ```ts optional applicationId: string | null; ``` Defined in: [packages/auth/lib/types/AuthParams.ts:36](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/auth/lib/types/AuthParams.ts#L36) The application ID used in conjunction with the private key for JWT authentication. It may be omitted if using API key/secret or signature authentication. This value can be found in your Vonage Developer Dashboard. ##### jwtOptions? ```ts optional jwtOptions: GeneratorOptions; ``` Defined in: [packages/auth/lib/types/AuthParams.ts:49](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/auth/lib/types/AuthParams.ts#L49) Options for generating JWTs, including the JWT issuer (application ID) and subject (user ID). ##### privateKey? ```ts optional privateKey: string | Buffer | null; ``` Defined in: [packages/auth/lib/types/AuthParams.ts:29](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/auth/lib/types/AuthParams.ts#L29) The private key used for JWT authentication. It can be provided as a string (read from a file) or as a Buffer (opened directly from a file). This key is downloaded when you create an application in your Vonage Developer Dashboard and may be omitted if using API key/secret or signature authentication. ##### signature? ```ts optional signature: SignedHashParams | null; ``` Defined in: [packages/auth/lib/types/AuthParams.ts:43](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/auth/lib/types/AuthParams.ts#L43) An object containing parameters for signature authentication, including the secret and algorithm. It may be omitted if using API key/secret or JWT authentication. *** ### ~~AuthQueryParams~~ ```ts type AuthQueryParams = object; ``` Defined in: [packages/auth/lib/types/AuthQueryParams.ts:9](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/auth/lib/types/AuthQueryParams.ts#L9) Represents the query parameters used for API request authentication. #### Deprecated This method of authentication, using API credentials in query parameters, is outdated and not recommended due to security concerns. Consider using more secure authentication methods, such as JWT or signature authentication. #### Properties ##### ~~api\_key~~ ```ts api_key: string; ``` Defined in: [packages/auth/lib/types/AuthQueryParams.ts:14](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/auth/lib/types/AuthQueryParams.ts#L14) The API key used to authenticate requests. This value can be found in your Vonage Developer Dashboard. ##### ~~api\_secret~~ ```ts api_secret: string; ``` Defined in: [packages/auth/lib/types/AuthQueryParams.ts:20](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/auth/lib/types/AuthQueryParams.ts#L20) The API secret used to authenticate requests. This value can also be found in your Vonage Developer Dashboard. *** ### AuthSignedParams ```ts type AuthSignedParams = object; ``` Defined in: [packages/auth/lib/types/AuthSignedParams.ts:12](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/auth/lib/types/AuthSignedParams.ts#L12) Represents the parameters used for HMAC signature-based API request authentication. Note: Not all API endpoints support this method of authentication. Please refer to the specific API documentation to determine if HMAC signature authentication is supported. For more information on signing requests, visit: https://developer.vonage.com/en/getting-started/concepts/signing-messages #### Properties ##### api\_key ```ts api_key: string; ``` Defined in: [packages/auth/lib/types/AuthSignedParams.ts:17](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/auth/lib/types/AuthSignedParams.ts#L17) The API key used to authenticate requests. This value can be found in your Vonage Developer Dashboard. ##### sig? ```ts optional sig: string; ``` Defined in: [packages/auth/lib/types/AuthSignedParams.ts:24](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/auth/lib/types/AuthSignedParams.ts#L24) The generated signature, used to verify the authenticity of the request. It's typically generated by hashing the request parameters with a secret key. ##### timestamp? ```ts optional timestamp: string; ``` Defined in: [packages/auth/lib/types/AuthSignedParams.ts:30](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/auth/lib/types/AuthSignedParams.ts#L30) The UNIX timestamp when the request is made. Utilized to prevent replay attacks by making each signature unique to a specific time window. *** ### SignedHashParams ```ts type SignedHashParams = object; ``` Defined in: [packages/auth/lib/types/SignedHashParams.ts:7](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/auth/lib/types/SignedHashParams.ts#L7) Represents the parameters required for generating a signed hash. #### Properties ##### algorithm ```ts algorithm: AlgorithmTypes; ``` Defined in: [packages/auth/lib/types/SignedHashParams.ts:18](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/auth/lib/types/SignedHashParams.ts#L18) Specifies the algorithm type used for signing the hash. Utilizes the algorithm types defined in the `AlgorithmTypes` enum. ##### secret ```ts secret: string; ``` Defined in: [packages/auth/lib/types/SignedHashParams.ts:12](https://github.com/Vonage/vonage-node-sdk/blob/3846dd78a7cd39b838839d5c93db0b1652c0d168/packages/auth/lib/types/SignedHashParams.ts#L12) The secret key used to sign the hash, ensuring the integrity and authenticity of the message. It should be kept private and secure.