From 252c3ef7d40ac4dfc0a18b9203ca4a4e1c1a4943 Mon Sep 17 00:00:00 2001 From: odedpeer Date: Mon, 9 May 2022 08:28:03 +0300 Subject: [PATCH] document the ability to modify the client user agent string --- README.md | 13 +++++++++++++ src/types/client.d.ts | 1 + 2 files changed, 14 insertions(+) diff --git a/README.md b/README.md index 41985100d..3c5e6f87d 100644 --- a/README.md +++ b/README.md @@ -824,6 +824,19 @@ When the proxy configuration is not overridden as shown above, Okta client relie To use HTTP Basic Auth with your proxy, use the `http://user:password@host/` syntax. +## User Agent + +If you need to specify a User-Agent for the client requests, you can configure it with `userAgent` property. +```javascript +const okta = require('@okta/okta-sdk-nodejs'); + +const client = new okta.Client({ + orgUrl: 'https://dev-1234.oktapreview.com/', + token: 'xYzabc', // Obtained from Developer Dashboard + userAgent: 'example/1.0' +}); +``` + ## TypeScript usage ### 4.5.x diff --git a/src/types/client.d.ts b/src/types/client.d.ts index 8b5d1ee02..9c4050416 100644 --- a/src/types/client.d.ts +++ b/src/types/client.d.ts @@ -30,6 +30,7 @@ export declare class Client extends ParameterizedOperationsClient { cacheStore?: CacheStorage, cacheMiddleware?: typeof defaultCacheMiddleware | unknown defaultCacheMiddlewareResponseBufferSize?: number, + userAgent?: string, httpsProxy?: string | unknown, // https://github.com/TooTallNate/node-agent-base/issues/56 });