Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document the ability to modify the client user agent string #323

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/types/client.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
});

Expand Down