You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
By default the SDK will transparently request a new access token when it expires. If multiple threads are running 1 thread will request a new token, other threads will wait a maximum of 10 seconds for the token refresh to complete, this time can be overriden with the _client.config.refresh_token_wait_max_ field of the _Configuration_ object within ApiClient.
130
-
If you wish to apply the refresh logic yourself, set _client.config.refresh_access_token_ to false and store the refresh token. The _tokenExpiryTime_ can be used to preemptively request a new token. Use _refreshCodeAuthorizationGrant_ to request a new token when necessary.
129
+
By default the SDK will transparently request a new access token when it expires. By default the SDK will transparently request a new access token when it expires. If multiple threads are running 1 thread will request a new token, other threads will wait a maximum of 10 seconds for the token refresh to complete, this time can be overriden with the _refreshTokenWaitTime_ field of the _ApiClient_ object.
130
+
If you wish to apply the refresh logic yourself, set _shouldRefreshAccessToken_ to false and store the refresh token. The _tokenExpiryTime_ can be used to preemptively request a new token. Use _refreshCodeAuthorizationGrant_ to request a new token when necessary.
When authenticating in a browser using `loginClientCredentialsGrant(...)`, if the user completes the authentication process but their session is unable to be authorized, they will still be redirected back to the redirect URI. When `loginClientCredentialsGrant(...)` is invoked after the failure redirect, the promise returned will be rejected with an error message built from the `error` and `error_description`. The error information, as well as the state, can be accessed via `platformClient.ApiClient.instance.authData`. The application is expected to identify these login failures and interact with the user in a manner appropriate for the application.
191
191
192
-
## SDK Logging
193
-
194
-
Logging of API requests and responses can be controlled by a number of parameters on the `Configuration`'s `Logger` instance.
client.config.logger.setLogger(); // To apply above changes
219
-
```
220
-
221
-
#### Configuration file
222
-
223
-
A number of configuration parameters can be applied using a configuration file. There are two sources for this file:
224
-
225
-
1. The SDK will look for `%USERPROFILE%\.genesyscloudjavascript\config` on Windows if the environment variable USERPROFILE is defined, otherwise uses the path to the profile directory of the current user as home, or `$HOME/.genesyscloudjavascript/config` on Unix.
226
-
2. Provide a valid file path to `client.config.setConfigPath()`
227
-
228
-
The SDK will constantly check to see if the config file has been updated, regardless of whether a config file was present at start-up. To disable this behaviour, set `client.config.live_reload_config` to false.
229
-
INI and JSON formats are supported. See below for examples of configuration values in both formats:
230
-
231
-
INI:
232
-
```{"language":"ini"}
233
-
[logging]
234
-
log_level = trace
235
-
log_format = text
236
-
log_to_console = false
237
-
log_file_path = /var/log/javascriptsdk.log
238
-
log_response_body = false
239
-
log_request_body = false
240
-
[reauthentication]
241
-
refresh_access_token = true
242
-
refresh_token_wait_max = 10
243
-
[general]
244
-
live_reload_config = true
245
-
host = https://api.mypurecloud.com
246
-
```
247
-
248
-
JSON:
249
-
```{"language":"json"}
250
-
{
251
-
"logging": {
252
-
"log_level": "trace",
253
-
"log_format": "text",
254
-
"log_to_console": false,
255
-
"log_file_path": "/var/log/javascriptsdk.log",
256
-
"log_response_body": false,
257
-
"log_request_body": false
258
-
},
259
-
"reauthentication": {
260
-
"refresh_access_token": true,
261
-
"refresh_token_wait_max": 10
262
-
},
263
-
"general": {
264
-
"live_reload_config": true,
265
-
"host": "https://api.mypurecloud.com"
266
-
}
267
-
}
268
-
```
269
192
270
193
## Environments
271
194
@@ -428,6 +351,16 @@ Example error response object:
428
351
```
429
352
430
353
354
+
## Debug Logging
355
+
356
+
There are hooks to trace requests and responses. To enable debug tracing, provide a log object. Optionally, specify a maximum number of lines. If specified, the response body trace will be truncated. If not specified, the entire response body will be traced out.
357
+
358
+
```{"language":"javascript"}
359
+
const client = platformClient.ApiClient.instance;
360
+
client.setDebugLog(console.log, 25);
361
+
```
362
+
363
+
431
364
## Versioning
432
365
433
366
The SDK's version is incremented according to the [Semantic Versioning Specification](https://semver.org/). The decision to increment version numbers is determined by [diffing the Platform API's swagger](https://github.com/purecloudlabs/platform-client-sdk-common/blob/master/modules/swaggerDiff.js) for automated builds, and optionally forcing a version bump when a build is triggered manually (e.g. releasing a bugfix).
By default the SDK will transparently request a new access token when it expires. If multiple threads are running 1 thread will request a new token, other threads will wait a maximum of 10 seconds for the token refresh to complete, this time can be overriden with the _client.config.refresh_token_wait_max_ field of the _Configuration_ object within ApiClient.
130
-
If you wish to apply the refresh logic yourself, set _client.config.refresh_access_token_ to false and store the refresh token. The _tokenExpiryTime_ can be used to preemptively request a new token. Use _refreshCodeAuthorizationGrant_ to request a new token when necessary.
129
+
By default the SDK will transparently request a new access token when it expires. By default the SDK will transparently request a new access token when it expires. If multiple threads are running 1 thread will request a new token, other threads will wait a maximum of 10 seconds for the token refresh to complete, this time can be overriden with the _refreshTokenWaitTime_ field of the _ApiClient_ object.
130
+
If you wish to apply the refresh logic yourself, set _shouldRefreshAccessToken_ to false and store the refresh token. The _tokenExpiryTime_ can be used to preemptively request a new token. Use _refreshCodeAuthorizationGrant_ to request a new token when necessary.
When authenticating in a browser using `loginClientCredentialsGrant(...)`, if the user completes the authentication process but their session is unable to be authorized, they will still be redirected back to the redirect URI. When `loginClientCredentialsGrant(...)` is invoked after the failure redirect, the promise returned will be rejected with an error message built from the `error` and `error_description`. The error information, as well as the state, can be accessed via `platformClient.ApiClient.instance.authData`. The application is expected to identify these login failures and interact with the user in a manner appropriate for the application.
191
191
192
-
## SDK Logging
193
-
194
-
Logging of API requests and responses can be controlled by a number of parameters on the `Configuration`'s `Logger` instance.
client.config.logger.setLogger(); // To apply above changes
219
-
```
220
-
221
-
#### Configuration file
222
-
223
-
A number of configuration parameters can be applied using a configuration file. There are two sources for this file:
224
-
225
-
1. The SDK will look for `%USERPROFILE%\.genesyscloudjavascript\config` on Windows if the environment variable USERPROFILE is defined, otherwise uses the path to the profile directory of the current user as home, or `$HOME/.genesyscloudjavascript/config` on Unix.
226
-
2. Provide a valid file path to `client.config.setConfigPath()`
227
-
228
-
The SDK will constantly check to see if the config file has been updated, regardless of whether a config file was present at start-up. To disable this behaviour, set `client.config.live_reload_config` to false.
229
-
INI and JSON formats are supported. See below for examples of configuration values in both formats:
230
-
231
-
INI:
232
-
```{"language":"ini"}
233
-
[logging]
234
-
log_level = trace
235
-
log_format = text
236
-
log_to_console = false
237
-
log_file_path = /var/log/javascriptsdk.log
238
-
log_response_body = false
239
-
log_request_body = false
240
-
[reauthentication]
241
-
refresh_access_token = true
242
-
refresh_token_wait_max = 10
243
-
[general]
244
-
live_reload_config = true
245
-
host = https://api.mypurecloud.com
246
-
```
247
-
248
-
JSON:
249
-
```{"language":"json"}
250
-
{
251
-
"logging": {
252
-
"log_level": "trace",
253
-
"log_format": "text",
254
-
"log_to_console": false,
255
-
"log_file_path": "/var/log/javascriptsdk.log",
256
-
"log_response_body": false,
257
-
"log_request_body": false
258
-
},
259
-
"reauthentication": {
260
-
"refresh_access_token": true,
261
-
"refresh_token_wait_max": 10
262
-
},
263
-
"general": {
264
-
"live_reload_config": true,
265
-
"host": "https://api.mypurecloud.com"
266
-
}
267
-
}
268
-
```
269
192
270
193
## Environments
271
194
@@ -428,6 +351,16 @@ Example error response object:
428
351
```
429
352
430
353
354
+
## Debug Logging
355
+
356
+
There are hooks to trace requests and responses. To enable debug tracing, provide a log object. Optionally, specify a maximum number of lines. If specified, the response body trace will be truncated. If not specified, the entire response body will be traced out.
357
+
358
+
```{"language":"javascript"}
359
+
const client = platformClient.ApiClient.instance;
360
+
client.setDebugLog(console.log, 25);
361
+
```
362
+
363
+
431
364
## Versioning
432
365
433
366
The SDK's version is incremented according to the [Semantic Versioning Specification](https://semver.org/). The decision to increment version numbers is determined by [diffing the Platform API's swagger](https://github.com/purecloudlabs/platform-client-sdk-common/blob/master/modules/swaggerDiff.js) for automated builds, and optionally forcing a version bump when a build is triggered manually (e.g. releasing a bugfix).
0 commit comments