@gr4vy/sdk 0.18.14 → 0.18.16

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 (38) hide show
  1. package/FUNCTIONS.md +6 -1
  2. package/README.md +40 -8
  3. package/bin/mcp-server.js +5 -5
  4. package/bin/mcp-server.js.map +4 -4
  5. package/docs/sdks/all/README.md +11 -2
  6. package/docs/sdks/auditlogs/README.md +11 -2
  7. package/docs/sdks/balances/README.md +11 -2
  8. package/docs/sdks/buyers/README.md +55 -10
  9. package/docs/sdks/cardschemedefinitions/README.md +11 -2
  10. package/docs/sdks/checkoutsessions/README.md +44 -8
  11. package/docs/sdks/cryptogram/README.md +11 -2
  12. package/docs/sdks/digitalwallets/README.md +55 -10
  13. package/docs/sdks/domains/README.md +22 -4
  14. package/docs/sdks/giftcards/README.md +44 -8
  15. package/docs/sdks/gr4vygiftcards/README.md +11 -2
  16. package/docs/sdks/gr4vypaymentmethods/README.md +11 -2
  17. package/docs/sdks/gr4vyrefunds/README.md +11 -2
  18. package/docs/sdks/gr4vytransactionsrefunds/README.md +22 -4
  19. package/docs/sdks/jobs/README.md +11 -2
  20. package/docs/sdks/merchantaccounts/README.md +44 -8
  21. package/docs/sdks/networktokens/README.md +55 -10
  22. package/docs/sdks/paymentmethods/README.md +44 -8
  23. package/docs/sdks/paymentoptions/README.md +11 -2
  24. package/docs/sdks/paymentservicetokens/README.md +33 -6
  25. package/docs/sdks/payouts/README.md +33 -6
  26. package/docs/sdks/refunds/README.md +11 -2
  27. package/docs/sdks/sessions/README.md +33 -6
  28. package/docs/sdks/shippingdetails/README.md +55 -10
  29. package/docs/sdks/transactions/README.md +77 -14
  30. package/jsr.json +1 -1
  31. package/lib/config.d.ts +2 -2
  32. package/lib/config.js +2 -2
  33. package/mcp-server/mcp-server.js +1 -1
  34. package/mcp-server/server.js +1 -1
  35. package/package.json +1 -1
  36. package/src/lib/config.ts +2 -2
  37. package/src/mcp-server/mcp-server.ts +1 -1
  38. package/src/mcp-server/server.ts +1 -1
@@ -20,7 +20,11 @@ Fetch details about a gift card.
20
20
  import { Gr4vy } from "@gr4vy/sdk";
21
21
 
22
22
  const gr4vy = new Gr4vy({
23
- bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
23
+ server: "sandbox",
24
+ id: "example",
25
+ bearerAuth: withToken({
26
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
27
+ }),
24
28
  });
25
29
 
