@gr4vy/sdk 0.18.15 → 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 @@ List all stored payment method.
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() {
@@ -46,12 +50,17 @@ The standalone function version of this method:
46
50
 
47
51
  ```typescript
48
52
  import { Gr4vyCore } from "@gr4vy/sdk/core.js";
53
+ import { withToken } from "@gr4vy/sdk/lib/auth.js";
49
54
  import { paymentMethodsList } from "@gr4vy/sdk/funcs/paymentMethodsList.js";
50
55
 
51
56
  // Use `Gr4vyCore` for best tree-shaking performance.
52
57
  // You can create one instance of it to use across an application.
53
58
  const gr4vy = new Gr4vyCore({
54
- bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
59
+ server: "sandbox",
60
+ id: "example",
61
+ bearerAuth: withToken({
62
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
63
+ }),
55
64
  });
56
65
 
57
66
  async function run() {
@@ -120,7 +129,11 @@ Store a new payment method.
120
129
  import { Gr4vy } from "@gr4vy/sdk";
121
130
 
122
131
  const gr4vy = new Gr4vy({
123
- bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
132
+ server: "sandbox",
133
+ id: "example",
134
+ bearerAuth: withToken({
135
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
136
+ }),
124
137
  });
125
138
 
126
139
  async function run() {
@@ -147,12 +160,17 @@ The standalone function version of this method:
147
160
 
148
161
  ```typescript
149
162
  import { Gr4vyCore } from "@gr4vy/sdk/core.js";
163
+ import { withToken } from "@gr4vy/sdk/lib/auth.js";
150
164
  import { paymentMethodsCreate } from "@gr4vy/sdk/funcs/paymentMethodsCreate.js";
151
165
 
152
166
  // Use `Gr4vyCore` for best tree-shaking performance.
153
167
  // You can create one instance of it to use across an application.
154
168
  const gr4vy = new Gr4vyCore({
155
- bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
169
+ server: "sandbox",
170
+ id: "example",
171
+ bearerAuth: withToken({
172
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
173
+ }),
156
174
  });
157
175
 
158
176
  async function run() {
@@ -224,7 +242,11 @@ Retrieve a payment method.
224
242
  import { Gr4vy } from "@gr4vy/sdk";
225
243
 
226
244
  const gr4vy = new Gr4vy({
227
- bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
245
+ server: "sandbox",
246
+ id: "example",
247
+ bearerAuth: withToken({
248
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
249
+ }),
228
250
  });
229
251
 
230
252
  async function run() {
@@ -243,12 +265,17 @@ The standalone function version of this method:
243
265
 
244
266
  ```typescript
245
267
  import { Gr4vyCore } from "@gr4vy/sdk/core.js";
268
+ import { withToken } from "@gr4vy/sdk/lib/auth.js";
246
269
  import { paymentMethodsGet } from "@gr4vy/sdk/funcs/paymentMethodsGet.js";
247
270
 
248
271
  // Use `Gr4vyCore` for best tree-shaking performance.
249
272
  // You can create one instance of it to use across an application.
250
273
  const gr4vy = new Gr4vyCore({
251
- bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
274
+ server: "sandbox",
275
+ id: "example",
276
+ bearerAuth: withToken({
277
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
278
+ }),
252
279
  });
253
280
 
254
281
  async function run() {
@@ -311,7 +338,11 @@ Delete a payment method.
311
338
  import { Gr4vy } from "@gr4vy/sdk";
312
339
 
313
340
  const gr4vy = new Gr4vy({
314
- bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
341
+ server: "sandbox",
342
+ id: "example",
343
+ bearerAuth: withToken({
344
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
345
+ }),
315
346
  });
316
347
 
317
348
  async function run() {
@@ -329,12 +360,17 @@ The standalone function version of this method:
329
360
 
330
361
  ```typescript
331
362
  import { Gr4vyCore } from "@gr4vy/sdk/core.js";
363
+ import { withToken } from "@gr4vy/sdk/lib/auth.js";
332
364
  import { paymentMethodsDelete } from "@gr4vy/sdk/funcs/paymentMethodsDelete.js";
333
365
 
334
366
  // Use `Gr4vyCore` for best tree-shaking performance.
335
367
  // You can create one instance of it to use across an application.
336
368
  const gr4vy = new Gr4vyCore({
337
- bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
369
+ server: "sandbox",
370
+ id: "example",
371
+ bearerAuth: withToken({
372
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
373
+ }),
338
374
  });
339
375
 
340
376
  async function run() {
@@ -17,7 +17,11 @@ List the payment options available at checkout. filtering by country, currency,
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() {
@@ -99,12 +103,17 @@ The standalone function version of this method:
99
103
 
100
104
  ```typescript
101
105
  import { Gr4vyCore } from "@gr4vy/sdk/core.js";
106
+ import { withToken } from "@gr4vy/sdk/lib/auth.js";
102
107
  import { paymentOptionsList } from "@gr4vy/sdk/funcs/paymentOptionsList.js";
103
108
 
104
109
  // Use `Gr4vyCore` for best tree-shaking performance.
105
110
  // You can create one instance of it to use across an application.
106
111
  const gr4vy = new Gr4vyCore({
107
- bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
112
+ server: "sandbox",
113
+ id: "example",
114
+ bearerAuth: withToken({
115
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
116
+ }),
108
117
  });
109
118
 
110
119
  async function run() {
@@ -19,7 +19,11 @@ List all gateway tokens stored for a payment method.
19
19
  import { Gr4vy } from "@gr4vy/sdk";
20
20
 
21
21
  const gr4vy = new Gr4vy({
22
- bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
22
+ server: "sandbox",
23
+ id: "example",
24
+ bearerAuth: withToken({
25
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
26
+ }),
23
27
  });
24
28
 
25
29
  async function run() {
@@ -38,12 +42,17 @@ The standalone function version of this method:
38
42
 
39
43
  ```typescript
40
44
  import { Gr4vyCore } from "@gr4vy/sdk/core.js";
45
+ import { withToken } from "@gr4vy/sdk/lib/auth.js";
41
46
  import { paymentMethodsPaymentServiceTokensList } from "@gr4vy/sdk/funcs/paymentMethodsPaymentServiceTokensList.js";
42
47
 
43
48
  // Use `Gr4vyCore` for best tree-shaking performance.
44
49
  // You can create one instance of it to use across an application.
45
50
  const gr4vy = new Gr4vyCore({
46
- bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
51
+ server: "sandbox",
52
+ id: "example",
53
+ bearerAuth: withToken({
54
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
55
+ }),
47
56
  });
48
57
 
49
58
  async function run() {
@@ -107,7 +116,11 @@ Create a gateway tokens for a payment method.
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() {
@@ -130,12 +143,17 @@ The standalone function version of this method:
130
143
 
131
144
  ```typescript
132
145
  import { Gr4vyCore } from "@gr4vy/sdk/core.js";
146
+ import { withToken } from "@gr4vy/sdk/lib/auth.js";
133
147
  import { paymentMethodsPaymentServiceTokensCreate } from "@gr4vy/sdk/funcs/paymentMethodsPaymentServiceTokensCreate.js";
134
148
 
135
149
  // Use `Gr4vyCore` for best tree-shaking performance.
136
150
  // You can create one instance of it to use across an application.
137
151
  const gr4vy = new Gr4vyCore({
138
- bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
152
+ server: "sandbox",
153
+ id: "example",
154
+ bearerAuth: withToken({
155
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
156
+ }),
139
157
  });
140
158
 
141
159
  async function run() {
@@ -204,7 +222,11 @@ Delete a gateway tokens for a payment method.
204
222
  import { Gr4vy } from "@gr4vy/sdk";
205
223
 
206
224
  const gr4vy = new Gr4vy({
207
- bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
225
+ server: "sandbox",
226
+ id: "example",
227
+ bearerAuth: withToken({
228
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
229
+ }),
208
230
  });
209
231
 
210
232
  async function run() {
@@ -222,12 +244,17 @@ The standalone function version of this method:
222
244
 
223
245
  ```typescript
224
246
  import { Gr4vyCore } from "@gr4vy/sdk/core.js";
247
+ import { withToken } from "@gr4vy/sdk/lib/auth.js";
225
248
  import { paymentMethodsPaymentServiceTokensDelete } from "@gr4vy/sdk/funcs/paymentMethodsPaymentServiceTokensDelete.js";
226
249
 
227
250
  // Use `Gr4vyCore` for best tree-shaking performance.
228
251
  // You can create one instance of it to use across an application.
229
252
  const gr4vy = new Gr4vyCore({
230
- bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
253
+ server: "sandbox",
254
+ id: "example",
255
+ bearerAuth: withToken({
256
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
257
+ }),
231
258
  });
232
259
 
233
260
  async function run() {
@@ -19,7 +19,11 @@ Returns a list of payouts made.
19
19
  import { Gr4vy } from "@gr4vy/sdk";
20
20
 
21
21
  const gr4vy = new Gr4vy({
22
- bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
22
+ server: "sandbox",
23
+ id: "example",
24
+ bearerAuth: withToken({
25
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
26
+ }),
23
27
  });
24
28
 
25
29
  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 { payoutsList } from "@gr4vy/sdk/funcs/payoutsList.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() {
@@ -111,7 +120,11 @@ Creates a new payout.
111
120
  import { Gr4vy } from "@gr4vy/sdk";
112
121
 
113
122
  const gr4vy = new Gr4vy({
114
- bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
123
+ server: "sandbox",
124
+ id: "example",
125
+ bearerAuth: withToken({
126
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
127
+ }),
115
128
  });
116
129
 
117
130
  async function run() {
@@ -208,12 +221,17 @@ The standalone function version of this method:
208
221
 
209
222
  ```typescript
210
223
  import { Gr4vyCore } from "@gr4vy/sdk/core.js";
224
+ import { withToken } from "@gr4vy/sdk/lib/auth.js";
211
225
  import { payoutsCreate } from "@gr4vy/sdk/funcs/payoutsCreate.js";
212
226
 
213
227
  // Use `Gr4vyCore` for best tree-shaking performance.
214
228
  // You can create one instance of it to use across an application.
215
229
  const gr4vy = new Gr4vyCore({
216
- bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
230
+ server: "sandbox",
231
+ id: "example",
232
+ bearerAuth: withToken({
233
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
234
+ }),
217
235
  });
218
236
 
219
237
  async function run() {
@@ -355,7 +373,11 @@ Retreives a payout.
355
373
  import { Gr4vy } from "@gr4vy/sdk";
356
374
 
357
375
  const gr4vy = new Gr4vy({
358
- bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
376
+ server: "sandbox",
377
+ id: "example",
378
+ bearerAuth: withToken({
379
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
380
+ }),
359
381
  });
360
382
 
361
383
  async function run() {
@@ -374,12 +396,17 @@ The standalone function version of this method:
374
396
 
375
397
  ```typescript
376
398
  import { Gr4vyCore } from "@gr4vy/sdk/core.js";
399
+ import { withToken } from "@gr4vy/sdk/lib/auth.js";
377
400
  import { payoutsGet } from "@gr4vy/sdk/funcs/payoutsGet.js";
378
401
 
379
402
  // Use `Gr4vyCore` for best tree-shaking performance.
380
403
  // You can create one instance of it to use across an application.
381
404
  const gr4vy = new Gr4vyCore({
382
- bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
405
+ server: "sandbox",
406
+ id: "example",
407
+ bearerAuth: withToken({
408
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
409
+ }),
383
410
  });
384
411
 
385
412
  async function run() {
@@ -17,7 +17,11 @@ Fetch a refund.
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 { refundsGet } from "@gr4vy/sdk/funcs/refundsGet.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() {
@@ -19,7 +19,11 @@ Create a session for use with Google Pay.
19
19
  import { Gr4vy } from "@gr4vy/sdk";
20
20
 
21
21
  const gr4vy = new Gr4vy({
22
- bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
22
+ server: "sandbox",
23
+ id: "example",
24
+ bearerAuth: withToken({
25
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
26
+ }),
23
27
  });
24
28
 
25
29
  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 { digitalWalletsSessionsGooglePay } from "@gr4vy/sdk/funcs/digitalWalletsSessionsGooglePay.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() {
@@ -110,7 +119,11 @@ Create a session for use with Apple Pay.
110
119
  import { Gr4vy } from "@gr4vy/sdk";
111
120
 
112
121
  const gr4vy = new Gr4vy({
113
- bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
122
+ server: "sandbox",
123
+ id: "example",
124
+ bearerAuth: withToken({
125
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
126
+ }),
114
127
  });
115
128
 
116
129
  async function run() {
@@ -132,12 +145,17 @@ The standalone function version of this method:
132
145
 
133
146
  ```typescript
134
147
  import { Gr4vyCore } from "@gr4vy/sdk/core.js";
148
+ import { withToken } from "@gr4vy/sdk/lib/auth.js";
135
149
  import { digitalWalletsSessionsApplePay } from "@gr4vy/sdk/funcs/digitalWalletsSessionsApplePay.js";
136
150
 
137
151
  // Use `Gr4vyCore` for best tree-shaking performance.
138
152
  // You can create one instance of it to use across an application.
139
153
  const gr4vy = new Gr4vyCore({
140
- bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
154
+ server: "sandbox",
155
+ id: "example",
156
+ bearerAuth: withToken({
157
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
158
+ }),
141
159
  });
142
160
 
143
161
  async function run() {
@@ -203,7 +221,11 @@ Create a session for use with Click to Pay.
203
221
  import { Gr4vy } from "@gr4vy/sdk";
204
222
 
205
223
  const gr4vy = new Gr4vy({
206
- bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
224
+ server: "sandbox",
225
+ id: "example",
226
+ bearerAuth: withToken({
227
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
228
+ }),
207
229
  });
208
230
 
209
231
  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 { digitalWalletsSessionsClickToPay } from "@gr4vy/sdk/funcs/digitalWalletsSessionsClickToPay.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() {
@@ -21,7 +21,11 @@ Associate shipping details to a buyer.
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() {
@@ -56,12 +60,17 @@ The standalone function version of this method:
56
60
 
57
61
  ```typescript
58
62
  import { Gr4vyCore } from "@gr4vy/sdk/core.js";
63
+ import { withToken } from "@gr4vy/sdk/lib/auth.js";
59
64
  import { buyersShippingDetailsCreate } from "@gr4vy/sdk/funcs/buyersShippingDetailsCreate.js";
60
65
 
61
66
  // Use `Gr4vyCore` for best tree-shaking performance.
62
67
  // You can create one instance of it to use across an application.
63
68
  const gr4vy = new Gr4vyCore({
64
- bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
69
+ server: "sandbox",
70
+ id: "example",
71
+ bearerAuth: withToken({
72
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
73
+ }),
65
74
  });
66
75
 
67
76
  async function run() {
@@ -142,7 +151,11 @@ List all the shipping details associated to a specific buyer.
142
151
  import { Gr4vy } from "@gr4vy/sdk";
143
152
 
144
153
  const gr4vy = new Gr4vy({
145
- bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
154
+ server: "sandbox",
155
+ id: "example",
156
+ bearerAuth: withToken({
157
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
158
+ }),
146
159
  });
147
160
 
148
161
  async function run() {
@@ -161,12 +174,17 @@ The standalone function version of this method:
161
174
 
162
175
  ```typescript
163
176
  import { Gr4vyCore } from "@gr4vy/sdk/core.js";
177
+ import { withToken } from "@gr4vy/sdk/lib/auth.js";
164
178
  import { buyersShippingDetailsList } from "@gr4vy/sdk/funcs/buyersShippingDetailsList.js";
165
179
 
166
180
  // Use `Gr4vyCore` for best tree-shaking performance.
167
181
  // You can create one instance of it to use across an application.
168
182
  const gr4vy = new Gr4vyCore({
169
- bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
183
+ server: "sandbox",
184
+ id: "example",
185
+ bearerAuth: withToken({
186
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
187
+ }),
170
188
  });
171
189
 
172
190
  async function run() {
@@ -229,7 +247,11 @@ Get a buyer's shipping details.
229
247
  import { Gr4vy } from "@gr4vy/sdk";
230
248
 
231
249
  const gr4vy = new Gr4vy({
232
- bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
250
+ server: "sandbox",
251
+ id: "example",
252
+ bearerAuth: withToken({
253
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
254
+ }),
233
255
  });
234
256
 
235
257
  async function run() {
@@ -248,12 +270,17 @@ The standalone function version of this method:
248
270
 
249
271
  ```typescript
250
272
  import { Gr4vyCore } from "@gr4vy/sdk/core.js";
273
+ import { withToken } from "@gr4vy/sdk/lib/auth.js";
251
274
  import { buyersShippingDetailsGet } from "@gr4vy/sdk/funcs/buyersShippingDetailsGet.js";
252
275
 
253
276
  // Use `Gr4vyCore` for best tree-shaking performance.
254
277
  // You can create one instance of it to use across an application.
255
278
  const gr4vy = new Gr4vyCore({
256
- bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
279
+ server: "sandbox",
280
+ id: "example",
281
+ bearerAuth: withToken({
282
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
283
+ }),
257
284
  });
258
285
 
259
286
  async function run() {
@@ -317,7 +344,11 @@ Update the shipping details associated to a specific buyer.
317
344
  import { Gr4vy } from "@gr4vy/sdk";
318
345
 
319
346
  const gr4vy = new Gr4vy({
320
- bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
347
+ server: "sandbox",
348
+ id: "example",
349
+ bearerAuth: withToken({
350
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
351
+ }),
321
352
  });
322
353
 
323
354
  async function run() {
@@ -356,12 +387,17 @@ The standalone function version of this method:
356
387
 
357
388
  ```typescript
358
389
  import { Gr4vyCore } from "@gr4vy/sdk/core.js";
390
+ import { withToken } from "@gr4vy/sdk/lib/auth.js";
359
391
  import { buyersShippingDetailsUpdate } from "@gr4vy/sdk/funcs/buyersShippingDetailsUpdate.js";
360
392
 
361
393
  // Use `Gr4vyCore` for best tree-shaking performance.
362
394
  // You can create one instance of it to use across an application.
363
395
  const gr4vy = new Gr4vyCore({
364
- bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
396
+ server: "sandbox",
397
+ id: "example",
398
+ bearerAuth: withToken({
399
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
400
+ }),
365
401
  });
366
402
 
367
403
  async function run() {
@@ -443,7 +479,11 @@ Delete the shipping details associated to a specific buyer.
443
479
  import { Gr4vy } from "@gr4vy/sdk";
444
480
 
445
481
  const gr4vy = new Gr4vy({
446
- bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
482
+ server: "sandbox",
483
+ id: "example",
484
+ bearerAuth: withToken({
485
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
486
+ }),
447
487
  });
448
488
 
449
489
  async function run() {
@@ -462,12 +502,17 @@ The standalone function version of this method:
462
502
 
463
503
  ```typescript
464
504
  import { Gr4vyCore } from "@gr4vy/sdk/core.js";
505
+ import { withToken } from "@gr4vy/sdk/lib/auth.js";
465
506
  import { buyersShippingDetailsDelete } from "@gr4vy/sdk/funcs/buyersShippingDetailsDelete.js";
466
507
 
467
508
  // Use `Gr4vyCore` for best tree-shaking performance.
468
509
  // You can create one instance of it to use across an application.
469
510
  const gr4vy = new Gr4vyCore({
470
- bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
511
+ server: "sandbox",
512
+ id: "example",
513
+ bearerAuth: withToken({
514
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
515
+ }),
471
516
  });
472
517
 
473
518
  async function run() {