@moonpay/platform-sdk-node 1.6.0 → 1.7.0

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.
package/README.md CHANGED
@@ -37,6 +37,7 @@ All methods return a `Result<T, E>` discriminated union instead of throwing —
37
37
 
38
38
  - **`createSession()`** — issue a session token for a customer. `email` and `phoneNumber` must be passed together when provided.
39
39
  - **`revokeSession()`** — revoke a previously issued session token.
40
+ - **`exportCustomer()`** — exchange a one-time consent token (captured client-side via `setupCustomerExport()` in the web/RN SDK) for the customer's verified MoonPay identity.
40
41
 
41
42
  ## Related packages
42
43
 
package/dist/index.cjs CHANGED
@@ -18,11 +18,11 @@ var __copyProps = (to, from, except, desc) => {
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
19
 
20
20
  // src/index.ts
21
- var src_exports = {};
22
- __export(src_exports, {
21
+ var index_exports = {};
22
+ __export(index_exports, {
23
23
  createServerClient: () => createServerClient
24
24
  });
25
- module.exports = __toCommonJS(src_exports);
25
+ module.exports = __toCommonJS(index_exports);
26
26
 
27
27
  // src/create-session.ts
28
28
  var import_result = require("@moonpay/platform-protocol/result");
@@ -54,8 +54,29 @@ async function createSession(apiKey, params, baseUrl) {
54
54
  return (0, import_result.ok)(data);
55
55
  }
56
56
 
57
- // src/revoke-session.ts
57
+ // src/export-customer.ts
58
58
  var import_result2 = require("@moonpay/platform-protocol/result");
59
+ async function exportCustomer(apiKey, params, baseUrl) {
60
+ const response = await fetch(`${baseUrl}/platform/v1/customers/export`, {
61
+ method: "POST",
62
+ headers: {
63
+ "X-Api-Key": apiKey,
64
+ Authorization: `Bearer ${params.consentToken}`
65
+ }
66
+ });
67
+ const data = await response.json();
68
+ if (!response.ok) {
69
+ return (0, import_result2.err)({
70
+ code: data.code ?? "unknown_error",
71
+ message: data.message ?? "Failed to export customer",
72
+ errors: data.errors
73
+ });
74
+ }
75
+ return (0, import_result2.ok)(data);
76
+ }
77
+
78
+ // src/revoke-session.ts
79
+ var import_result3 = require("@moonpay/platform-protocol/result");
59
80
  async function revokeSession(apiKey, params, baseUrl) {
60
81
  const url = new URL("/platform/v1/sessions", baseUrl);
61
82
  url.searchParams.set("externalCustomerId", params.externalCustomerId);
@@ -67,13 +88,13 @@ async function revokeSession(apiKey, params, baseUrl) {
67
88
  });
68
89
  if (!response.ok) {
69
90
  const data = await response.json().catch(() => ({}));
70
- return (0, import_result2.err)({
91
+ return (0, import_result3.err)({
71
92
  code: data.code ?? "unknown_error",
72
93
  message: data.message ?? "Failed to revoke session",
73
94
  errors: data.errors
74
95
  });
75
96
  }
76
- return (0, import_result2.ok)(void 0);
97
+ return (0, import_result3.ok)(void 0);
77
98
  }
78
99
 
79
100
  // src/server-client.ts
@@ -81,7 +102,8 @@ function createServerClient(options) {
81
102
  const { apiKey, baseUrl = "https://api.moonpay.com" } = options;
82
103
  return {
83
104
  createSession: (params) => createSession(apiKey, params, baseUrl),
84
- revokeSession: (params) => revokeSession(apiKey, params, baseUrl)
105
+ revokeSession: (params) => revokeSession(apiKey, params, baseUrl),
106
+ exportCustomer: (params) => exportCustomer(apiKey, params, baseUrl)
85
107
  };
86
108
  }
87
109
  // Annotate the CommonJS export names for ESM import in node:
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts","../src/create-session.ts","../src/revoke-session.ts","../src/server-client.ts"],"sourcesContent":["// Re-export key types\nexport type { CreateSessionTokenReturnType } from '@moonpay/platform-protocol/api';\nexport type {\n CreateSessionError,\n RevokeSessionError,\n} from '@moonpay/platform-protocol/api/errors';\nexport type { EmptyResult, Result } from '@moonpay/platform-protocol/result';\n\nexport type { CreateSessionParams } from './create-session.js';\nexport type { RevokeSessionParams } from './revoke-session.js';\nexport {\n type CreateServerClientOptions,\n createServerClient,\n type ServerClient,\n} from './server-client.js';\n","import type {\n CreateSessionTokenRequestBody,\n CreateSessionTokenReturnType,\n} from '@moonpay/platform-protocol/api';\nimport type { CreateSessionError } from '@moonpay/platform-protocol/api/errors';\nimport type { Result } from '@moonpay/platform-protocol/result';\nimport { err, ok } from '@moonpay/platform-protocol/result';\n\nexport interface CreateSessionParams {\n /** Unique customer identifier from your system. Optional — omit for anonymous sessions. */\n externalCustomerId?: string;\n /** The customer's device IP address (IPv4 or IPv6). */\n deviceIp: string;\n /**\n * The customer's email address.\n * If provided, `phoneNumber` must also be provided.\n */\n email?: string;\n /**\n * The customer's phone number in E.164 format.\n * If provided, `email` must also be provided.\n */\n phoneNumber?: string;\n}\n\nexport async function createSession(\n apiKey: string,\n params: CreateSessionParams,\n baseUrl: string,\n): Promise<Result<CreateSessionTokenReturnType, CreateSessionError>> {\n const body: CreateSessionTokenRequestBody = {\n deviceIp: params.deviceIp,\n ...(params.externalCustomerId !== undefined && {\n externalCustomerId: params.externalCustomerId,\n }),\n ...(params.email !== undefined && { email: params.email }),\n ...(params.phoneNumber !== undefined && { phoneNumber: params.phoneNumber }),\n };\n\n const response = await fetch(`${baseUrl}/platform/v1/sessions`, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n 'X-Api-Key': apiKey,\n },\n body: JSON.stringify(body),\n });\n\n const data = await response.json();\n\n if (!response.ok) {\n return err({\n code: data.code ?? 'unknown_error',\n message: data.message ?? 'Failed to create session',\n errors: data.errors,\n });\n }\n\n return ok(data as CreateSessionTokenReturnType);\n}\n","import type { RevokeSessionError } from '@moonpay/platform-protocol/api/errors';\nimport type { EmptyResult } from '@moonpay/platform-protocol/result';\nimport { err, ok } from '@moonpay/platform-protocol/result';\n\nexport interface RevokeSessionParams {\n /** The external customer identifier whose sessions should be revoked. */\n externalCustomerId: string;\n}\n\nexport async function revokeSession(\n apiKey: string,\n params: RevokeSessionParams,\n baseUrl: string,\n): Promise<EmptyResult<RevokeSessionError>> {\n const url = new URL('/platform/v1/sessions', baseUrl);\n url.searchParams.set('externalCustomerId', params.externalCustomerId);\n\n const response = await fetch(url, {\n method: 'DELETE',\n headers: {\n 'X-Api-Key': apiKey,\n },\n });\n\n if (!response.ok) {\n const data = await response.json().catch(() => ({}));\n return err({\n code: data.code ?? 'unknown_error',\n message: data.message ?? 'Failed to revoke session',\n errors: data.errors,\n });\n }\n\n return ok(undefined as never);\n}\n","import type { CreateSessionTokenReturnType } from '@moonpay/platform-protocol/api';\nimport type { CreateSessionError, RevokeSessionError } from '@moonpay/platform-protocol/api/errors';\nimport type { EmptyResult, Result } from '@moonpay/platform-protocol/result';\nimport { type CreateSessionParams, createSession } from './create-session.js';\nimport { type RevokeSessionParams, revokeSession } from './revoke-session.js';\n\nexport interface CreateServerClientOptions {\n /** Your MoonPay secret API key. Never expose this client-side. */\n apiKey: string;\n /** Override the API base URL. Defaults to production. */\n baseUrl?: string;\n}\n\nexport interface ServerClient {\n /** Create a session token for a customer. */\n createSession(\n params: CreateSessionParams,\n ): Promise<Result<CreateSessionTokenReturnType, CreateSessionError>>;\n /** Revoke all sessions for a customer (by external customer ID). */\n revokeSession(params: RevokeSessionParams): Promise<EmptyResult<RevokeSessionError>>;\n}\n\n/**\n * Creates a server-side MoonPay client for session management.\n *\n * This client uses your secret API key and must only be used in\n * server-side environments (Node.js, edge functions, etc.).\n */\nexport function createServerClient(options: CreateServerClientOptions): ServerClient {\n const { apiKey, baseUrl = 'https://api.moonpay.com' } = options;\n\n return {\n createSession: (params) => createSession(apiKey, params, baseUrl),\n revokeSession: (params) => revokeSession(apiKey, params, baseUrl),\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACMA,oBAAwB;AAmBxB,eAAsB,cACpB,QACA,QACA,SACmE;AACnE,QAAM,OAAsC;AAAA,IAC1C,UAAU,OAAO;AAAA,IACjB,GAAI,OAAO,uBAAuB,UAAa;AAAA,MAC7C,oBAAoB,OAAO;AAAA,IAC7B;AAAA,IACA,GAAI,OAAO,UAAU,UAAa,EAAE,OAAO,OAAO,MAAM;AAAA,IACxD,GAAI,OAAO,gBAAgB,UAAa,EAAE,aAAa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/index.ts","../src/create-session.ts","../src/export-customer.ts","../src/revoke-session.ts","../src/server-client.ts"],"sourcesContent":["// Re-export key types\nexport type { CreateSessionTokenReturnType } from '@moonpay/platform-protocol/api';\nexport type { CustomerExportIdentity } from '@moonpay/platform-protocol/api/customer';\nexport type {\n CreateSessionError,\n ExportCustomerError,\n RevokeSessionError,\n} from '@moonpay/platform-protocol/api/errors';\nexport type { EmptyResult, Result } from '@moonpay/platform-protocol/result';\n\nexport type { CreateSessionParams } from './create-session.js';\nexport type { ExportCustomerParams } from './export-customer.js';\nexport type { RevokeSessionParams } from './revoke-session.js';\nexport {\n type CreateServerClientOptions,\n createServerClient,\n type ServerClient,\n} from './server-client.js';\n","import type {\n CreateSessionTokenRequestBody,\n CreateSessionTokenReturnType,\n} from '@moonpay/platform-protocol/api';\nimport type { CreateSessionError } from '@moonpay/platform-protocol/api/errors';\nimport type { Result } from '@moonpay/platform-protocol/result';\nimport { err, ok } from '@moonpay/platform-protocol/result';\n\nexport interface CreateSessionParams {\n /** Unique customer identifier from your system. Optional — omit for anonymous sessions. */\n externalCustomerId?: string;\n /** The customer's device IP address (IPv4 or IPv6). */\n deviceIp: string;\n /**\n * The customer's email address.\n * If provided, `phoneNumber` must also be provided.\n */\n email?: string;\n /**\n * The customer's phone number in E.164 format.\n * If provided, `email` must also be provided.\n */\n phoneNumber?: string;\n}\n\nexport async function createSession(\n apiKey: string,\n params: CreateSessionParams,\n baseUrl: string,\n): Promise<Result<CreateSessionTokenReturnType, CreateSessionError>> {\n const body: CreateSessionTokenRequestBody = {\n deviceIp: params.deviceIp,\n ...(params.externalCustomerId !== undefined && {\n externalCustomerId: params.externalCustomerId,\n }),\n ...(params.email !== undefined && { email: params.email }),\n ...(params.phoneNumber !== undefined && { phoneNumber: params.phoneNumber }),\n };\n\n const response = await fetch(`${baseUrl}/platform/v1/sessions`, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n 'X-Api-Key': apiKey,\n },\n body: JSON.stringify(body),\n });\n\n const data = await response.json();\n\n if (!response.ok) {\n return err({\n code: data.code ?? 'unknown_error',\n message: data.message ?? 'Failed to create session',\n errors: data.errors,\n });\n }\n\n return ok(data as CreateSessionTokenReturnType);\n}\n","import type { CustomerExportIdentity } from '@moonpay/platform-protocol/api/customer';\nimport type { ExportCustomerError } from '@moonpay/platform-protocol/api/errors';\nimport type { Result } from '@moonpay/platform-protocol/result';\nimport { err, ok } from '@moonpay/platform-protocol/result';\n\nexport interface ExportCustomerParams {\n /**\n * One-time consent token from the customer-export frame's `complete`\n * event (web/RN SDK). Valid for 5 minutes.\n */\n consentToken: string;\n}\n\nexport async function exportCustomer(\n apiKey: string,\n params: ExportCustomerParams,\n baseUrl: string,\n): Promise<Result<{ data: CustomerExportIdentity }, ExportCustomerError>> {\n const response = await fetch(`${baseUrl}/platform/v1/customers/export`, {\n method: 'POST',\n headers: {\n 'X-Api-Key': apiKey,\n Authorization: `Bearer ${params.consentToken}`,\n },\n });\n\n const data = await response.json();\n\n if (!response.ok) {\n return err({\n code: data.code ?? 'unknown_error',\n message: data.message ?? 'Failed to export customer',\n errors: data.errors,\n });\n }\n\n return ok(data as { data: CustomerExportIdentity });\n}\n","import type { RevokeSessionError } from '@moonpay/platform-protocol/api/errors';\nimport type { EmptyResult } from '@moonpay/platform-protocol/result';\nimport { err, ok } from '@moonpay/platform-protocol/result';\n\nexport interface RevokeSessionParams {\n /** The external customer identifier whose sessions should be revoked. */\n externalCustomerId: string;\n}\n\nexport async function revokeSession(\n apiKey: string,\n params: RevokeSessionParams,\n baseUrl: string,\n): Promise<EmptyResult<RevokeSessionError>> {\n const url = new URL('/platform/v1/sessions', baseUrl);\n url.searchParams.set('externalCustomerId', params.externalCustomerId);\n\n const response = await fetch(url, {\n method: 'DELETE',\n headers: {\n 'X-Api-Key': apiKey,\n },\n });\n\n if (!response.ok) {\n const data = await response.json().catch(() => ({}));\n return err({\n code: data.code ?? 'unknown_error',\n message: data.message ?? 'Failed to revoke session',\n errors: data.errors,\n });\n }\n\n return ok(undefined as never);\n}\n","import type { CreateSessionTokenReturnType } from '@moonpay/platform-protocol/api';\nimport type { CustomerExportIdentity } from '@moonpay/platform-protocol/api/customer';\nimport type {\n CreateSessionError,\n ExportCustomerError,\n RevokeSessionError,\n} from '@moonpay/platform-protocol/api/errors';\nimport type { EmptyResult, Result } from '@moonpay/platform-protocol/result';\nimport { type CreateSessionParams, createSession } from './create-session.js';\nimport { type ExportCustomerParams, exportCustomer } from './export-customer.js';\nimport { type RevokeSessionParams, revokeSession } from './revoke-session.js';\n\nexport interface CreateServerClientOptions {\n /** Your MoonPay secret API key. Never expose this client-side. */\n apiKey: string;\n /** Override the API base URL. Defaults to production. */\n baseUrl?: string;\n}\n\nexport interface ServerClient {\n /** Create a session token for a customer. */\n createSession(\n params: CreateSessionParams,\n ): Promise<Result<CreateSessionTokenReturnType, CreateSessionError>>;\n /** Revoke all sessions for a customer (by external customer ID). */\n revokeSession(params: RevokeSessionParams): Promise<EmptyResult<RevokeSessionError>>;\n /**\n * Exchange a one-time consent token (from the customer-export frame's\n * `complete` event, web/RN SDK) for the customer's verified MoonPay\n * identity. Call within the token's validity window.\n */\n exportCustomer(\n params: ExportCustomerParams,\n ): Promise<Result<{ data: CustomerExportIdentity }, ExportCustomerError>>;\n}\n\n/**\n * Creates a server-side MoonPay client for session management.\n *\n * This client uses your secret API key and must only be used in\n * server-side environments (Node.js, edge functions, etc.).\n */\nexport function createServerClient(options: CreateServerClientOptions): ServerClient {\n const { apiKey, baseUrl = 'https://api.moonpay.com' } = options;\n\n return {\n createSession: (params) => createSession(apiKey, params, baseUrl),\n revokeSession: (params) => revokeSession(apiKey, params, baseUrl),\n exportCustomer: (params) => exportCustomer(apiKey, params, baseUrl),\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACMA,oBAAwB;AAmBxB,eAAsB,cACpB,QACA,QACA,SACmE;AACnE,QAAM,OAAsC;AAAA,IAC1C,UA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IAAI,sBAAsB,OAAO,kBAAkB;AAEpE,QAAM,WAAW,MAAM,MAAM,KAAK;AAAA,IAChC,QAAQ;AAAA,IACR,SAAS;AAAA,MACP,aAAa;AAAA,IACf;AAAA,EACF,CAAC;AAED,MAAI,CAAC,SAAS,IAAI;AAChB,UAAM,OAAO,MAAM,SAAS,KAAK,EAAE,MAAM,OAAO,CAAC,EAAE;AACnD,eAAO,oBAAI;AAAA,MACT,MAAM,KAAK,QAAQ;AAAA,MACnB,SAAS,KAAK,WAAW;AAAA,MACzB,QAAQ,KAAK;AAAA,IACf,CAAC;AAAA,EACH;AAEA,aAAO,mBAAG,MAAkB;AAC9B;;;ACQO,SAAS,mBAAmB,SAAkD;AACnF,QAAM,EAAE,QAAQ,UAAU,0BAA0B,IAAI;AAExD,SAAO;AAAA,IACL,eAAe,CAAC,WAAW,cAAc,QAAQ,QAAQ,OAAO;AAAA,IAChE,eAAe,CAAC,WAAW,cAAc,QAAQ,QAAQ,OAAO;AAAA,IAChE,gBAAgB,CAAC,WAAW,eAAe,QAAQ,QAAQ,OAAO;AAAA,EACpE;AACF;","names":["import_result","import_result"]}
package/dist/index.d.cts CHANGED
@@ -1,7 +1,9 @@
1
1
  import { CreateSessionTokenReturnType } from '@moonpay/platform-protocol/api';
2
2
  export { CreateSessionTokenReturnType } from '@moonpay/platform-protocol/api';
3
- import { CreateSessionError, RevokeSessionError } from '@moonpay/platform-protocol/api/errors';
4
- export { CreateSessionError, RevokeSessionError } from '@moonpay/platform-protocol/api/errors';
3
+ import { CustomerExportIdentity } from '@moonpay/platform-protocol/api/customer';
4
+ export { CustomerExportIdentity } from '@moonpay/platform-protocol/api/customer';
5
+ import { CreateSessionError, RevokeSessionError, ExportCustomerError } from '@moonpay/platform-protocol/api/errors';
6
+ export { CreateSessionError, ExportCustomerError, RevokeSessionError } from '@moonpay/platform-protocol/api/errors';
5
7
  import { Result, EmptyResult } from '@moonpay/platform-protocol/result';
6
8
  export { EmptyResult, Result } from '@moonpay/platform-protocol/result';
7
9
 
@@ -22,6 +24,14 @@ interface CreateSessionParams {
22
24
  phoneNumber?: string;
23
25
  }
24
26
 
27
+ interface ExportCustomerParams {
28
+ /**
29
+ * One-time consent token from the customer-export frame's `complete`
30
+ * event (web/RN SDK). Valid for 5 minutes.
31
+ */
32
+ consentToken: string;
33
+ }
34
+
25
35
  interface RevokeSessionParams {
26
36
  /** The external customer identifier whose sessions should be revoked. */
27
37
  externalCustomerId: string;
@@ -38,6 +48,14 @@ interface ServerClient {
38
48
  createSession(params: CreateSessionParams): Promise<Result<CreateSessionTokenReturnType, CreateSessionError>>;
39
49
  /** Revoke all sessions for a customer (by external customer ID). */
40
50
  revokeSession(params: RevokeSessionParams): Promise<EmptyResult<RevokeSessionError>>;
51
+ /**
52
+ * Exchange a one-time consent token (from the customer-export frame's
53
+ * `complete` event, web/RN SDK) for the customer's verified MoonPay
54
+ * identity. Call within the token's validity window.
55
+ */
56
+ exportCustomer(params: ExportCustomerParams): Promise<Result<{
57
+ data: CustomerExportIdentity;
58
+ }, ExportCustomerError>>;
41
59
  }
42
60
  /**
43
61
  * Creates a server-side MoonPay client for session management.
@@ -47,4 +65,4 @@ interface ServerClient {
47
65
  */
48
66
  declare function createServerClient(options: CreateServerClientOptions): ServerClient;
49
67
 
50
- export { type CreateServerClientOptions, type CreateSessionParams, type RevokeSessionParams, type ServerClient, createServerClient };
68
+ export { type CreateServerClientOptions, type CreateSessionParams, type ExportCustomerParams, type RevokeSessionParams, type ServerClient, createServerClient };
package/dist/index.d.ts CHANGED
@@ -1,7 +1,9 @@
1
1
  import { CreateSessionTokenReturnType } from '@moonpay/platform-protocol/api';
2
2
  export { CreateSessionTokenReturnType } from '@moonpay/platform-protocol/api';
3
- import { CreateSessionError, RevokeSessionError } from '@moonpay/platform-protocol/api/errors';
4
- export { CreateSessionError, RevokeSessionError } from '@moonpay/platform-protocol/api/errors';
3
+ import { CustomerExportIdentity } from '@moonpay/platform-protocol/api/customer';
4
+ export { CustomerExportIdentity } from '@moonpay/platform-protocol/api/customer';
5
+ import { CreateSessionError, RevokeSessionError, ExportCustomerError } from '@moonpay/platform-protocol/api/errors';
6
+ export { CreateSessionError, ExportCustomerError, RevokeSessionError } from '@moonpay/platform-protocol/api/errors';
5
7
  import { Result, EmptyResult } from '@moonpay/platform-protocol/result';
6
8
  export { EmptyResult, Result } from '@moonpay/platform-protocol/result';
7
9
 
@@ -22,6 +24,14 @@ interface CreateSessionParams {
22
24
  phoneNumber?: string;
23
25
  }
24
26
 
27
+ interface ExportCustomerParams {
28
+ /**
29
+ * One-time consent token from the customer-export frame's `complete`
30
+ * event (web/RN SDK). Valid for 5 minutes.
31
+ */
32
+ consentToken: string;
33
+ }
34
+
25
35
  interface RevokeSessionParams {
26
36
  /** The external customer identifier whose sessions should be revoked. */
27
37
  externalCustomerId: string;
@@ -38,6 +48,14 @@ interface ServerClient {
38
48
  createSession(params: CreateSessionParams): Promise<Result<CreateSessionTokenReturnType, CreateSessionError>>;
39
49
  /** Revoke all sessions for a customer (by external customer ID). */
40
50
  revokeSession(params: RevokeSessionParams): Promise<EmptyResult<RevokeSessionError>>;
51
+ /**
52
+ * Exchange a one-time consent token (from the customer-export frame's
53
+ * `complete` event, web/RN SDK) for the customer's verified MoonPay
54
+ * identity. Call within the token's validity window.
55
+ */
56
+ exportCustomer(params: ExportCustomerParams): Promise<Result<{
57
+ data: CustomerExportIdentity;
58
+ }, ExportCustomerError>>;
41
59
  }
42
60
  /**
43
61
  * Creates a server-side MoonPay client for session management.
@@ -47,4 +65,4 @@ interface ServerClient {
47
65
  */
48
66
  declare function createServerClient(options: CreateServerClientOptions): ServerClient;
49
67
 
50
- export { type CreateServerClientOptions, type CreateSessionParams, type RevokeSessionParams, type ServerClient, createServerClient };
68
+ export { type CreateServerClientOptions, type CreateSessionParams, type ExportCustomerParams, type RevokeSessionParams, type ServerClient, createServerClient };
package/dist/index.js CHANGED
@@ -28,8 +28,29 @@ async function createSession(apiKey, params, baseUrl) {
28
28
  return ok(data);
29
29
  }
30
30
 
31
- // src/revoke-session.ts
31
+ // src/export-customer.ts
32
32
  import { err as err2, ok as ok2 } from "@moonpay/platform-protocol/result";
33
+ async function exportCustomer(apiKey, params, baseUrl) {
34
+ const response = await fetch(`${baseUrl}/platform/v1/customers/export`, {
35
+ method: "POST",
36
+ headers: {
37
+ "X-Api-Key": apiKey,
38
+ Authorization: `Bearer ${params.consentToken}`
39
+ }
40
+ });
41
+ const data = await response.json();
42
+ if (!response.ok) {
43
+ return err2({
44
+ code: data.code ?? "unknown_error",
45
+ message: data.message ?? "Failed to export customer",
46
+ errors: data.errors
47
+ });
48
+ }
49
+ return ok2(data);
50
+ }
51
+
52
+ // src/revoke-session.ts
53
+ import { err as err3, ok as ok3 } from "@moonpay/platform-protocol/result";
33
54
  async function revokeSession(apiKey, params, baseUrl) {
34
55
  const url = new URL("/platform/v1/sessions", baseUrl);
35
56
  url.searchParams.set("externalCustomerId", params.externalCustomerId);
@@ -41,13 +62,13 @@ async function revokeSession(apiKey, params, baseUrl) {
41
62
  });
42
63
  if (!response.ok) {
43
64
  const data = await response.json().catch(() => ({}));
44
- return err2({
65
+ return err3({
45
66
  code: data.code ?? "unknown_error",
46
67
  message: data.message ?? "Failed to revoke session",
47
68
  errors: data.errors
48
69
  });
49
70
  }
50
- return ok2(void 0);
71
+ return ok3(void 0);
51
72
  }
52
73
 
53
74
  // src/server-client.ts
@@ -55,7 +76,8 @@ function createServerClient(options) {
55
76
  const { apiKey, baseUrl = "https://api.moonpay.com" } = options;
56
77
  return {
57
78
  createSession: (params) => createSession(apiKey, params, baseUrl),
58
- revokeSession: (params) => revokeSession(apiKey, params, baseUrl)
79
+ revokeSession: (params) => revokeSession(apiKey, params, baseUrl),
80
+ exportCustomer: (params) => exportCustomer(apiKey, params, baseUrl)
59
81
  };
60
82
  }
61
83
  export {
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/create-session.ts","../src/revoke-session.ts","../src/server-client.ts"],"sourcesContent":["import type {\n CreateSessionTokenRequestBody,\n CreateSessionTokenReturnType,\n} from '@moonpay/platform-protocol/api';\nimport type { CreateSessionError } from '@moonpay/platform-protocol/api/errors';\nimport type { Result } from '@moonpay/platform-protocol/result';\nimport { err, ok } from '@moonpay/platform-protocol/result';\n\nexport interface CreateSessionParams {\n /** Unique customer identifier from your system. Optional — omit for anonymous sessions. */\n externalCustomerId?: string;\n /** The customer's device IP address (IPv4 or IPv6). */\n deviceIp: string;\n /**\n * The customer's email address.\n * If provided, `phoneNumber` must also be provided.\n */\n email?: string;\n /**\n * The customer's phone number in E.164 format.\n * If provided, `email` must also be provided.\n */\n phoneNumber?: string;\n}\n\nexport async function createSession(\n apiKey: string,\n params: CreateSessionParams,\n baseUrl: string,\n): Promise<Result<CreateSessionTokenReturnType, CreateSessionError>> {\n const body: CreateSessionTokenRequestBody = {\n deviceIp: params.deviceIp,\n ...(params.externalCustomerId !== undefined && {\n externalCustomerId: params.externalCustomerId,\n }),\n ...(params.email !== undefined && { email: params.email }),\n ...(params.phoneNumber !== undefined && { phoneNumber: params.phoneNumber }),\n };\n\n const response = await fetch(`${baseUrl}/platform/v1/sessions`, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n 'X-Api-Key': apiKey,\n },\n body: JSON.stringify(body),\n });\n\n const data = await response.json();\n\n if (!response.ok) {\n return err({\n code: data.code ?? 'unknown_error',\n message: data.message ?? 'Failed to create session',\n errors: data.errors,\n });\n }\n\n return ok(data as CreateSessionTokenReturnType);\n}\n","import type { RevokeSessionError } from '@moonpay/platform-protocol/api/errors';\nimport type { EmptyResult } from '@moonpay/platform-protocol/result';\nimport { err, ok } from '@moonpay/platform-protocol/result';\n\nexport interface RevokeSessionParams {\n /** The external customer identifier whose sessions should be revoked. */\n externalCustomerId: string;\n}\n\nexport async function revokeSession(\n apiKey: string,\n params: RevokeSessionParams,\n baseUrl: string,\n): Promise<EmptyResult<RevokeSessionError>> {\n const url = new URL('/platform/v1/sessions', baseUrl);\n url.searchParams.set('externalCustomerId', params.externalCustomerId);\n\n const response = await fetch(url, {\n method: 'DELETE',\n headers: {\n 'X-Api-Key': apiKey,\n },\n });\n\n if (!response.ok) {\n const data = await response.json().catch(() => ({}));\n return err({\n code: data.code ?? 'unknown_error',\n message: data.message ?? 'Failed to revoke session',\n errors: data.errors,\n });\n }\n\n return ok(undefined as never);\n}\n","import type { CreateSessionTokenReturnType } from '@moonpay/platform-protocol/api';\nimport type { CreateSessionError, RevokeSessionError } from '@moonpay/platform-protocol/api/errors';\nimport type { EmptyResult, Result } from '@moonpay/platform-protocol/result';\nimport { type CreateSessionParams, createSession } from './create-session.js';\nimport { type RevokeSessionParams, revokeSession } from './revoke-session.js';\n\nexport interface CreateServerClientOptions {\n /** Your MoonPay secret API key. Never expose this client-side. */\n apiKey: string;\n /** Override the API base URL. Defaults to production. */\n baseUrl?: string;\n}\n\nexport interface ServerClient {\n /** Create a session token for a customer. */\n createSession(\n params: CreateSessionParams,\n ): Promise<Result<CreateSessionTokenReturnType, CreateSessionError>>;\n /** Revoke all sessions for a customer (by external customer ID). */\n revokeSession(params: RevokeSessionParams): Promise<EmptyResult<RevokeSessionError>>;\n}\n\n/**\n * Creates a server-side MoonPay client for session management.\n *\n * This client uses your secret API key and must only be used in\n * server-side environments (Node.js, edge functions, etc.).\n */\nexport function createServerClient(options: CreateServerClientOptions): ServerClient {\n const { apiKey, baseUrl = 'https://api.moonpay.com' } = options;\n\n return {\n createSession: (params) => createSession(apiKey, params, baseUrl),\n revokeSession: (params) => revokeSession(apiKey, params, baseUrl),\n };\n}\n"],"mappings":";AAMA,SAAS,KAAK,UAAU;AAmBxB,eAAsB,cACpB,QACA,QACA,SACmE;AACnE,QAAM,OAAsC;AAAA,IAC1C,UAAU,OAAO;AAAA,IACjB,GAAI,OAAO,uBAAuB,UAAa;AAAA,MAC7C,oBAAoB,OAAO;AAAA,IAC7B;AAAA,IACA,GAAI,OAAO,UAAU,UAAa,EAAE,OAAO,OAAO,MAAM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,QAAQ,OAAO;AAAA,EAClE;AACF;","names":["err","ok"]}
1
+ {"version":3,"sources":["../src/create-session.ts","../src/export-customer.ts","../src/revoke-session.ts","../src/server-client.ts"],"sourcesContent":["import type {\n CreateSessionTokenRequestBody,\n CreateSessionTokenReturnType,\n} from '@moonpay/platform-protocol/api';\nimport type { CreateSessionError } from '@moonpay/platform-protocol/api/errors';\nimport type { Result } from '@moonpay/platform-protocol/result';\nimport { err, ok } from '@moonpay/platform-protocol/result';\n\nexport interface CreateSessionParams {\n /** Unique customer identifier from your system. Optional — omit for anonymous sessions. */\n externalCustomerId?: string;\n /** The customer's device IP address (IPv4 or IPv6). */\n deviceIp: string;\n /**\n * The customer's email address.\n * If provided, `phoneNumber` must also be provided.\n */\n email?: string;\n /**\n * The customer's phone number in E.164 format.\n * If provided, `email` must also be provided.\n */\n phoneNumber?: string;\n}\n\nexport async function createSession(\n apiKey: string,\n params: CreateSessionParams,\n baseUrl: string,\n): Promise<Result<CreateSessionTokenReturnType, CreateSessionError>> {\n const body: CreateSessionTokenRequestBody = {\n deviceIp: params.deviceIp,\n ...(params.externalCustomerId !== undefined && {\n externalCustomerId: params.externalCustomerId,\n }),\n ...(params.email !== undefined && { email: params.email }),\n ...(params.phoneNumber !== undefined && { phoneNumber: params.phoneNumber }),\n };\n\n const response = await fetch(`${baseUrl}/platform/v1/sessions`, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n 'X-Api-Key': apiKey,\n },\n body: JSON.stringify(body),\n });\n\n const data = await response.json();\n\n if (!response.ok) {\n return err({\n code: data.code ?? 'unknown_error',\n message: data.message ?? 'Failed to create session',\n errors: data.errors,\n });\n }\n\n return ok(data as CreateSessionTokenReturnType);\n}\n","import type { CustomerExportIdentity } from '@moonpay/platform-protocol/api/customer';\nimport type { ExportCustomerError } from '@moonpay/platform-protocol/api/errors';\nimport type { Result } from '@moonpay/platform-protocol/result';\nimport { err, ok } from '@moonpay/platform-protocol/result';\n\nexport interface ExportCustomerParams {\n /**\n * One-time consent token from the customer-export frame's `complete`\n * event (web/RN SDK). Valid for 5 minutes.\n */\n consentToken: string;\n}\n\nexport async function exportCustomer(\n apiKey: string,\n params: ExportCustomerParams,\n baseUrl: string,\n): Promise<Result<{ data: CustomerExportIdentity }, ExportCustomerError>> {\n const response = await fetch(`${baseUrl}/platform/v1/customers/export`, {\n method: 'POST',\n headers: {\n 'X-Api-Key': apiKey,\n Authorization: `Bearer ${params.consentToken}`,\n },\n });\n\n const data = await response.json();\n\n if (!response.ok) {\n return err({\n code: data.code ?? 'unknown_error',\n message: data.message ?? 'Failed to export customer',\n errors: data.errors,\n });\n }\n\n return ok(data as { data: CustomerExportIdentity });\n}\n","import type { RevokeSessionError } from '@moonpay/platform-protocol/api/errors';\nimport type { EmptyResult } from '@moonpay/platform-protocol/result';\nimport { err, ok } from '@moonpay/platform-protocol/result';\n\nexport interface RevokeSessionParams {\n /** The external customer identifier whose sessions should be revoked. */\n externalCustomerId: string;\n}\n\nexport async function revokeSession(\n apiKey: string,\n params: RevokeSessionParams,\n baseUrl: string,\n): Promise<EmptyResult<RevokeSessionError>> {\n const url = new URL('/platform/v1/sessions', baseUrl);\n url.searchParams.set('externalCustomerId', params.externalCustomerId);\n\n const response = await fetch(url, {\n method: 'DELETE',\n headers: {\n 'X-Api-Key': apiKey,\n },\n });\n\n if (!response.ok) {\n const data = await response.json().catch(() => ({}));\n return err({\n code: data.code ?? 'unknown_error',\n message: data.message ?? 'Failed to revoke session',\n errors: data.errors,\n });\n }\n\n return ok(undefined as never);\n}\n","import type { CreateSessionTokenReturnType } from '@moonpay/platform-protocol/api';\nimport type { CustomerExportIdentity } from '@moonpay/platform-protocol/api/customer';\nimport type {\n CreateSessionError,\n ExportCustomerError,\n RevokeSessionError,\n} from '@moonpay/platform-protocol/api/errors';\nimport type { EmptyResult, Result } from '@moonpay/platform-protocol/result';\nimport { type CreateSessionParams, createSession } from './create-session.js';\nimport { type ExportCustomerParams, exportCustomer } from './export-customer.js';\nimport { type RevokeSessionParams, revokeSession } from './revoke-session.js';\n\nexport interface CreateServerClientOptions {\n /** Your MoonPay secret API key. Never expose this client-side. */\n apiKey: string;\n /** Override the API base URL. Defaults to production. */\n baseUrl?: string;\n}\n\nexport interface ServerClient {\n /** Create a session token for a customer. */\n createSession(\n params: CreateSessionParams,\n ): Promise<Result<CreateSessionTokenReturnType, CreateSessionError>>;\n /** Revoke all sessions for a customer (by external customer ID). */\n revokeSession(params: RevokeSessionParams): Promise<EmptyResult<RevokeSessionError>>;\n /**\n * Exchange a one-time consent token (from the customer-export frame's\n * `complete` event, web/RN SDK) for the customer's verified MoonPay\n * identity. Call within the token's validity window.\n */\n exportCustomer(\n params: ExportCustomerParams,\n ): Promise<Result<{ data: CustomerExportIdentity }, ExportCustomerError>>;\n}\n\n/**\n * Creates a server-side MoonPay client for session management.\n *\n * This client uses your secret API key and must only be used in\n * server-side environments (Node.js, edge functions, etc.).\n */\nexport function createServerClient(options: CreateServerClientOptions): ServerClient {\n const { apiKey, baseUrl = 'https://api.moonpay.com' } = options;\n\n return {\n createSession: (params) => createSession(apiKey, params, baseUrl),\n revokeSession: (params) => revokeSession(apiKey, params, baseUrl),\n exportCustomer: (params) => exportCustomer(apiKey, params, baseUrl),\n };\n}\n"],"mappings":";AAMA,SAAS,KAAK,UAAU;AAmBxB,eAAsB,cACpB,QACA,QACA,SACmE;AACnE,QAAM,OAAsC;AAAA,IAC1C,UAAU,OAAO;AAAA,IACjB,GAAI,OAAO,uBAAuB,UAAa;AAAA,MAC7C,oBAAoB,OAAO;AAAA,IAC7B;AAAA,IACA,GAAI,OAAO,UAAU,UAAa,EAAE,OAAO,OAAO,MAAM;AAAA,IACxD,GAAI,OAAO,gBAAgB,UAAa,EAAE,aAAa,OAAO,YAAY;AAAA,EAC5E;AAEA,QAAM,WAAW,MAAM,MAAM,GAAG,OAAO,yBAAyB;AAAA,IAC9D,QAAQ;AAAA,IACR,SAAS;AAAA,MACP,gBAAgB;AAAA,MAChB,aAAa;AA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;AAAA,MACzB,QAAQ,KAAK;AAAA,IACf,CAAC;AAAA,EACH;AAEA,SAAOC,IAAG,MAAkB;AAC9B;;;ACQO,SAAS,mBAAmB,SAAkD;AACnF,QAAM,EAAE,QAAQ,UAAU,0BAA0B,IAAI;AAExD,SAAO;AAAA,IACL,eAAe,CAAC,WAAW,cAAc,QAAQ,QAAQ,OAAO;AAAA,IAChE,eAAe,CAAC,WAAW,cAAc,QAAQ,QAAQ,OAAO;AAAA,IAChE,gBAAgB,CAAC,WAAW,eAAe,QAAQ,QAAQ,OAAO;AAAA,EACpE;AACF;","names":["err","ok","err","ok"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moonpay/platform-sdk-node",
3
- "version": "1.6.0",
3
+ "version": "1.7.0",
4
4
  "description": "MoonPay Developer Platform server-side SDK for Node.js",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -28,10 +28,10 @@
28
28
  "clean": "rm -rf dist"
29
29
  },
30
30
  "dependencies": {
31
- "@moonpay/platform-protocol": "1.6.0"
31
+ "@moonpay/platform-protocol": "1.7.0"
32
32
  },
33
33
  "devDependencies": {
34
- "tsup": "8.0.0",
34
+ "tsup": "8.3.5",
35
35
  "typescript": "5.7.3"
36
36
  },
37
37
  "sideEffects": false,