26
30
  async function run() {
@@ -39,12 +43,17 @@ The standalone function version of this method:
39
43
 
40
44
  ```typescript
41
45
  import { Gr4vyCore } from "@gr4vy/sdk/core.js";
46
+ import { withToken } from "@gr4vy/sdk/lib/auth.js";
42
47
  import { giftCardsGet } from "@gr4vy/sdk/funcs/giftCardsGet.js";
43
48
 
44
49
  // Use `Gr4vyCore` for best tree-shaking performance.
45
50
  // You can create one instance of it to use across an application.
46
51
  const gr4vy = new Gr4vyCore({
47
- bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
52
+ server: "sandbox",
53
+ id: "example",
54
+ bearerAuth: withToken({
55
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
56
+ }),
48
57
  });
49
58
 
50
59
  async function run() {
@@ -107,7 +116,11 @@ Removes a gift card from our system.
107
116
  import { Gr4vy } from "@gr4vy/sdk";
108
117
 
109
118
  const gr4vy = new Gr4vy({
110
- bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
119
+ server: "sandbox",
120
+ id: "example",
121
+ bearerAuth: withToken({
122
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
123
+ }),
111
124
  });
112
125
 
113
126
  async function run() {
@@ -126,12 +139,17 @@ The standalone function version of this method:
126
139
 
127
140
  ```typescript
128
141
  import { Gr4vyCore } from "@gr4vy/sdk/core.js";
142
+ import { withToken } from "@gr4vy/sdk/lib/auth.js";
129
143
  import { giftCardsDelete } from "@gr4vy/sdk/funcs/giftCardsDelete.js";
130
144
 
131
145
  // Use `Gr4vyCore` for best tree-shaking performance.
132
146
  // You can create one instance of it to use across an application.
133
147
  const gr4vy = new Gr4vyCore({
134
- bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
148
+ server: "sandbox",
149
+ id: "example",
150
+ bearerAuth: withToken({
151
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
152
+ }),
135
153
  });
136
154
 
137
155
  async function run() {
@@ -195,7 +213,11 @@ Store a new gift card in the vault.
195
213
  import { Gr4vy } from "@gr4vy/sdk";
196
214
 
197
215
  const gr4vy = new Gr4vy({
198
- bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
216
+ server: "sandbox",
217
+ id: "example",
218
+ bearerAuth: withToken({
219
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
220
+ }),
199
221
  });
200
222
 
201
223
  async function run() {
@@ -219,12 +241,17 @@ The standalone function version of this method:
219
241
 
220
242
  ```typescript
221
243
  import { Gr4vyCore } from "@gr4vy/sdk/core.js";
244
+ import { withToken } from "@gr4vy/sdk/lib/auth.js";
222
245
  import { giftCardsCreate } from "@gr4vy/sdk/funcs/giftCardsCreate.js";
223
246
 
224
247
  // Use `Gr4vyCore` for best tree-shaking performance.
225
248
  // You can create one instance of it to use across an application.
226
249
  const gr4vy = new Gr4vyCore({
227
- bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
250
+ server: "sandbox",
251
+ id: "example",
252
+ bearerAuth: withToken({
253
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
254
+ }),
228
255
  });
229
256
 
230
257
  async function run() {
@@ -293,7 +320,11 @@ Browser all gift cards.
293
320
  import { Gr4vy } from "@gr4vy/sdk";
294
321
 
295
322
  const gr4vy = new Gr4vy({
296
- bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
323
+ server: "sandbox",
324
+ id: "example",
325
+ bearerAuth: withToken({
326
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
327
+ }),
297
328
  });
298
329
 
299
330
  async function run() {
@@ -314,12 +345,17 @@ The standalone function version of this method:
314
345
 
315
346
  ```typescript
316
347
  import { Gr4vyCore } from "@gr4vy/sdk/core.js";
348
+ import { withToken } from "@gr4vy/sdk/lib/auth.js";
317
349
  import { giftCardsList } from "@gr4vy/sdk/funcs/giftCardsList.js";
318
350
 
319
351
  // Use `Gr4vyCore` for best tree-shaking performance.
320
352
  // You can create one instance of it to use across an application.
321
353
  const gr4vy = new Gr4vyCore({
322
- bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
354
+ server: "sandbox",
355
+ id: "example",
356
+ bearerAuth: withToken({
357
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
358
+ }),
323
359
  });
324
360
 
325
361
  async function run() {
@@ -17,7 +17,11 @@ List all the stored gift cards for a specific buyer.
17
17
  import { Gr4vy } from "@gr4vy/sdk";
18
18
 
19
19
  const gr4vy = new Gr4vy({
20
- bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
20
+ server: "sandbox",
21
+ id: "example",
22
+ bearerAuth: withToken({
23
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
24
+ }),
21
25
  });
22
26
 
23
27
  async function run() {
@@ -36,12 +40,17 @@ The standalone function version of this method:
36
40
 
37
41
  ```typescript
38
42
  import { Gr4vyCore } from "@gr4vy/sdk/core.js";
43
+ import { withToken } from "@gr4vy/sdk/lib/auth.js";
39
44
  import { buyersGiftCardsList } from "@gr4vy/sdk/funcs/buyersGiftCardsList.js";
40
45
 
41
46
  // Use `Gr4vyCore` for best tree-shaking performance.
42
47
  // You can create one instance of it to use across an application.
43
48
  const gr4vy = new Gr4vyCore({
44
- bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
49
+ server: "sandbox",
50
+ id: "example",
51
+ bearerAuth: withToken({
52
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
53
+ }),
45
54
  });
46
55
 
47
56
  async function run() {
@@ -17,7 +17,11 @@ List all the stored payment methods for a specific buyer.
17
17
  import { Gr4vy } from "@gr4vy/sdk";
18
18
 
19
19
  const gr4vy = new Gr4vy({
20
- bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
20
+ server: "sandbox",
21
+ id: "example",
22
+ bearerAuth: withToken({
23
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
24
+ }),
21
25
  });
22
26
 
23
27
  async function run() {
@@ -41,12 +45,17 @@ The standalone function version of this method:
41
45
 
42
46
  ```typescript
43
47
  import { Gr4vyCore } from "@gr4vy/sdk/core.js";
48
+ import { withToken } from "@gr4vy/sdk/lib/auth.js";
44
49
  import { buyersPaymentMethodsList } from "@gr4vy/sdk/funcs/buyersPaymentMethodsList.js";
45
50
 
46
51
  // Use `Gr4vyCore` for best tree-shaking performance.
47
52
  // You can create one instance of it to use across an application.
48
53
  const gr4vy = new Gr4vyCore({
49
- bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
54
+ server: "sandbox",
55
+ id: "example",
56
+ bearerAuth: withToken({
57
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
58
+ }),
50
59
  });
51
60
 
52
61
  async function run() {
@@ -17,7 +17,11 @@ Create a refund for a transaction.
17
17
  import { Gr4vy } from "@gr4vy/sdk";
18
18
 
19
19
  const gr4vy = new Gr4vy({
20
- bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
20
+ server: "sandbox",
21
+ id: "example",
22
+ bearerAuth: withToken({
23
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
24
+ }),
21
25
  });
22
26
 
23
27
  async function run() {
@@ -41,12 +45,17 @@ The standalone function version of this method:
41
45
 
42
46
  ```typescript
43
47
  import { Gr4vyCore } from "@gr4vy/sdk/core.js";
48
+ import { withToken } from "@gr4vy/sdk/lib/auth.js";
44
49
  import { transactionRefundsCreate } from "@gr4vy/sdk/funcs/transactionRefundsCreate.js";
45
50
 
46
51
  // Use `Gr4vyCore` for best tree-shaking performance.
47
52
  // You can create one instance of it to use across an application.
48
53
  const gr4vy = new Gr4vyCore({
49
- bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
54
+ server: "sandbox",
55
+ id: "example",
56
+ bearerAuth: withToken({
57
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
58
+ }),
50
59
  });
51
60
 
52
61
  async function run() {
@@ -18,7 +18,11 @@ List refunds for a transaction.
18
18
  import { Gr4vy } from "@gr4vy/sdk";
19
19
 
20
20
  const gr4vy = new Gr4vy({
21
- bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
21
+ server: "sandbox",
22
+ id: "example",
23
+ bearerAuth: withToken({
24
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
25
+ }),
22
26
  });
23
27
 
24
28
  async function run() {
@@ -37,12 +41,17 @@ The standalone function version of this method:
37
41
 
38
42
  ```typescript
39
43
  import { Gr4vyCore } from "@gr4vy/sdk/core.js";
44
+ import { withToken } from "@gr4vy/sdk/lib/auth.js";
40
45
  import { transactionsRefundsList } from "@gr4vy/sdk/funcs/transactionsRefundsList.js";
41
46
 
42
47
  // Use `Gr4vyCore` for best tree-shaking performance.
43
48
  // You can create one instance of it to use across an application.
44
49
  const gr4vy = new Gr4vyCore({
45
- bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
50
+ server: "sandbox",
51
+ id: "example",
52
+ bearerAuth: withToken({
53
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
54
+ }),
46
55
  });
47
56
 
48
57
  async function run() {
@@ -105,7 +114,11 @@ Fetch refund for a transaction.
105
114
  import { Gr4vy } from "@gr4vy/sdk";
106
115
 
107
116
  const gr4vy = new Gr4vy({
108
- bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
117
+ server: "sandbox",
118
+ id: "example",
119
+ bearerAuth: withToken({
120
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
121
+ }),
109
122
  });
110
123
 
111
124
  async function run() {
@@ -124,12 +137,17 @@ The standalone function version of this method:
124
137
 
125
138
  ```typescript
126
139
  import { Gr4vyCore } from "@gr4vy/sdk/core.js";
140
+ import { withToken } from "@gr4vy/sdk/lib/auth.js";
127
141
  import { transactionsRefundsGet } from "@gr4vy/sdk/funcs/transactionsRefundsGet.js";
128
142
 
129
143
  // Use `Gr4vyCore` for best tree-shaking performance.
130
144
  // You can create one instance of it to use across an application.
131
145
  const gr4vy = new Gr4vyCore({
132
- bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
146
+ server: "sandbox",
147
+ id: "example",
148
+ bearerAuth: withToken({
149
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
150
+ }),
133
151
  });
134
152
 
135
153
  async function run() {
@@ -17,7 +17,11 @@ Schedule one or more stored cards for an account update.
17
17
  import { Gr4vy } from "@gr4vy/sdk";
18
18
 
19
19
  const gr4vy = new Gr4vy({
20
- bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
20
+ server: "sandbox",
21
+ id: "example",
22
+ bearerAuth: withToken({
23
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
24
+ }),
21
25
  });
22
26
 
23
27
  async function run() {
@@ -41,12 +45,17 @@ The standalone function version of this method:
41
45
 
42
46
  ```typescript
43
47
  import { Gr4vyCore } from "@gr4vy/sdk/core.js";
48
+ import { withToken } from "@gr4vy/sdk/lib/auth.js";
44
49
  import { accountUpdaterJobsCreate } from "@gr4vy/sdk/funcs/accountUpdaterJobsCreate.js";
45
50
 
46
51
  // Use `Gr4vyCore` for best tree-shaking performance.
47
52
  // You can create one instance of it to use across an application.
48
53
  const gr4vy = new Gr4vyCore({
49
- bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
54
+ server: "sandbox",
55
+ id: "example",
56
+ bearerAuth: withToken({
57
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
58
+ }),
50
59
  });
51
60
 
52
61
  async function run() {
@@ -20,7 +20,11 @@ List all merchant accounts in an instance.
20
20
  import { Gr4vy } from "@gr4vy/sdk";
21
21
 
22
22
  const gr4vy = new Gr4vy({
23
- bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
23
+ server: "sandbox",
24
+ id: "example",
25
+ bearerAuth: withToken({
26
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
27
+ }),
24
28
  });
25
29
 
26
30
  async function run() {
@@ -41,12 +45,17 @@ The standalone function version of this method:
41
45
 
42
46
  ```typescript
43
47
  import { Gr4vyCore } from "@gr4vy/sdk/core.js";
48
+ import { withToken } from "@gr4vy/sdk/lib/auth.js";
44
49
  import { merchantAccountsList } from "@gr4vy/sdk/funcs/merchantAccountsList.js";
45
50
 
46
51
  // Use `Gr4vyCore` for best tree-shaking performance.
47
52
  // You can create one instance of it to use across an application.
48
53
  const gr4vy = new Gr4vyCore({
49
- bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
54
+ server: "sandbox",
55
+ id: "example",
56
+ bearerAuth: withToken({
57
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
58
+ }),
50
59
  });
51
60
 
52
61
  async function run() {
@@ -112,7 +121,11 @@ Create a new merchant account in an instance.
112
121
  import { Gr4vy } from "@gr4vy/sdk";
113
122
 
114
123
  const gr4vy = new Gr4vy({
115
- bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
124
+ server: "sandbox",
125
+ id: "example",
126
+ bearerAuth: withToken({
127
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
128
+ }),
116
129
  });
117
130
 
118
131
  async function run() {
@@ -154,12 +167,17 @@ The standalone function version of this method:
154
167
 
155
168
  ```typescript
156
169
  import { Gr4vyCore } from "@gr4vy/sdk/core.js";
170
+ import { withToken } from "@gr4vy/sdk/lib/auth.js";
157
171
  import { merchantAccountsCreate } from "@gr4vy/sdk/funcs/merchantAccountsCreate.js";
158
172
 
159
173
  // Use `Gr4vyCore` for best tree-shaking performance.
160
174
  // You can create one instance of it to use across an application.
161
175
  const gr4vy = new Gr4vyCore({
162
- bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
176
+ server: "sandbox",
177
+ id: "example",
178
+ bearerAuth: withToken({
179
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
180
+ }),
163
181
  });
164
182
 
165
183
  async function run() {
@@ -245,7 +263,11 @@ Get info about a merchant account in an instance.
245
263
  import { Gr4vy } from "@gr4vy/sdk";
246
264
 
247
265
  const gr4vy = new Gr4vy({
248
- bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
266
+ server: "sandbox",
267
+ id: "example",
268
+ bearerAuth: withToken({
269
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
270
+ }),
249
271
  });
250
272
 
251
273
  async function run() {
@@ -264,12 +286,17 @@ The standalone function version of this method:
264
286
 
265
287
  ```typescript
266
288
  import { Gr4vyCore } from "@gr4vy/sdk/core.js";
289
+ import { withToken } from "@gr4vy/sdk/lib/auth.js";
267
290
  import { merchantAccountsGet } from "@gr4vy/sdk/funcs/merchantAccountsGet.js";
268
291
 
269
292
  // Use `Gr4vyCore` for best tree-shaking performance.
270
293
  // You can create one instance of it to use across an application.
271
294
  const gr4vy = new Gr4vyCore({
272
- bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
295
+ server: "sandbox",
296
+ id: "example",
297
+ bearerAuth: withToken({
298
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
299
+ }),
273
300
  });
274
301
 
275
302
  async function run() {
@@ -331,7 +358,11 @@ Update info for a merchant account in an instance.
331
358
  import { Gr4vy } from "@gr4vy/sdk";
332
359
 
333
360
  const gr4vy = new Gr4vy({
334
- bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
361
+ server: "sandbox",
362
+ id: "example",
363
+ bearerAuth: withToken({
364
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
365
+ }),
335
366
  });
336
367
 
337
368
  async function run() {
@@ -372,12 +403,17 @@ The standalone function version of this method:
372
403
 
373
404
  ```typescript
374
405
  import { Gr4vyCore } from "@gr4vy/sdk/core.js";
406
+ import { withToken } from "@gr4vy/sdk/lib/auth.js";
375
407
  import { merchantAccountsUpdate } from "@gr4vy/sdk/funcs/merchantAccountsUpdate.js";
376
408
 
377
409
  // Use `Gr4vyCore` for best tree-shaking performance.
378
410
  // You can create one instance of it to use across an application.
379
411
  const gr4vy = new Gr4vyCore({
380
- bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
412
+ server: "sandbox",
413
+ id: "example",
414
+ bearerAuth: withToken({
415
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
416
+ }),
381
417
  });
382
418
 
383
419
  async function run() {
@@ -21,7 +21,11 @@ List all network tokens stored for a payment method.
21
21
  import { Gr4vy } from "@gr4vy/sdk";
22
22
 
23
23
  const gr4vy = new Gr4vy({
24
- bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
24
+ server: "sandbox",
25
+ id: "example",
26
+ bearerAuth: withToken({
27
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
28
+ }),
25
29
  });
26
30
 
27
31
  async function run() {
@@ -40,12 +44,17 @@ The standalone function version of this method:
40
44
 
41
45
  ```typescript
42
46
  import { Gr4vyCore } from "@gr4vy/sdk/core.js";
47
+ import { withToken } from "@gr4vy/sdk/lib/auth.js";
43
48
  import { paymentMethodsNetworkTokensList } from "@gr4vy/sdk/funcs/paymentMethodsNetworkTokensList.js";
44
49
 
45
50
  // Use `Gr4vyCore` for best tree-shaking performance.
46
51
  // You can create one instance of it to use across an application.
47
52
  const gr4vy = new Gr4vyCore({
48
- bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
53
+ server: "sandbox",
54
+ id: "example",
55
+ bearerAuth: withToken({
56
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
57
+ }),
49
58
  });
50
59
 
51
60
  async function run() {
@@ -108,7 +117,11 @@ Provision a network token for a payment method.
108
117
  import { Gr4vy } from "@gr4vy/sdk";
109
118
 
110
119
  const gr4vy = new Gr4vy({
111
- bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
120
+ server: "sandbox",
121
+ id: "example",
122
+ bearerAuth: withToken({
123
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
124
+ }),
112
125
  });
113
126
 
114
127
  async function run() {
@@ -131,12 +144,17 @@ The standalone function version of this method:
131
144
 
132
145
  ```typescript
133
146
  import { Gr4vyCore } from "@gr4vy/sdk/core.js";
147
+ import { withToken } from "@gr4vy/sdk/lib/auth.js";
134
148
  import { paymentMethodsNetworkTokensCreate } from "@gr4vy/sdk/funcs/paymentMethodsNetworkTokensCreate.js";
135
149
 
136
150
  // Use `Gr4vyCore` for best tree-shaking performance.
137
151
  // You can create one instance of it to use across an application.
138
152
  const gr4vy = new Gr4vyCore({
139
- bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
153
+ server: "sandbox",
154
+ id: "example",
155
+ bearerAuth: withToken({
156
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
157
+ }),
140
158
  });
141
159
 
142
160
  async function run() {
@@ -205,7 +223,11 @@ Suspend a network token for a payment method.
205
223
  import { Gr4vy } from "@gr4vy/sdk";
206
224
 
207
225
  const gr4vy = new Gr4vy({
208
- bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
226
+ server: "sandbox",
227
+ id: "example",
228
+ bearerAuth: withToken({
229
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
230
+ }),
209
231
  });
210
232
 
211
233
  async function run() {
@@ -224,12 +246,17 @@ The standalone function version of this method:
224
246
 
225
247
  ```typescript
226
248
  import { Gr4vyCore } from "@gr4vy/sdk/core.js";
249
+ import { withToken } from "@gr4vy/sdk/lib/auth.js";
227
250
  import { paymentMethodsNetworkTokensSuspend } from "@gr4vy/sdk/funcs/paymentMethodsNetworkTokensSuspend.js";
228
251
 
229
252
  // Use `Gr4vyCore` for best tree-shaking performance.
230
253
  // You can create one instance of it to use across an application.
231
254
  const gr4vy = new Gr4vyCore({
232
- bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
255
+ server: "sandbox",
256
+ id: "example",
257
+ bearerAuth: withToken({
258
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
259
+ }),
233
260
  });
234
261
 
235
262
  async function run() {
@@ -294,7 +321,11 @@ Resume a suspended network token for a payment method.
294
321
  import { Gr4vy } from "@gr4vy/sdk";
295
322
 
296
323
  const gr4vy = new Gr4vy({
297
- bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
324
+ server: "sandbox",
325
+ id: "example",
326
+ bearerAuth: withToken({
327
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
328
+ }),
298
329
  });
299
330
 
300
331
  async function run() {
@@ -313,12 +344,17 @@ The standalone function version of this method:
313
344
 
314
345
  ```typescript
315
346
  import { Gr4vyCore } from "@gr4vy/sdk/core.js";
347
+ import { withToken } from "@gr4vy/sdk/lib/auth.js";
316
348
  import { paymentMethodsNetworkTokensResume } from "@gr4vy/sdk/funcs/paymentMethodsNetworkTokensResume.js";
317
349
 
318
350
  // Use `Gr4vyCore` for best tree-shaking performance.
319
351
  // You can create one instance of it to use across an application.
320
352
  const gr4vy = new Gr4vyCore({
321
- bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
353
+ server: "sandbox",
354
+ id: "example",
355
+ bearerAuth: withToken({
356
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
357
+ }),
322
358
  });
323
359
 
324
360
  async function run() {
@@ -383,7 +419,11 @@ Delete a network token for a payment method.
383
419
  import { Gr4vy } from "@gr4vy/sdk";
384
420
 
385
421
  const gr4vy = new Gr4vy({
386
- bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
422
+ server: "sandbox",
423
+ id: "example",
424
+ bearerAuth: withToken({
425
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
426
+ }),
387
427
  });
388
428
 
389
429
  async function run() {
@@ -401,12 +441,17 @@ The standalone function version of this method:
401
441
 
402
442
  ```typescript
403
443
  import { Gr4vyCore } from "@gr4vy/sdk/core.js";
444
+ import { withToken } from "@gr4vy/sdk/lib/auth.js";
404
445
  import { paymentMethodsNetworkTokensDelete } from "@gr4vy/sdk/funcs/paymentMethodsNetworkTokensDelete.js";
405
446
 
406
447
  // Use `Gr4vyCore` for best tree-shaking performance.
407
448
  // You can create one instance of it to use across an application.
408
449
  const gr4vy = new Gr4vyCore({
409
- bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
450
+ server: "sandbox",
451
+ id: "example",
452
+ bearerAuth: withToken({
453
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
454
+ }),
410
455
  });
411
456
 
412
457
  async function run() {