@mopay/node-sdk 0.1.2 → 0.1.3

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 (2) hide show
  1. package/dist/base.js +6 -1
  2. package/package.json +1 -1
package/dist/base.js CHANGED
@@ -1,6 +1,8 @@
1
1
  import { MoPayAPIError } from "./errors.js";
2
2
  const DEFAULT_BASE_URL = "https://mopay.co.ls";
3
3
  const DEFAULT_TIMEOUT_MS = 30000;
4
+ const SDK_NAME = "@mopay/node-sdk";
5
+ const SDK_VERSION = "0.1.3";
4
6
  export class Base {
5
7
  apiKey;
6
8
  baseUrl;
@@ -16,7 +18,7 @@ export class Base {
16
18
  this.baseUrl = normalizeBaseUrl(config.baseUrl || DEFAULT_BASE_URL);
17
19
  this.timeoutMs = config.timeoutMs ?? DEFAULT_TIMEOUT_MS;
18
20
  this.fetchImpl = config.fetch || getNativeFetch();
19
- this.userAgent = config.userAgent || "@mopay/node-sdk/0.1.1";
21
+ this.userAgent = config.userAgent || `${SDK_NAME}/${SDK_VERSION}`;
20
22
  this.checkoutOptions = config.checkout || {};
21
23
  }
22
24
  getDefaultCheckoutOptions() {
@@ -39,6 +41,9 @@ export class Base {
39
41
  Authorization: `Bearer ${this.apiKey}`,
40
42
  "Content-Type": "application/json",
41
43
  "User-Agent": this.userAgent,
44
+ "X-MoPay-SDK": SDK_NAME,
45
+ "X-MoPay-SDK-Version": SDK_VERSION,
46
+ "X-MoPay-SDK-Language": "typescript",
42
47
  ...options.headers,
43
48
  },
44
49
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mopay/node-sdk",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "Official TypeScript SDK for the MoPay payment API.",
5
5
  "type": "module",
6
6
  "source": "src/index.ts",