@@ -41,7 +41,7 @@ object with the `token` set to the developer token and construct the client with
41
41
const { BoxClient } = require (' box-typescript-sdk-gen/lib/client.generated.js' );
42
42
const {
43
43
BoxDeveloperTokenAuth ,
44
- } = require (' box-typescript-sdk-gen/lib/developerTokenAuth.generated.js' );
44
+ } = require (' box-typescript-sdk-gen/lib/box/ developerTokenAuth.generated.js' );
45
45
46
46
const auth = new BoxDeveloperTokenAuth ({ token: ' DEVELOPER_TOKEN_GOES_HERE' });
47
47
const client = new BoxClient ({ auth });
@@ -78,7 +78,7 @@ const { BoxClient } = require('box-typescript-sdk-gen/lib/client.generated.js');
78
78
const {
79
79
BoxJwtAuth ,
80
80
JwtConfig ,
81
- } = require (' box-typescript-sdk-gen/lib/jwtAuth.generated.js' );
81
+ } = require (' box-typescript-sdk-gen/lib/box/ jwtAuth.generated.js' );
82
82
83
83
const jwtConfig = JwtConfig .fromConfigFile (' /path/to/settings.json' );
84
84
const jwtAuth = new BoxJwtAuth ({ config: jwtConfig });
@@ -95,7 +95,7 @@ const { BoxClient } = require('box-typescript-sdk-gen/lib/client.generated.js');
95
95
const {
96
96
BoxJwtAuth ,
97
97
JwtConfig ,
98
- } = require (' box-typescript-sdk-gen/lib/jwtAuth.generated.js' );
98
+ } = require (' box-typescript-sdk-gen/lib/box/ jwtAuth.generated.js' );
99
99
100
100
const jwtConfig = new JwtConfig ({
101
101
clientId: ' YOUR_CLIENT_ID' ,
@@ -127,7 +127,7 @@ const { BoxClient } = require('box-typescript-sdk-gen/lib/client.generated.js');
127
127
const {
128
128
BoxJwtAuth ,
129
129
JwtConfig ,
130
- } = require (' box-typescript-sdk-gen/lib/jwtAuth.generated.js' );
130
+ } = require (' box-typescript-sdk-gen/lib/box/ jwtAuth.generated.js' );
131
131
132
132
const jwtConfig = JwtConfig .fromConfigFile (' /path/to/settings.json' );
133
133
const jwtAuth = new BoxJwtAuth ({ config: jwtConfig });
@@ -144,7 +144,7 @@ const { BoxClient } = require('box-typescript-sdk-gen/lib/client.generated.js');
144
144
const {
145
145
BoxJwtAuth ,
146
146
JwtConfig ,
147
- } = require (' box-typescript-sdk-gen/lib/jwtAuth.generated.js' );
147
+ } = require (' box-typescript-sdk-gen/lib/box/ jwtAuth.generated.js' );
148
148
149
149
const jwtConfig = new JwtConfig ({
150
150
clientId: ' YOUR_CLIENT_ID' ,
@@ -177,7 +177,7 @@ const { BoxClient } = require('box-typescript-sdk-gen/lib/client.generated.js');
177
177
const {
178
178
BoxCcgAuth ,
179
179
CcgConfig ,
180
- } = require (' box-typescript-sdk-gen/lib/ccgAuth.generated.js' );
180
+ } = require (' box-typescript-sdk-gen/lib/box/ ccgAuth.generated.js' );
181
181
182
182
const ccgConfig = new CcgConfig ({
183
183
userId: ' YOUR_USER_ID' ,
@@ -206,7 +206,7 @@ const { BoxClient } = require('box-typescript-sdk-gen/lib/client.generated.js');
206
206
const {
207
207
BoxCcgAuth ,
208
208
CcgConfig ,
209
- } = require (' box-typescript-sdk-gen/lib/ccgAuth.generated.js' );
209
+ } = require (' box-typescript-sdk-gen/lib/box/ ccgAuth.generated.js' );
210
210
211
211
const ccgConfig = new CcgConfig ({
212
212
enterpriseId: ' YOUR_ENTERPRISE_ID' ,
@@ -230,7 +230,7 @@ const { BoxClient } = require('box-typescript-sdk-gen/lib/client.generated.js');
230
230
const {
231
231
BoxCcgAuth ,
232
232
CcgConfig ,
233
- } = require (' box-typescript-sdk-gen/lib/ccgAuth.generated.js' );
233
+ } = require (' box-typescript-sdk-gen/lib/box/ ccgAuth.generated.js' );
234
234
235
235
const ccgConfig = new CcgConfig ({
236
236
userId: ' YOUR_USER_ID' ,
@@ -283,7 +283,7 @@ browser or web view) in order to obtain an auth code.
283
283
const {
284
284
BoxOAuth ,
285
285
OAuthConfig ,
286
- } = require (' box-typescript-sdk-gen/lib/oauth.generated.js' );
286
+ } = require (' box-typescript-sdk-gen/lib/box/ oauth.generated.js' );
287
287
288
288
const config = new OAuthConfig ({
289
289
clientId: ' OAUTH_CLIENT_ID' ,
@@ -310,9 +310,11 @@ await oauth.getTokensAuthorizationCodeGrant('code');
310
310
# Revoke token
311
311
312
312
Access tokens for a client can be revoked when needed. This call invalidates old token.
313
- For CCGAuth and JWTAuth you can still reuse the ` auth ` object to retrieve a new token. If you make any new call after revoking the token,
314
- a new token will be automatically retrieved.
315
- For OAuth it would be necessary to manually go through the authentication process again.
313
+ For BoxCcgAuth and BoxJwtAuth you can still reuse the ` auth ` object to retrieve a new token.
314
+ If you make any new call after revoking the token, a new token will be automatically retrieved.
315
+ For BoxOAuth it would be necessary to manually go through the authentication process again.
316
+ For BoxDeveloperTokenAuth, it is necessary to provide a DeveloperTokenConfig during initialization,
317
+ containing the client ID and client secret.
316
318
317
319
To revoke current client's tokens in the storage use the following code:
318
320
@@ -338,7 +340,7 @@ If you want to learn more about available scopes please go [here](https://develo
338
340
339
341
For example to get a new token with only ` item_preview ` scope, restricted to a single file, suitable for the
340
342
[ Content Preview UI Element] ( https://developer.box.com/en/guides/embed/ui-elements/preview/ ) you can use the following code.
341
- You can also initialize ` DeveloperTokenAuth ` with the retrieved access token and use it to create a new Client.
343
+ You can also initialize ` BoxDeveloperTokenAuth ` with the retrieved access token and use it to create a new Client.
342
344
343
345
<!-- sample post_oauth2_token downscope_token -->
344
346
0 commit comments