@gr4vy/sdk 1.1.29 → 1.1.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/FUNCTIONS.md +1 -6
  2. package/README.md +32 -37
  3. package/docs/sdks/all/README.md +9 -13
  4. package/docs/sdks/auditlogs/README.md +9 -13
  5. package/docs/sdks/balances/README.md +9 -13
  6. package/docs/sdks/buyers/README.md +45 -65
  7. package/docs/sdks/cardschemedefinitions/README.md +9 -13
  8. package/docs/sdks/checkoutsessions/README.md +36 -52
  9. package/docs/sdks/cryptogram/README.md +9 -13
  10. package/docs/sdks/digitalwallets/README.md +45 -65
  11. package/docs/sdks/domains/README.md +18 -26
  12. package/docs/sdks/events/README.md +9 -13
  13. package/docs/sdks/executions/README.md +27 -39
  14. package/docs/sdks/giftcards/README.md +36 -52
  15. package/docs/sdks/gr4vygiftcards/README.md +9 -13
  16. package/docs/sdks/gr4vypaymentmethods/README.md +9 -13
  17. package/docs/sdks/gr4vyrefunds/README.md +27 -39
  18. package/docs/sdks/jobs/README.md +9 -13
  19. package/docs/sdks/merchantaccounts/README.md +36 -48
  20. package/docs/sdks/networktokens/README.md +45 -65
  21. package/docs/sdks/paymentlinks/README.md +36 -52
  22. package/docs/sdks/paymentmethods/README.md +36 -52
  23. package/docs/sdks/paymentoptions/README.md +9 -13
  24. package/docs/sdks/paymentservicedefinitions/README.md +27 -36
  25. package/docs/sdks/paymentservices/README.md +63 -91
  26. package/docs/sdks/paymentservicetokens/README.md +27 -39
  27. package/docs/sdks/payouts/README.md +27 -39
  28. package/docs/sdks/refunds/README.md +9 -13
  29. package/docs/sdks/reportexecutions/README.md +9 -13
  30. package/docs/sdks/reports/README.md +36 -52
  31. package/docs/sdks/sessions/README.md +27 -38
  32. package/docs/sdks/settlements/README.md +18 -26
  33. package/docs/sdks/shippingdetails/README.md +45 -65
  34. package/docs/sdks/transactions/README.md +63 -91
  35. package/examples/accountUpdaterJobsCreate.example.ts +9 -4
  36. package/examples/package-lock.json +2716 -0
  37. package/jsr.json +1 -1
  38. package/lib/config.d.ts +3 -3
  39. package/lib/config.js +3 -3
  40. package/package.json +1 -1
  41. package/src/lib/config.ts +3 -3
package/FUNCTIONS.md CHANGED
@@ -20,18 +20,13 @@ specific category of applications.
20
20
 
21
21
  ```typescript
22
22
  import { Gr4vyCore } from "@gr4vy/sdk/core.js";
23
- import { withToken } from "@gr4vy/sdk/lib/auth.js";
24
23
  import { accountUpdaterJobsCreate } from "@gr4vy/sdk/funcs/accountUpdaterJobsCreate.js";
25
24
 
26
25
  // Use `Gr4vyCore` for best tree-shaking performance.
27
26
  // You can create one instance of it to use across an application.
28
27
  const gr4vy = new Gr4vyCore({
29
28
  merchantAccountId: "<id>",
30
- server: "sandbox",
31
- id: "example",
32
- bearerAuth: withToken({
33
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
34
- }),
29
+ bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
35
30
  });
36
31
 
37
32
  async function run() {
package/README.md CHANGED
@@ -450,13 +450,14 @@ try {
450
450
 
451
451
  ### Example
452
452
  ```typescript
453
- import { Gr4vy } from "@gr4vy/sdk";
453
+ import { Gr4vy, withToken } from "@gr4vy/sdk";
454
454
  import * as errors from "@gr4vy/sdk/models/errors";
455
+ import fs from "fs";
455
456
 
