@@ -19,21 +19,25 @@ For situations where you want to communicate with a TerminusDB server API, the W
19
19
``` js
20
20
// to connect with your local terminusDB
21
21
const client = new TerminusClient.WOQLClient (SERVER_URL ,{user: " admin" ,key: " myKey" })
22
- await client .connect ()
23
- client .db (" test" )
24
- client .checkout (" dev" )
25
- const schema = await client .getSchema ()
22
+ async function getSchema () {
23
+ await client .connect ()
24
+ client .db (" test" )
25
+ client .checkout (" dev" )
26
+ const schema = await client .getSchema ()
27
+ }
26
28
// The client has an internal state which defines what
27
29
// organization / database / repository / branch / ref it is currently attached to
28
30
29
31
// to connect with your TerminusDB Cloud Instance
30
32
const client = new TerminusClient.WOQLClient (SERVER_URL ,{user: " myemail@something.com" ,
31
- jwt: " MY_ACCESS_TOKEN" ,
32
33
organization: ' mycloudTeam' })
33
- await client .connect ()
34
- client .db (" test" )
35
- client .checkout (" dev" )
36
- const schema = await client .getSchema ()
34
+ client .setApiKey (MY_ACCESS_TOKEN )
35
+ async function getSchema () {
36
+ await client .connect ()
37
+ client .db (" test" )
38
+ client .checkout (" dev" )
39
+ const schema = await client .getSchema ()
40
+ }
37
41
```
38
42
39
43
### TerminusDB Client API
@@ -250,6 +254,8 @@ Use [#remoteAuth](#remoteAuth) instead.
250
254
251
255
### setApiKey
252
256
#### woqlClient.setApiKey(accessToken)
257
+ set the api key to access the cloud resources
258
+
253
259
254
260
| Param | Type |
255
261
| --- | --- |
@@ -266,16 +272,6 @@ add extra headers to your request
266
272
| customHeaders | <code>object</code> |
267
273
268
274
269
- ### setApiKey
270
- #### woqlClient.setApiKey(accessToken)
271
- set the api access token to connect to TerminusX Cloud
272
-
273
-
274
- | Param | Type |
275
- | --- | --- |
276
- | accessToken | <code>string</code> |
277
-
278
-
279
275
### copy
280
276
#### woqlClient.copy() ⇒ [<code>WOQLClient</code>](#WOQLClient)
281
277
creates a copy of the client with identical internal state and context
0 commit comments