456
457
  const gr4vy = new Gr4vy({
457
- merchantAccountId: "<id>",
458
- server: "sandbox",
459
458
  id: "example",
459
+ server: "sandbox",
460
+ merchantAccountId: "default",
460
461
  bearerAuth: withToken({
461
462
  privateKey: fs.readFileSync("private_key.pem", "utf8"),
462
463
  }),
@@ -553,14 +554,13 @@ If the selected server has variables, you may override its default values throug
553
554
  #### Example
554
555
 
555
556
  ```typescript
556
- import { Gr4vy } from "@gr4vy/sdk";
557
+ import { Gr4vy, withToken } from "@gr4vy/sdk";
558
+ import fs from "fs";
557
559
 
558
560
  const gr4vy = new Gr4vy({
559
- server: "production",
560
- id: "<id>",
561
- merchantAccountId: "<id>",
562
- server: "sandbox",
563
561
  id: "example",
562
+ server: "sandbox",
563
+ merchantAccountId: "default",
564
564
  bearerAuth: withToken({
565
565
  privateKey: fs.readFileSync("private_key.pem", "utf8"),
566
566
  }),
@@ -585,13 +585,13 @@ run();
585
585
 
586
586
  The default server can also be overridden globally by passing a URL to the `serverURL: string` optional parameter when initializing the SDK client instance. For example:
587
587
  ```typescript
588
- import { Gr4vy } from "@gr4vy/sdk";
588
+ import { Gr4vy, withToken } from "@gr4vy/sdk";
589
+ import fs from "fs";
589
590
 
590
591
  const gr4vy = new Gr4vy({
591
- serverURL: "https://api.sandbox.example.gr4vy.app",
592
- merchantAccountId: "<id>",
593
- server: "sandbox",
594
592
  id: "example",
593
+ server: "sandbox",
594
+ merchantAccountId: "default",
595
595
  bearerAuth: withToken({
596
596
  privateKey: fs.readFileSync("private_key.pem", "utf8"),
597
597
  }),
@@ -675,15 +675,16 @@ This SDK supports the following security scheme globally:
675
675
 
676
676
  To authenticate with the API the `bearerAuth` parameter must be set when initializing the SDK client instance. For example:
677
677
  ```typescript
678
- import { Gr4vy } from "@gr4vy/sdk";
678
+ import { Gr4vy, withToken } from "@gr4vy/sdk";
679
+ import fs from "fs";
679
680
 
680
681
  const gr4vy = new Gr4vy({
681
- server: "sandbox",
682
682
  id: "example",
683
+ server: "sandbox",
684
+ merchantAccountId: "default",
683
685
  bearerAuth: withToken({
684
686
  privateKey: fs.readFileSync("private_key.pem", "utf8"),
685
687
  }),
686
- merchantAccountId: "<id>",
687
688
  });
688
689
 
689
690
  async function run() {
@@ -741,12 +742,13 @@ yarn add @gr4vy/sdk zod
741
742
  ### Example
742
743
 
743
744
  ```typescript
744
- import { Gr4vy } from "@gr4vy/sdk";
745
+ import { Gr4vy, withToken } from "@gr4vy/sdk";
746
+ import fs from "fs";
745
747
 
746
748
  const gr4vy = new Gr4vy({
747
- merchantAccountId: "<id>",
748
- server: "sandbox",
749
749
  id: "example",
750
+ server: "sandbox",
751
+ merchantAccountId: "default",
750
752
  bearerAuth: withToken({
751
753
  privateKey: fs.readFileSync("private_key.pem", "utf8"),
752
754
  }),
@@ -781,12 +783,13 @@ syntax.
781
783
  Here's an example of one such pagination call:
782
784
 
783
785
  ```typescript
784
- import { Gr4vy } from "@gr4vy/sdk";
786
+ import { Gr4vy, withToken } from "@gr4vy/sdk";
787
+ import fs from "fs";
785
788
 
786
789
  const gr4vy = new Gr4vy({
787
- merchantAccountId: "<id>",
788
- server: "sandbox",
789
790
  id: "example",
791
+ server: "sandbox",
792
+ merchantAccountId: "default",
790
793
  bearerAuth: withToken({
791
794
  privateKey: fs.readFileSync("private_key.pem", "utf8"),
792
795
  }),
@@ -812,12 +815,13 @@ Some of the endpoints in this SDK support retries. If you use the SDK without a
812
815
 
813
816
  To change the default retry strategy for a single API call, simply provide a retryConfig object to the call:
814
817
  ```typescript
815
- import { Gr4vy } from "@gr4vy/sdk";
818
+ import { Gr4vy, withToken } from "@gr4vy/sdk";
819
+ import fs from "fs";
816
820
 
817
821
  const gr4vy = new Gr4vy({
818
- merchantAccountId: "<id>",
819
- server: "sandbox",
820
822
  id: "example",
823
+ server: "sandbox",
824
+ merchantAccountId: "default",
821
825
  bearerAuth: withToken({
822
826
  privateKey: fs.readFileSync("private_key.pem", "utf8"),
823
827
  }),
@@ -851,22 +855,13 @@ run();
851
855
 
852
856
  If you'd like to override the default retry strategy for all operations that support retries, you can provide a retryConfig at SDK initialization:
853
857
  ```typescript
854
- import { Gr4vy } from "@gr4vy/sdk";
858
+ import { Gr4vy, withToken } from "@gr4vy/sdk";
859
+ import fs from "fs";
855
860
 
856
861
  const gr4vy = new Gr4vy({
857
- retryConfig: {
858
- strategy: "backoff",
859
- backoff: {
860
- initialInterval: 1,
861
- maxInterval: 50,
862
- exponent: 1.1,
863
- maxElapsedTime: 100,
864
- },
865
- retryConnectionErrors: false,
866
- },
867
- merchantAccountId: "<id>",
868
- server: "sandbox",
869
862
  id: "example",
863
+ server: "sandbox",
864
+ merchantAccountId: "default",
870
865
  bearerAuth: withToken({
871
866
  privateKey: fs.readFileSync("private_key.pem", "utf8"),
872
867
  }),
@@ -15,15 +15,16 @@ Create a refund for all instruments on a transaction.
15
15
 
16
16
  <!-- UsageSnippet language="typescript" operationID="create_full_transaction_refund" method="post" path="/transactions/{transaction_id}/refunds/all" -->
17
17
  ```typescript
18
- import { Gr4vy } from "@gr4vy/sdk";
18
+ import { Gr4vy, withToken } from "@gr4vy/sdk";
19
+ import fs from "fs";
19
20
 
20
21
  const gr4vy = new Gr4vy({
21
- merchantAccountId: "<id>",
22
- server: "sandbox",
23
- id: "example",
24
- bearerAuth: withToken({
25
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
26
- }),
22
+ id: "example",
23
+ server: "sandbox",
24
+ merchantAccountId: "default",
25
+ bearerAuth: withToken({
26
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
27
+ }),
27
28
  });
28
29
 
29
30
  async function run() {
@@ -41,18 +42,13 @@ The standalone function version of this method:
41
42
 
42
43
  ```typescript
43
44
  import { Gr4vyCore } from "@gr4vy/sdk/core.js";
44
- import { withToken } from "@gr4vy/sdk/lib/auth.js";
45
45
  import { transactionsRefundsAllCreate } from "@gr4vy/sdk/funcs/transactionsRefundsAllCreate.js";
46
46
 
47
47
  // Use `Gr4vyCore` for best tree-shaking performance.
48
48
  // You can create one instance of it to use across an application.
49
49
  const gr4vy = new Gr4vyCore({
50
50
  merchantAccountId: "<id>",
51
- server: "sandbox",
52
- id: "example",
53
- bearerAuth: withToken({
54
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
55
- }),
51
+ bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
56
52
  });
57
53
 
58
54
  async function run() {
@@ -15,15 +15,16 @@ Returns a list of activity by dashboard users.
15
15
 
16
16
  <!-- UsageSnippet language="typescript" operationID="list_audit_logs" method="get" path="/audit-logs" -->
17
17
  ```typescript
18
- import { Gr4vy } from "@gr4vy/sdk";
18
+ import { Gr4vy, withToken } from "@gr4vy/sdk";
19
+ import fs from "fs";
19
20
 
20
21
  const gr4vy = new Gr4vy({
21
- merchantAccountId: "<id>",
22
- server: "sandbox",
23
- id: "example",
24
- bearerAuth: withToken({
25
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
26
- }),
22
+ id: "example",
23
+ server: "sandbox",
24
+ merchantAccountId: "default",
25
+ bearerAuth: withToken({
26
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
27
+ }),
27
28
  });
28
29
 
29
30
  async function run() {
@@ -43,18 +44,13 @@ The standalone function version of this method:
43
44
 
44
45
  ```typescript
45
46
  import { Gr4vyCore } from "@gr4vy/sdk/core.js";
46
- import { withToken } from "@gr4vy/sdk/lib/auth.js";
47
47
  import { auditLogsList } from "@gr4vy/sdk/funcs/auditLogsList.js";
48
48
 
49
49
  // Use `Gr4vyCore` for best tree-shaking performance.
50
50
  // You can create one instance of it to use across an application.
51
51
  const gr4vy = new Gr4vyCore({
52
52
  merchantAccountId: "<id>",
53
- server: "sandbox",
54
- id: "example",
55
- bearerAuth: withToken({
56
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
57
- }),
53
+ bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
58
54
  });
59
55
 
60
56
  async function run() {
@@ -15,15 +15,16 @@ Fetch the balances for one or more gift cards.
15
15
 
16
16
  <!-- UsageSnippet language="typescript" operationID="list_gift_card_balances" method="post" path="/gift-cards/balances" -->
17
17
  ```typescript
18
- import { Gr4vy } from "@gr4vy/sdk";
18
+ import { Gr4vy, withToken } from "@gr4vy/sdk";
19
+ import fs from "fs";
19
20
 
20
21
  const gr4vy = new Gr4vy({
21
- merchantAccountId: "<id>",
22
- server: "sandbox",
23
- id: "example",
24
- bearerAuth: withToken({
25
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
26
- }),
22
+ id: "example",
23
+ server: "sandbox",
24
+ merchantAccountId: "default",
25
+ bearerAuth: withToken({
26
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
27
+ }),
27
28
  });
28
29
 
29
30
  async function run() {
@@ -54,18 +55,13 @@ The standalone function version of this method:
54
55
 
55
56
  ```typescript
56
57
  import { Gr4vyCore } from "@gr4vy/sdk/core.js";
57
- import { withToken } from "@gr4vy/sdk/lib/auth.js";
58
58
  import { giftCardsBalancesList } from "@gr4vy/sdk/funcs/giftCardsBalancesList.js";
59
59
 
60
60
  // Use `Gr4vyCore` for best tree-shaking performance.
61
61
  // You can create one instance of it to use across an application.
62
62
  const gr4vy = new Gr4vyCore({
63
63
  merchantAccountId: "<id>",
64
- server: "sandbox",
65
- id: "example",
66
- bearerAuth: withToken({
67
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
68
- }),
64
+ bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
69
65
  });
70
66
 
71
67
  async function run() {
@@ -19,15 +19,16 @@ List all buyers or search for a specific buyer.
19
19
 
20
20
  <!-- UsageSnippet language="typescript" operationID="list_buyers" method="get" path="/buyers" -->
21
21
  ```typescript
22
- import { Gr4vy } from "@gr4vy/sdk";
22
+ import { Gr4vy, withToken } from "@gr4vy/sdk";
23
+ import fs from "fs";
23
24
 
24
25
  const gr4vy = new Gr4vy({
25
- merchantAccountId: "<id>",
26
- server: "sandbox",
27
- id: "example",
28
- bearerAuth: withToken({
29
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
30
- }),
26
+ id: "example",
27
+ server: "sandbox",
28
+ merchantAccountId: "default",
29
+ bearerAuth: withToken({
30
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
31
+ }),
31
32
  });
32
33
 
33
34
  async function run() {
@@ -47,18 +48,13 @@ The standalone function version of this method:
47
48
 
48
49
  ```typescript
49
50
  import { Gr4vyCore } from "@gr4vy/sdk/core.js";
50
- import { withToken } from "@gr4vy/sdk/lib/auth.js";
51
51
  import { buyersList } from "@gr4vy/sdk/funcs/buyersList.js";
52
52
 
53
53
  // Use `Gr4vyCore` for best tree-shaking performance.
54
54
  // You can create one instance of it to use across an application.
55
55
  const gr4vy = new Gr4vyCore({
56
56
  merchantAccountId: "<id>",
57
- server: "sandbox",
58
- id: "example",
59
- bearerAuth: withToken({
60
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
61
- }),
57
+ bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
62
58
  });
63
59
 
64
60
  async function run() {
@@ -115,15 +111,16 @@ Create a new buyer record.
115
111
 
116
112
  <!-- UsageSnippet language="typescript" operationID="add_buyer" method="post" path="/buyers" -->
117
113
  ```typescript
118
- import { Gr4vy } from "@gr4vy/sdk";
114
+ import { Gr4vy, withToken } from "@gr4vy/sdk";
115
+ import fs from "fs";
119
116
 
120
117
  const gr4vy = new Gr4vy({
121
- merchantAccountId: "<id>",
122
- server: "sandbox",
123
- id: "example",
124
- bearerAuth: withToken({
125
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
126
- }),
118
+ id: "example",
119
+ server: "sandbox",
120
+ merchantAccountId: "default",
121
+ bearerAuth: withToken({
122
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
123
+ }),
127
124
  });
128
125
 
129
126
  async function run() {
@@ -141,18 +138,13 @@ The standalone function version of this method:
141
138
 
142
139
  ```typescript
143
140
  import { Gr4vyCore } from "@gr4vy/sdk/core.js";
144
- import { withToken } from "@gr4vy/sdk/lib/auth.js";
145
141
  import { buyersCreate } from "@gr4vy/sdk/funcs/buyersCreate.js";
146
142
 
147
143
  // Use `Gr4vyCore` for best tree-shaking performance.
148
144
  // You can create one instance of it to use across an application.
149
145
  const gr4vy = new Gr4vyCore({
150
146
  merchantAccountId: "<id>",
151
- server: "sandbox",
152
- id: "example",
153
- bearerAuth: withToken({
154
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
155
- }),
147
+ bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
156
148
  });
157
149
 
158
150
  async function run() {
@@ -208,15 +200,16 @@ Fetches a buyer by its ID.
208
200
 
209
201
  <!-- UsageSnippet language="typescript" operationID="get_buyer" method="get" path="/buyers/{buyer_id}" -->
210
202
  ```typescript
211
- import { Gr4vy } from "@gr4vy/sdk";
203
+ import { Gr4vy, withToken } from "@gr4vy/sdk";
204
+ import fs from "fs";
212
205
 
213
206
  const gr4vy = new Gr4vy({
214
- merchantAccountId: "<id>",
215
- server: "sandbox",
216
- id: "example",
217
- bearerAuth: withToken({
218
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
219
- }),
207
+ id: "example",
208
+ server: "sandbox",
209
+ merchantAccountId: "default",
210
+ bearerAuth: withToken({
211
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
212
+ }),
220
213
  });
221
214
 
222
215
  async function run() {
@@ -234,18 +227,13 @@ The standalone function version of this method:
234
227
 
235
228
  ```typescript
236
229
  import { Gr4vyCore } from "@gr4vy/sdk/core.js";
237
- import { withToken } from "@gr4vy/sdk/lib/auth.js";
238
230
  import { buyersGet } from "@gr4vy/sdk/funcs/buyersGet.js";
239
231
 
240
232
  // Use `Gr4vyCore` for best tree-shaking performance.
241
233
  // You can create one instance of it to use across an application.
242
234
  const gr4vy = new Gr4vyCore({
243
235
  merchantAccountId: "<id>",
244
- server: "sandbox",
245
- id: "example",
246
- bearerAuth: withToken({
247
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
248
- }),
236
+ bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
249
237
  });
250
238
 
251
239
  async function run() {
@@ -301,15 +289,16 @@ Updates a buyer record.
301
289
 
302
290
  <!-- UsageSnippet language="typescript" operationID="update_buyer" method="put" path="/buyers/{buyer_id}" -->
303
291
  ```typescript
304
- import { Gr4vy } from "@gr4vy/sdk";
292
+ import { Gr4vy, withToken } from "@gr4vy/sdk";
293
+ import fs from "fs";
305
294
 
306
295
  const gr4vy = new Gr4vy({
307
- merchantAccountId: "<id>",
308
- server: "sandbox",
309
- id: "example",
310
- bearerAuth: withToken({
311
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
312
- }),
296
+ id: "example",
297
+ server: "sandbox",
298
+ merchantAccountId: "default",
299
+ bearerAuth: withToken({
300
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
301
+ }),
313
302
  });
314
303
 
315
304
  async function run() {
@@ -327,18 +316,13 @@ The standalone function version of this method:
327
316
 
328
317
  ```typescript
329
318
  import { Gr4vyCore } from "@gr4vy/sdk/core.js";
330
- import { withToken } from "@gr4vy/sdk/lib/auth.js";
331
319
  import { buyersUpdate } from "@gr4vy/sdk/funcs/buyersUpdate.js";
332
320
 
333
321
  // Use `Gr4vyCore` for best tree-shaking performance.
334
322
  // You can create one instance of it to use across an application.
335
323
  const gr4vy = new Gr4vyCore({
336
324
  merchantAccountId: "<id>",
337
- server: "sandbox",
338
- id: "example",
339
- bearerAuth: withToken({
340
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
341
- }),
325
+ bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
342
326
  });
343
327
 
344
328
  async function run() {
@@ -395,15 +379,16 @@ Permanently removes a buyer record.
395
379
 
396
380
  <!-- UsageSnippet language="typescript" operationID="delete_buyer" method="delete" path="/buyers/{buyer_id}" -->
397
381
  ```typescript
398
- import { Gr4vy } from "@gr4vy/sdk";
382
+ import { Gr4vy, withToken } from "@gr4vy/sdk";
383
+ import fs from "fs";
399
384
 
400
385
  const gr4vy = new Gr4vy({
401
- merchantAccountId: "<id>",
402
- server: "sandbox",
403
- id: "example",
404
- bearerAuth: withToken({
405
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
406
- }),
386
+ id: "example",
387
+ server: "sandbox",
388
+ merchantAccountId: "default",
389
+ bearerAuth: withToken({
390
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
391
+ }),
407
392
  });
408
393
 
409
394
  async function run() {
@@ -421,18 +406,13 @@ The standalone function version of this method:
421
406
 
422
407
  ```typescript
423
408
  import { Gr4vyCore } from "@gr4vy/sdk/core.js";
424
- import { withToken } from "@gr4vy/sdk/lib/auth.js";
425
409
  import { buyersDelete } from "@gr4vy/sdk/funcs/buyersDelete.js";
426
410
 
427
411
  // Use `Gr4vyCore` for best tree-shaking performance.
428
412
  // You can create one instance of it to use across an application.
429
413
  const gr4vy = new Gr4vyCore({
430
414
  merchantAccountId: "<id>",
431
- server: "sandbox",
432
- id: "example",
433
- bearerAuth: withToken({
434
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
435
- }),
415
+ bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
436
416
  });
437
417
 
438
418
  async function run() {
@@ -15,15 +15,16 @@ Fetch a list of the definitions of each card scheme.
15
15
 
16
16
  <!-- UsageSnippet language="typescript" operationID="list_card_scheme_definitions" method="get" path="/card-scheme-definitions" -->
17
17
  ```typescript
18
- import { Gr4vy } from "@gr4vy/sdk";
18
+ import { Gr4vy, withToken } from "@gr4vy/sdk";
19
+ import fs from "fs";
19
20
 
20
21
  const gr4vy = new Gr4vy({
21
- merchantAccountId: "<id>",
22
- server: "sandbox",
23
- id: "example",
24
- bearerAuth: withToken({
25
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
26
- }),
22
+ id: "example",
23
+ server: "sandbox",
24
+ merchantAccountId: "default",
25
+ bearerAuth: withToken({
26
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
27
+ }),
27
28
  });
28
29
 
29
30
  async function run() {
@@ -41,18 +42,13 @@ The standalone function version of this method:
41
42
 
42
43
  ```typescript
43
44
  import { Gr4vyCore } from "@gr4vy/sdk/core.js";
44
- import { withToken } from "@gr4vy/sdk/lib/auth.js";
45
45
  import { cardSchemeDefinitionsList } from "@gr4vy/sdk/funcs/cardSchemeDefinitionsList.js";
46
46
 
47
47
  // Use `Gr4vyCore` for best tree-shaking performance.
48
48
  // You can create one instance of it to use across an application.
49
49
  const gr4vy = new Gr4vyCore({
50
50
  merchantAccountId: "<id>",
51
- server: "sandbox",
52
- id: "example",
53
- bearerAuth: withToken({
54
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
55
- }),
51
+ bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
56
52
  });
57
53
 
58
54
  async function run() {