@memberstack/dom 2.0.1 → 2.0.2

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 (86) hide show
  1. package/README.md +356 -3
  2. package/lib/index.d.mts +1912 -64
  3. package/lib/index.d.ts +1912 -64
  4. package/lib/index.js +2316 -30656
  5. package/lib/index.mjs +2302 -30656
  6. package/lib/{types/utils/payloads.d.mts → models-CFT_ABd5.d.ts} +194 -6
  7. package/lib/testing/index.d.mts +295 -0
  8. package/lib/testing/index.d.ts +295 -0
  9. package/lib/testing/index.js +335 -0
  10. package/lib/testing/index.mjs +305 -0
  11. package/package.json +23 -12
  12. package/lib/auth/index.d.mts +0 -9
  13. package/lib/auth/index.d.ts +0 -9
  14. package/lib/auth/index.global.js +0 -244
  15. package/lib/auth/index.js +0 -158
  16. package/lib/auth/index.mjs +0 -121
  17. package/lib/constants/endpoints.d.mts +0 -5
  18. package/lib/constants/endpoints.d.ts +0 -5
  19. package/lib/constants/endpoints.global.js +0 -29
  20. package/lib/constants/endpoints.js +0 -31
  21. package/lib/constants/endpoints.mjs +0 -7
  22. package/lib/index.global.js +0 -46364
  23. package/lib/methods/dom/index.d.mts +0 -2
  24. package/lib/methods/dom/index.d.ts +0 -2
  25. package/lib/methods/dom/index.global.js +0 -2
  26. package/lib/methods/dom/index.js +0 -0
  27. package/lib/methods/dom/index.mjs +0 -0
  28. package/lib/methods/dom/main-dom.d.mts +0 -14
  29. package/lib/methods/dom/main-dom.d.ts +0 -14
  30. package/lib/methods/dom/main-dom.global.js +0 -30620
  31. package/lib/methods/dom/main-dom.js +0 -30618
  32. package/lib/methods/dom/main-dom.mjs +0 -30601
  33. package/lib/methods/dom/methods.d.mts +0 -18
  34. package/lib/methods/dom/methods.d.ts +0 -18
  35. package/lib/methods/dom/methods.global.js +0 -30827
  36. package/lib/methods/dom/methods.js +0 -30835
  37. package/lib/methods/dom/methods.mjs +0 -30806
  38. package/lib/methods/index.d.mts +0 -103
  39. package/lib/methods/index.d.ts +0 -103
  40. package/lib/methods/index.global.js +0 -46361
  41. package/lib/methods/index.js +0 -32125
  42. package/lib/methods/index.mjs +0 -32096
  43. package/lib/methods/requests/index.d.mts +0 -92
  44. package/lib/methods/requests/index.d.ts +0 -92
  45. package/lib/methods/requests/index.global.js +0 -15553
  46. package/lib/methods/requests/index.js +0 -1322
  47. package/lib/methods/requests/index.mjs +0 -1288
  48. package/lib/methods/requests/requests.d.mts +0 -42
  49. package/lib/methods/requests/requests.d.ts +0 -42
  50. package/lib/methods/requests/requests.global.js +0 -14528
  51. package/lib/methods/requests/requests.js +0 -242
  52. package/lib/methods/requests/requests.mjs +0 -209
  53. package/lib/types/index.d.mts +0 -4
  54. package/lib/types/index.d.ts +0 -4
  55. package/lib/types/index.global.js +0 -19
  56. package/lib/types/index.js +0 -17
  57. package/lib/types/index.mjs +0 -0
  58. package/lib/types/params.d.mts +0 -322
  59. package/lib/types/params.d.ts +0 -322
  60. package/lib/types/params.global.js +0 -19
  61. package/lib/types/params.js +0 -17
  62. package/lib/types/params.mjs +0 -0
  63. package/lib/types/payloads.d.mts +0 -143
  64. package/lib/types/payloads.d.ts +0 -143
  65. package/lib/types/payloads.global.js +0 -19
  66. package/lib/types/payloads.js +0 -17
  67. package/lib/types/payloads.mjs +0 -0
  68. package/lib/types/translations.d.mts +0 -43
  69. package/lib/types/translations.d.ts +0 -43
  70. package/lib/types/translations.global.js +0 -19
  71. package/lib/types/translations.js +0 -17
  72. package/lib/types/translations.mjs +0 -0
  73. package/lib/types/utils/payloads.d.ts +0 -299
  74. package/lib/types/utils/payloads.global.js +0 -19
  75. package/lib/types/utils/payloads.js +0 -17
  76. package/lib/types/utils/payloads.mjs +0 -0
  77. package/lib/utils/cookies.d.mts +0 -13
  78. package/lib/utils/cookies.d.ts +0 -13
  79. package/lib/utils/cookies.global.js +0 -261
  80. package/lib/utils/cookies.js +0 -179
  81. package/lib/utils/cookies.mjs +0 -138
  82. package/lib/utils/defaultMessageBox.d.mts +0 -5
  83. package/lib/utils/defaultMessageBox.d.ts +0 -5
  84. package/lib/utils/defaultMessageBox.global.js +0 -125
  85. package/lib/utils/defaultMessageBox.js +0 -129
  86. package/lib/utils/defaultMessageBox.mjs +0 -103
package/lib/index.d.ts CHANGED
@@ -1,24 +1,1863 @@
1
- import { GetCurrentMemberParams, MemberstackOptions } from './methods/requests/index.js';
2
- import { GetPostsParams, GetThreadsParams, CreatePostParams, UpdatePostParams, PostVoteParams, DeletePostParams, CreateThreadParams, UpdateThreadParams, ThreadVoteParams, DeleteThreadParams, GetSecureContentParams, SignupWithProviderParams, LoginWithProviderParams, LoginMemberEmailPasswordParams, SendMemberLoginPasswordlessEmailParams, LoginMemberPasswordlessParams, GetPlanParams, UpdateMemberJSONParams, AddPlanParams, PurchasePlansWithCheckoutParams, LaunchStripeCustomerPortalParams, RemovePlanParams, UpdateMemberParams, UpdateMemberAuthParams, SetPasswordParams, SignupMemberEmailPasswordParams, JoinTeamParams, GetTeamParams, RemoveMemberFromTeamParams, GenerateInviteTokenParams, UpdateMemberProfileImageParams, SendMemberResetPasswordEmailParams, ResetMemberPasswordParams, GetDataTableParams, GetDataRecordsParams, CreateDataRecordParams, GetDataRecordParams, UpdateDataRecordParams, DeleteDataRecordParams, QueryDataRecordsParams } from './types/params.js';
3
- export { AddMemberCardParams, CancelPlanParams, CountClause, DataRecordsQuery, GetAuthenticationClientSecretParams, GetMemberInvoicesParams, GetMemberPurchasesParams, GetMemberReceiptsParams, GetPlansParams, GetTotalCheckoutAmountParams, IncludeClause, MemberReferenceOperation, MemberReferenceSelector, OpenStripeCustomerPortalParams, OrderByClause, PurchasePlansParams, ReferenceOperation, ReferenceSelector, ReplacePlanParams, SelectClause, SignupMemberAuthProviderParams, UpdateDefaultCardParams, UpdatePlanPaymentParams, WhereClause, WhereOperators } from './types/params.js';
4
- import { DeleteMemberPayload, GetPostsPayload, GetThreadsPayload, CreatePostPayload, UpdatePostPayload, CreateThreadPayload, UpdateThreadPayload, GetSecureContentPayload, ConnectProviderPayload, GetAppAndMemberPayload, AppPayload, LoginMemberEmailPasswordPayload, SendMemberLoginPasswordlessEmailPayload, GetPlanPayload, GetPlansPayload, GetRestrictedUrlGroupsPayload, GetCurrentMemberPayload, GetMemberJSONPayload, AddPlanPayload, PurchasePlansWithCheckoutPayload, LaunchStripeCustomerPortalPayload, RemovePlanPayload, UpdateMemberPayload, UpdateMemberAuthPayload, SetPasswordPayload, SignupMemberEmailPasswordPayload, UpdateMemberProfileImagePayload, SendMemberVerificationEmailPayload, SendMemberResetPasswordEmailPayload, ResetMemberPassworPayload, LogoutMemberPayload, GetDataTablesPayload, GetDataTablePayload, GetDataRecordsPayload, CreateDataRecordPayload, GetDataRecordPayload, UpdateDataRecordPayload, DeleteDataRecordPayload, QueryDataRecordsPayload } from './types/payloads.js';
5
- export { AddMemberCardPayload, CancelPlanPayload, GetAuthProvidersPayload, GetAuthenticationClientSecretPayload, GetMemberCardsPayload, GetMemberInvoicesPayload, GetMemberReceiptsPayload, GetTotalCheckoutAmountPayload, MemberReferenceFieldResult, OpenStripeCustomerPortalPayload, PurchasePlansPayload, ReferenceFieldResult, RefreshMemberTokensPayload, ReplacePlanPayload, SignupMemberAuthProviderPayload, UpdateDefaultCardPayload, UpdatePlanPaymentPayload } from './types/payloads.js';
6
- import { MemberstackTranslations } from './types/translations.js';
7
- import { DOMConfig } from './methods/index.js';
8
- import './types/utils/payloads.js';
1
+ import { P as Payload } from './models-CFT_ABd5.js';
2
+ export { A as App, d as AuthProvider, f as AuthTokens, B as Branding, j as CheckoutTotal, C as ContentGroup, k as CustomField, E as ExtractData, M as Member, e as MemberAuth, g as MemberCard, n as MemberDisplayInfo, h as MemberInvoice, i as MemberReceipt, m as PaginatedData, a as Plan, c as PlanConnection, l as Post, b as Price, S as SecureContent, T as Thread } from './models-CFT_ABd5.js';
3
+
4
+ /**
5
+ * Supported OAuth providers for social login.
6
+ * Use lowercase when calling loginWithProvider(), signupWithProvider(),
7
+ * connectProvider(), and disconnectProvider().
8
+ *
9
+ * These providers have pre-configured settings and work with just a client ID/secret.
10
+ * Custom OIDC providers configured in the dashboard are also accepted via the `string` fallback.
11
+ */
12
+ type OAuthProvider = 'google' | 'facebook' | 'microsoft' | 'github' | 'linkedin' | 'spotify' | 'dribbble' | (string & {});
13
+ /**
14
+ * Parameters for signing up a new member with email and password.
15
+ *
16
+ * @example
17
+ * ```typescript
18
+ * await memberstack.signupMemberEmailPassword({
19
+ * email: 'user@example.com',
20
+ * password: 'securePassword123',
21
+ * customFields: { firstName: 'John', company: 'Acme Inc' },
22
+ * plans: [{ planId: 'pln_free_tier' }]
23
+ * });
24
+ * ```
25
+ */
26
+ type SignupMemberEmailPasswordParams = {
27
+ /** Member's email address (must be unique within your app) */
28
+ email: string;
29
+ /** Member's password (minimum 8 characters recommended) */
30
+ password: string;
31
+ /** Custom field values to set during signup (keys must match your app's custom fields) */
32
+ customFields?: Record<string, any>;
33
+ /** Metadata to store with the member (not displayed in dashboard) */
34
+ metaData?: Record<string, any>;
35
+ /** Array of plans to assign on signup */
36
+ plans?: {
37
+ planId: string;
38
+ }[];
39
+ /** reCAPTCHA token if captcha is enabled for your app */
40
+ captchaToken?: string;
41
+ /** Team invite token to join a team during signup */
42
+ inviteToken?: string;
43
+ };
44
+ /**
45
+ * Parameters for joining a team with an invite token.
46
+ */
47
+ type JoinTeamParams = {
48
+ /** The invite token received from team admin */
49
+ inviteToken: string;
50
+ };
51
+ /**
52
+ * Parameters for retrieving team information.
53
+ */
54
+ type GetTeamParams = {
55
+ /** The ID of the team to retrieve */
56
+ teamId: string;
57
+ };
58
+ /**
59
+ * Parameters for removing a member from a team.
60
+ */
61
+ type RemoveMemberFromTeamParams = {
62
+ /** The ID of the team */
63
+ teamId: string;
64
+ /** The ID of the member to remove */
65
+ memberId: string;
66
+ };
67
+ /**
68
+ * Parameters for generating a team invite token.
69
+ */
70
+ type GenerateInviteTokenParams = {
71
+ /** The ID of the team to generate an invite for */
72
+ teamId: string;
73
+ };
74
+ /**
75
+ * Parameters for retrieving posts from a channel.
76
+ */
77
+ type GetPostsParams = {
78
+ /** The key/identifier of the channel */
79
+ channelKey: string;
80
+ /** Sort order for posts */
81
+ order?: "newest" | "oldest";
82
+ /** Cursor for pagination (post ID to start after) */
83
+ after?: string;
84
+ /** Maximum number of posts to return */
85
+ limit?: number;
86
+ };
87
+ /**
88
+ * Parameters for retrieving threads (replies) on a post.
89
+ */
90
+ type GetThreadsParams = {
91
+ /** The ID of the parent post */
92
+ postId: string;
93
+ /** Sort order for threads */
94
+ order?: "newest" | "oldest";
95
+ /** Cursor for pagination (thread ID to start after) */
96
+ after?: string;
97
+ /** Maximum number of threads to return */
98
+ limit?: number;
99
+ };
100
+ /**
101
+ * Parameters for creating a new post in a channel.
102
+ */
103
+ type CreatePostParams = {
104
+ /** The key/identifier of the channel to post in */
105
+ channelKey: string;
106
+ /** The content of the post (supports markdown) */
107
+ content: string;
108
+ };
109
+ /**
110
+ * Parameters for updating an existing post.
111
+ */
112
+ type UpdatePostParams = {
113
+ /** The ID of the post to update */
114
+ postId: string;
115
+ /** The new content for the post */
116
+ content: string;
117
+ };
118
+ /**
119
+ * Parameters for deleting a post.
120
+ */
121
+ type DeletePostParams = {
122
+ /** The ID of the post to delete */
123
+ postId: string;
124
+ };
125
+ /**
126
+ * Parameters for voting on a post.
127
+ */
128
+ type PostVoteParams = {
129
+ /** The ID of the post to vote on */
130
+ postId: string;
131
+ /** The vote type: UP, DOWN, or NONE to remove vote */
132
+ vote: "UP" | "DOWN" | "NONE";
133
+ };
134
+ /**
135
+ * Parameters for voting on a thread.
136
+ */
137
+ type ThreadVoteParams = {
138
+ /** The ID of the thread to vote on */
139
+ threadId: string;
140
+ /** The vote type: UP, DOWN, or NONE to remove vote */
141
+ vote: "UP" | "DOWN" | "NONE";
142
+ };
143
+ /**
144
+ * Parameters for creating a reply thread on a post.
145
+ */
146
+ type CreateThreadParams = {
147
+ /** The ID of the post to reply to */
148
+ postId: string;
149
+ /** The content of the reply (supports markdown) */
150
+ content: string;
151
+ };
152
+ /**
153
+ * Parameters for updating an existing thread.
154
+ */
155
+ type UpdateThreadParams = {
156
+ /** The ID of the thread to update */
157
+ threadId: string;
158
+ /** The new content for the thread */
159
+ content: string;
160
+ };
161
+ /**
162
+ * Parameters for deleting a thread.
163
+ */
164
+ type DeleteThreadParams = {
165
+ /** The ID of the thread to delete */
166
+ threadId: string;
167
+ };
168
+ /**
169
+ * Parameters for updating a member's profile image.
170
+ *
171
+ * @example Upload a new image
172
+ * ```typescript
173
+ * const fileInput = document.querySelector('input[type="file"]');
174
+ * await memberstack.updateMemberProfileImage({
175
+ * profileImage: fileInput.files[0]
176
+ * });
177
+ * ```
178
+ *
179
+ * @example Remove the profile image
180
+ * ```typescript
181
+ * await memberstack.updateMemberProfileImage({
182
+ * profileImage: null
183
+ * });
184
+ * ```
185
+ */
186
+ type UpdateMemberProfileImageParams = {
187
+ /** The image file to upload, or null to remove the current profile image */
188
+ profileImage: File | null;
189
+ };
190
+ /**
191
+ * Parameters for retrieving secure/gated content.
192
+ *
193
+ * @example
194
+ * ```typescript
195
+ * const { data: content } = await memberstack.getSecureContent({
196
+ * contentId: 'cnt_premium_article_123'
197
+ * });
198
+ * ```
199
+ */
200
+ type GetSecureContentParams = {
201
+ /** The ID of the secure content block to retrieve */
202
+ contentId: string;
203
+ };
204
+ /**
205
+ * Parameters for setting a password (for passwordless or OAuth users).
206
+ *
207
+ * @example
208
+ * ```typescript
209
+ * // After signing up with Google, user can set a password
210
+ * await memberstack.setPassword({
211
+ * password: 'myNewPassword123'
212
+ * });
213
+ * ```
214
+ */
215
+ type SetPasswordParams = {
216
+ /** The new password to set (minimum 8 characters recommended) */
217
+ password: string;
218
+ };
219
+ /**
220
+ * Parameters for signing up with an OAuth provider.
221
+ *
222
+ * @example
223
+ * ```typescript
224
+ * await memberstack.signupWithProvider({
225
+ * provider: 'google',
226
+ * customFields: { referralSource: 'twitter' },
227
+ * plans: [{ planId: 'pln_starter' }]
228
+ * });
229
+ * ```
230
+ */
231
+ type SignupWithProviderParams = {
232
+ /** OAuth provider to sign up with */
233
+ provider: OAuthProvider;
234
+ /** Custom field values to set during signup */
235
+ customFields?: Record<string, any>;
236
+ /** Array of plans to assign on signup */
237
+ plans?: {
238
+ planId: string;
239
+ }[];
240
+ /** If true, allows login to existing account (default: false) */
241
+ allowLogin?: boolean;
242
+ /** Team invite token to join a team during signup */
243
+ inviteToken?: string;
244
+ };
245
+ /**
246
+ * Parameters for logging in with an OAuth provider.
247
+ *
248
+ * @example
249
+ * ```typescript
250
+ * await memberstack.loginWithProvider({
251
+ * provider: 'google',
252
+ * allowSignup: false // Only allow existing accounts
253
+ * });
254
+ * ```
255
+ */
256
+ type LoginWithProviderParams = {
257
+ /** OAuth provider to log in with */
258
+ provider: OAuthProvider;
259
+ /** If true, creates new account if one doesn't exist (default: false) */
260
+ allowSignup?: boolean;
261
+ };
262
+ /**
263
+ * Parameters for completing a passwordless login flow.
264
+ *
265
+ * @example
266
+ * ```typescript
267
+ * // After user receives email with code
268
+ * await memberstack.loginMemberPasswordless({
269
+ * email: 'user@example.com',
270
+ * passwordlessToken: '123456'
271
+ * });
272
+ * ```
273
+ */
274
+ type LoginMemberPasswordlessParams = {
275
+ /** The verification code from the email */
276
+ passwordlessToken: string;
277
+ /** The email address that received the code */
278
+ email: string;
279
+ };
280
+ /**
281
+ * Parameters for sending a passwordless login email.
282
+ */
283
+ type SendMemberLoginPasswordlessEmailParams = {
284
+ /** The email address to send the login code to */
285
+ email: string;
286
+ };
287
+ /**
288
+ * Parameters for signing up with an auth provider code (internal use).
289
+ */
290
+ type SignupMemberAuthProviderParams = {
291
+ /** The authorization code from OAuth flow */
292
+ code: string;
293
+ /** The OAuth provider (uppercase, e.g. 'GOOGLE') */
294
+ provider: string;
295
+ /** Plan ID to assign (deprecated, use plans array) */
296
+ planId?: string;
297
+ /** Custom field values to set during signup */
298
+ customFields?: Record<string, any>;
299
+ /** Metadata to store with the member */
300
+ metaData?: Record<string, any>;
301
+ /** Array of plans to assign on signup */
302
+ plans?: {
303
+ planId: string;
304
+ }[];
305
+ /** Payment information for paid plans */
306
+ payment?: {
307
+ stripe?: {
308
+ paymentMethodId: string;
309
+ };
310
+ };
311
+ };
312
+ /**
313
+ * Parameters for logging in with email and password.
314
+ *
315
+ * @example
316
+ * ```typescript
317
+ * const { data } = await memberstack.loginMemberEmailPassword({
318
+ * email: 'user@example.com',
319
+ * password: 'password123'
320
+ * });
321
+ * console.log('Logged in:', data.member.auth.email);
322
+ * ```
323
+ */
324
+ type LoginMemberEmailPasswordParams = {
325
+ /** Member's email address */
326
+ email: string;
327
+ /** Member's password */
328
+ password: string;
329
+ };
330
+ /**
331
+ * Parameters for updating member profile data.
332
+ *
333
+ * @example
334
+ * ```typescript
335
+ * await memberstack.updateMember({
336
+ * customFields: {
337
+ * firstName: 'Jane',
338
+ * company: 'New Company Inc'
339
+ * }
340
+ * });
341
+ * ```
342
+ */
343
+ type UpdateMemberParams = {
344
+ /** Custom field values to update (keys must match your app's custom fields) */
345
+ customFields?: Record<string, any>;
346
+ };
347
+ /**
348
+ * Parameters for updating member authentication credentials.
349
+ *
350
+ * @example Change email
351
+ * ```typescript
352
+ * await memberstack.updateMemberAuth({
353
+ * email: 'newemail@example.com'
354
+ * });
355
+ * ```
356
+ *
357
+ * @example Change password
358
+ * ```typescript
359
+ * await memberstack.updateMemberAuth({
360
+ * oldPassword: 'currentPassword',
361
+ * newPassword: 'newSecurePassword123'
362
+ * });
363
+ * ```
364
+ */
365
+ type UpdateMemberAuthParams = {
366
+ /** New email address (will require verification) */
367
+ email?: string;
368
+ /** Current password (required when changing password) */
369
+ oldPassword?: string;
370
+ /** New password to set */
371
+ newPassword?: string;
372
+ };
373
+ /**
374
+ * Parameters for purchasing plans with payment.
375
+ */
376
+ type PurchasePlansParams = {
377
+ /** Array of plans to purchase with optional specific price */
378
+ plans: {
379
+ planId: string;
380
+ priceId?: string;
381
+ }[];
382
+ /** Payment method information */
383
+ payment: {
384
+ /** Saved card ID from member's cards */
385
+ cardId?: string;
386
+ /** Stripe payment method */
387
+ stripe?: {
388
+ paymentMethodId: string;
389
+ };
390
+ };
391
+ };
392
+ /**
393
+ * Parameters for adding a free plan to a member.
394
+ *
395
+ * @example
396
+ * ```typescript
397
+ * await memberstack.addPlan({
398
+ * planId: 'pln_free_tier'
399
+ * });
400
+ * ```
401
+ */
402
+ type AddPlanParams = {
403
+ /** The ID of the free plan to add */
404
+ planId: string;
405
+ };
406
+ /**
407
+ * Parameters for launching Stripe Checkout for plan purchase.
408
+ *
409
+ * @example
410
+ * ```typescript
411
+ * await memberstack.purchasePlansWithCheckout({
412
+ * priceId: 'prc_monthly_pro',
413
+ * successUrl: 'https://yoursite.com/thank-you',
414
+ * cancelUrl: 'https://yoursite.com/pricing',
415
+ * couponId: 'SAVE20'
416
+ * });
417
+ * ```
418
+ */
419
+ type PurchasePlansWithCheckoutParams = {
420
+ /** The price ID to purchase (from your Memberstack dashboard) */
421
+ priceId: string;
422
+ /** Stripe coupon ID to apply discount */
423
+ couponId?: string;
424
+ /** URL to redirect on checkout cancellation */
425
+ cancelUrl?: string;
426
+ /** URL to redirect on successful purchase */
427
+ successUrl?: string;
428
+ /** Auto-redirect to Stripe Checkout (default: true) */
429
+ autoRedirect?: boolean;
430
+ /** Custom metadata to attach to the Stripe checkout session (Stripe accepts string key-value pairs) */
431
+ metadataForCheckout?: Record<string, string>;
432
+ };
433
+ /**
434
+ * Parameters for launching Stripe Customer Portal.
435
+ *
436
+ * @example
437
+ * ```typescript
438
+ * await memberstack.launchStripeCustomerPortal({
439
+ * returnUrl: 'https://yoursite.com/account'
440
+ * });
441
+ * ```
442
+ */
443
+ type LaunchStripeCustomerPortalParams = {
444
+ /** Price IDs to show update options for */
445
+ priceIds?: string[];
446
+ /** Stripe portal configuration object */
447
+ configuration?: Record<string, unknown>;
448
+ /** URL to return to after leaving the portal */
449
+ returnUrl?: string;
450
+ /** Auto-redirect to Stripe portal (default: true) */
451
+ autoRedirect?: boolean;
452
+ };
453
+ /**
454
+ * Parameters for opening Stripe Customer Portal (alias for launchStripeCustomerPortal).
455
+ */
456
+ type OpenStripeCustomerPortalParams = {
457
+ /** Stripe portal configuration object */
458
+ configuration?: Record<string, unknown>;
459
+ /** URL to return to after leaving the portal */
460
+ returnUrl?: string;
461
+ /** Auto-redirect to Stripe portal (default: true) */
462
+ autoRedirect?: boolean;
463
+ };
464
+ /**
465
+ * Parameters for removing a plan from a member.
466
+ *
467
+ * @example
468
+ * ```typescript
469
+ * await memberstack.removePlan({
470
+ * planId: 'pln_free_tier'
471
+ * });
472
+ * ```
473
+ */
474
+ type RemovePlanParams = {
475
+ /** The ID of the plan to remove */
476
+ planId: string;
477
+ };
478
+ /**
479
+ * Parameters for canceling a subscription plan connection.
480
+ */
481
+ type CancelPlanParams = {
482
+ /** The ID of the plan connection to cancel */
483
+ planConnectionId: string;
484
+ };
485
+ /**
486
+ * Parameters for adding a payment card to a member.
487
+ */
488
+ type AddMemberCardParams = {
489
+ /** Stripe payment method ID for the card */
490
+ stripePaymentMethodId: string;
491
+ /** Set as default payment method */
492
+ default?: boolean;
493
+ };
494
+ /**
495
+ * Parameters for updating the default payment card.
496
+ */
497
+ type UpdateDefaultCardParams = {
498
+ /** The ID of the card to set as default */
499
+ cardId: string;
500
+ };
501
+ /**
502
+ * Parameters for updating payment method on a plan.
503
+ */
504
+ type UpdatePlanPaymentParams = {
505
+ /** The plan connection ID to update */
506
+ planConnectionId: string;
507
+ /** The card ID to use for future payments */
508
+ cardId: string;
509
+ };
510
+ /**
511
+ * Parameters for retrieving member receipts.
512
+ */
513
+ type GetMemberReceiptsParams = {
514
+ /** Number of receipts to return */
515
+ first?: number;
516
+ /** Cursor for pagination */
517
+ after?: string;
518
+ /** Sort order */
519
+ order?: "ASC" | "DESC";
520
+ };
521
+ /**
522
+ * Parameters for retrieving member invoices.
523
+ */
524
+ type GetMemberInvoicesParams = {
525
+ /** Number of invoices to return */
526
+ first?: number;
527
+ /** Cursor for pagination */
528
+ after?: string;
529
+ /** Sort order */
530
+ order?: "ASC" | "DESC";
531
+ };
532
+ /**
533
+ * Parameters for updating member JSON store.
534
+ *
535
+ * @example
536
+ * ```typescript
537
+ * await memberstack.updateMemberJSON({
538
+ * json: { preferences: { theme: 'dark', notifications: true } }
539
+ * });
540
+ * ```
541
+ */
542
+ type UpdateMemberJSONParams = {
543
+ /** JSON object to store (completely replaces existing JSON) */
544
+ json: Record<string, unknown>;
545
+ };
546
+ /**
547
+ * Parameters for retrieving member purchases with optional expansions.
548
+ */
549
+ type GetMemberPurchasesParams = {
550
+ /** Include full plan details */
551
+ expandPlan?: boolean;
552
+ /** Include full price details */
553
+ expandPrice?: boolean;
554
+ /** Include card details */
555
+ expandCard?: boolean;
556
+ /** Include subscription details */
557
+ expandSubscription?: boolean;
558
+ };
559
+ /**
560
+ * Parameters for retrieving a specific plan.
561
+ */
562
+ type GetPlanParams = {
563
+ /** The ID of the plan to retrieve */
564
+ planId: string;
565
+ };
566
+ /**
567
+ * Parameters for retrieving plans list.
568
+ */
569
+ type GetPlansParams = {
570
+ /** Filter by plan status */
571
+ status?: "ALL" | "ACTIVE" | "INACTIVE";
572
+ };
573
+ /**
574
+ * Parameters for sending a password reset email.
575
+ *
576
+ * @example
577
+ * ```typescript
578
+ * await memberstack.sendMemberResetPasswordEmail({
579
+ * email: 'user@example.com'
580
+ * });
581
+ * ```
582
+ */
583
+ type SendMemberResetPasswordEmailParams = {
584
+ /** Email address of the member requesting password reset */
585
+ email: string;
586
+ };
587
+ /**
588
+ * Parameters for completing a password reset.
589
+ *
590
+ * @example
591
+ * ```typescript
592
+ * // Token comes from the reset email link
593
+ * await memberstack.resetMemberPassword({
594
+ * token: 'reset_token_from_email',
595
+ * newPassword: 'newSecurePassword123'
596
+ * });
597
+ * ```
598
+ */
599
+ type ResetMemberPasswordParams = {
600
+ /** Reset token from the password reset email */
601
+ token: string;
602
+ /** The new password to set */
603
+ newPassword: string;
604
+ };
605
+ /**
606
+ * Parameters for replacing/upgrading a plan.
607
+ */
608
+ type ReplacePlanParams = {
609
+ /** The current plan connection to replace */
610
+ planConnectionId: string;
611
+ /** The new plan ID to switch to */
612
+ newPlanId?: string;
613
+ /** Specific price ID for the new plan */
614
+ priceId?: string;
615
+ /** Payment method for the new plan */
616
+ payment?: {
617
+ cardId?: string;
618
+ stripe?: {
619
+ paymentMethodId: string;
620
+ };
621
+ };
622
+ };
623
+ /**
624
+ * Parameters for getting authentication client secret.
625
+ */
626
+ type GetAuthenticationClientSecretParams = {
627
+ /** The plan connection requiring authentication */
628
+ planConnectionId: string;
629
+ };
630
+ /**
631
+ * Parameters for calculating total checkout amount.
632
+ */
633
+ type GetTotalCheckoutAmountParams = {
634
+ /** Array of price IDs to calculate total for */
635
+ priceIds: string[];
636
+ };
637
+ /**
638
+ * Parameters for retrieving records from a data table.
639
+ *
640
+ * @example
641
+ * ```typescript
642
+ * const { data } = await memberstack.getDataRecords({
643
+ * table: 'posts',
644
+ * limit: 10,
645
+ * sortBy: 'createdAt',
646
+ * sortDirection: 'DESC'
647
+ * });
648
+ * ```
649
+ */
650
+ type GetDataRecordsParams = {
651
+ /** The table key/identifier */
652
+ table: string;
653
+ /** @deprecated Use `table` instead */
654
+ tableKey?: string;
655
+ /** ISO date string - only return records created after this date */
656
+ createdAfter?: string;
657
+ /** ISO date string - only return records created before this date */
658
+ createdBefore?: string;
659
+ /** Field name to sort by */
660
+ sortBy?: string;
661
+ /** Sort direction (case-insensitive) */
662
+ sortDirection?: 'asc' | 'desc' | 'ASC' | 'DESC';
663
+ /** Maximum number of records to return (1-100) */
664
+ limit?: number;
665
+ /** Cursor for pagination (internalOrder value from previous response) */
666
+ after?: string;
667
+ };
668
+ /**
669
+ * Parameters for creating a new data record.
670
+ *
671
+ * @example
672
+ * ```typescript
673
+ * await memberstack.createDataRecord({
674
+ * table: 'posts',
675
+ * data: {
676
+ * title: 'My First Post',
677
+ * content: 'Hello world!',
678
+ * published: true
679
+ * }
680
+ * });
681
+ * ```
682
+ */
683
+ type CreateDataRecordParams = {
684
+ /** The table key/identifier */
685
+ table: string;
686
+ /** Record data as key-value pairs (keys must match table fields) */
687
+ data: Record<string, any>;
688
+ /** Optional member ID to associate with the record */
689
+ memberId?: string;
690
+ };
691
+ /**
692
+ * Parameters for retrieving a single data record.
693
+ */
694
+ type GetDataRecordParams = {
695
+ /** The table key/identifier */
696
+ table: string;
697
+ /** The ID of the record to retrieve */
698
+ recordId: string;
699
+ };
700
+ /**
701
+ * Selector for referencing records by ID in reference field operations.
702
+ */
703
+ type ReferenceSelector = {
704
+ /** The ID of the record to reference */
705
+ id: string;
706
+ };
707
+ /**
708
+ * Operations for connecting/disconnecting reference field relationships.
709
+ *
710
+ * @example Connect a record
711
+ * ```typescript
712
+ * await memberstack.updateDataRecord({
713
+ * recordId: 'rec_abc',
714
+ * data: {
715
+ * author: { connect: { id: 'rec_author123' } }
716
+ * }
717
+ * });
718
+ * ```
719
+ */
720
+ type ReferenceOperation = {
721
+ /** Connect one or more records to this reference field */
722
+ connect?: ReferenceSelector | ReferenceSelector[];
723
+ /** Disconnect one or more records from this reference field */
724
+ disconnect?: ReferenceSelector | ReferenceSelector[];
725
+ };
726
+ /**
727
+ * Selector for referencing the current member in member reference fields.
728
+ */
729
+ type MemberReferenceSelector = {
730
+ /** Set to true to reference the current authenticated member */
731
+ self: true;
732
+ };
733
+ /**
734
+ * Operations for connecting/disconnecting member reference relationships.
735
+ */
736
+ type MemberReferenceOperation = {
737
+ /** Connect the current member to this field */
738
+ connect?: MemberReferenceSelector | MemberReferenceSelector[];
739
+ /** Disconnect the current member from this field */
740
+ disconnect?: MemberReferenceSelector | MemberReferenceSelector[];
741
+ };
742
+ /**
743
+ * Parameters for updating an existing data record.
744
+ *
745
+ * @example
746
+ * ```typescript
747
+ * await memberstack.updateDataRecord({
748
+ * recordId: 'rec_abc123',
749
+ * data: {
750
+ * title: 'Updated Title',
751
+ * published: false
752
+ * }
753
+ * });
754
+ * ```
755
+ */
756
+ type UpdateDataRecordParams = {
757
+ /** The ID of the record to update */
758
+ recordId: string;
759
+ /** Fields to update as key-value pairs */
760
+ data: Record<string, any>;
761
+ };
762
+ /**
763
+ * Parameters for deleting a data record.
764
+ */
765
+ type DeleteDataRecordParams = {
766
+ /** The ID of the record to delete */
767
+ recordId: string;
768
+ };
769
+ /**
770
+ * Parameters for retrieving a data table schema.
771
+ */
772
+ type GetDataTableParams = {
773
+ /** The table key/identifier */
774
+ table: string;
775
+ /** @deprecated Use `table` instead */
776
+ tableKey?: string;
777
+ };
778
+ /**
779
+ * Filter operators for query where clauses.
780
+ * Follows Prisma-like syntax for powerful filtering.
781
+ *
782
+ * @example
783
+ * ```typescript
784
+ * {
785
+ * where: {
786
+ * age: { gte: 18, lt: 65 },
787
+ * name: { contains: 'john', mode: 'insensitive' },
788
+ * status: { in: ['active', 'pending'] }
789
+ * }
790
+ * }
791
+ * ```
792
+ */
793
+ type WhereOperators = {
794
+ /** Exact match */
795
+ equals?: any;
796
+ /** Not equal */
797
+ not?: any;
798
+ /** Value is in array */
799
+ in?: any[];
800
+ /** Value is not in array */
801
+ notIn?: any[];
802
+ /** Less than */
803
+ lt?: any;
804
+ /** Less than or equal */
805
+ lte?: any;
806
+ /** Greater than */
807
+ gt?: any;
808
+ /** Greater than or equal */
809
+ gte?: any;
810
+ /** String contains substring */
811
+ contains?: string;
812
+ /** String starts with prefix */
813
+ startsWith?: string;
814
+ /** String ends with suffix */
815
+ endsWith?: string;
816
+ /** Full-text search */
817
+ search?: string;
818
+ /** Case sensitivity mode for string operations */
819
+ mode?: 'insensitive' | 'default';
820
+ };
821
+ /**
822
+ * Where clause for filtering records with support for logical operators.
823
+ *
824
+ * @example Complex where clause
825
+ * ```typescript
826
+ * {
827
+ * where: {
828
+ * AND: [
829
+ * { status: { equals: 'published' } },
830
+ * { OR: [
831
+ * { category: 'tech' },
832
+ * { featured: true }
833
+ * ]}
834
+ * ]
835
+ * }
836
+ * }
837
+ * ```
838
+ */
839
+ type WhereClause = {
840
+ /** Field conditions - key is field name, value is condition */
841
+ [field: string]: any | WhereOperators;
842
+ /** All conditions must match */
843
+ AND?: WhereClause[];
844
+ /** At least one condition must match */
845
+ OR?: WhereClause[];
846
+ /** Condition must not match */
847
+ NOT?: WhereClause;
848
+ };
849
+ /**
850
+ * Clause for counting related records.
851
+ */
852
+ type CountClause = {
853
+ select: {
854
+ /** Relation name to count */
855
+ [relationName: string]: boolean;
856
+ };
857
+ };
858
+ /**
859
+ * Clause for selecting specific fields in query results.
860
+ */
861
+ type SelectClause = {
862
+ /** Field name - true to include, false to exclude */
863
+ [fieldName: string]: boolean | CountClause;
864
+ };
865
+ /**
866
+ * Clause for including related records in query results.
867
+ *
868
+ * @example Include with nested query
869
+ * ```typescript
870
+ * {
871
+ * include: {
872
+ * author: true,
873
+ * comments: {
874
+ * where: { approved: true },
875
+ * orderBy: { createdAt: 'desc' },
876
+ * take: 5
877
+ * },
878
+ * _count: { select: { likes: true } }
879
+ * }
880
+ * }
881
+ * ```
882
+ */
883
+ /** Base include options for a relation */
884
+ type IncludeOptions = boolean | {
885
+ where?: WhereClause;
886
+ include?: IncludeClause;
887
+ select?: SelectClause;
888
+ orderBy?: OrderByClause;
889
+ take?: number;
890
+ skip?: number;
891
+ };
892
+ type IncludeClause = {
893
+ /** Relation name - true to include all, or object for nested query */
894
+ [relationName: string]: IncludeOptions | boolean | CountClause;
895
+ } & {
896
+ /** Include counts of related records */
897
+ _count?: boolean | CountClause;
898
+ };
899
+ /**
900
+ * Clause for sorting query results.
901
+ *
902
+ * @example
903
+ * ```typescript
904
+ * { orderBy: { createdAt: 'desc' } }
905
+ * ```
906
+ */
907
+ type OrderByClause = {
908
+ /** Field name to sort by - 'asc' for ascending, 'desc' for descending */
909
+ [fieldName: string]: 'asc' | 'desc';
910
+ };
911
+ /**
912
+ * Main query structure for advanced record querying.
913
+ * Follows Prisma-like syntax for powerful data operations.
914
+ *
915
+ * @example Full query
916
+ * ```typescript
917
+ * {
918
+ * where: { published: { equals: true } },
919
+ * include: { author: true },
920
+ * orderBy: { createdAt: 'desc' },
921
+ * take: 10,
922
+ * skip: 0
923
+ * }
924
+ * ```
925
+ */
926
+ type DataRecordsQuery = {
927
+ /** Filter conditions */
928
+ where?: WhereClause;
929
+ /** Related records to include */
930
+ include?: IncludeClause;
931
+ /** Fields to select (alternative to include) */
932
+ select?: SelectClause;
933
+ /** Sort order */
934
+ orderBy?: OrderByClause;
935
+ /** Maximum records to return (1-100) */
936
+ take?: number;
937
+ /** Records to skip (0-10,000) for offset pagination */
938
+ skip?: number;
939
+ /** Cursor for cursor-based pagination */
940
+ after?: string;
941
+ /** Include record counts */
942
+ _count?: boolean | CountClause;
943
+ };
944
+ /**
945
+ * Parameters for advanced data record queries.
946
+ *
947
+ * @example
948
+ * ```typescript
949
+ * const { data } = await memberstack.queryDataRecords({
950
+ * table: 'posts',
951
+ * query: {
952
+ * where: {
953
+ * published: { equals: true },
954
+ * category: { in: ['tech', 'news'] }
955
+ * },
956
+ * orderBy: { createdAt: 'desc' },
957
+ * take: 10
958
+ * }
959
+ * });
960
+ * ```
961
+ */
962
+ type QueryDataRecordsParams = {
963
+ /** The table key/identifier */
964
+ table: string;
965
+ /** @deprecated Use `table` instead */
966
+ tableKey?: string;
967
+ /** Query configuration */
968
+ query: DataRecordsQuery;
969
+ };
970
+
971
+ /**
972
+ * @fileoverview Response payload types for Memberstack SDK methods.
973
+ * All SDK methods return Promise<PayloadType> where PayloadType wraps the data.
974
+ */
975
+
976
+ /** Response from getApp() - contains app configuration */
977
+ type AppPayload = Response<Payload.Transforms["App"]>;
978
+ /** Response from deleteMember() - contains deletion confirmation */
979
+ type DeleteMemberPayload = Response<Payload.Transforms["DeletedMember"]>;
980
+ /** Response from getAppAndMember() - contains both app and member data */
981
+ type GetAppAndMemberPayload = Response<Payload.Transforms["GetAppAndMember"]>;
982
+ /** Response from addMemberCard() - contains updated member data */
983
+ type AddMemberCardPayload = Response<Payload.Transforms["Member"]>;
984
+ /** Response from cancelPlan() - contains updated member data */
985
+ type CancelPlanPayload = Response<Payload.Transforms["Member"]>;
986
+ /** Response from removePlan() - contains removal confirmation */
987
+ type RemovePlanPayload = Response<Payload.Transforms["RemovePlan"]>;
988
+ /**
989
+ * Response from getCurrentMember() - contains member data or null if not logged in.
990
+ *
991
+ * @example
992
+ * ```typescript
993
+ * const { data: member } = await memberstack.getCurrentMember();
994
+ * if (member) {
995
+ * console.log('Logged in:', member.auth.email);
996
+ * }
997
+ * ```
998
+ */
999
+ type GetCurrentMemberPayload = Response<Payload.Transforms["Member"] | null>;
1000
+ /** Response from getMemberJSON() - contains member's JSON store */
1001
+ type GetMemberJSONPayload = Response<Payload.Transforms["MemberJSON"]>;
1002
+ /** Response from getMemberCards() - contains array of saved payment cards */
1003
+ type GetMemberCardsPayload = Response<Payload.Transforms["MemberCard"][]>;
1004
+ /** Response from connectProvider()/disconnectProvider() - contains updated auth providers */
1005
+ type ConnectProviderPayload = Response<Payload.Transforms["AuthProviders"]>;
1006
+ /** Response from getMemberInvoices() - paginated list of invoices */
1007
+ type GetMemberInvoicesPayload = PaginatedResponse<Payload.Transforms["MemberInvoice"]>;
1008
+ /** Response from getMemberReceipts() - paginated list of receipts */
1009
+ type GetMemberReceiptsPayload = PaginatedResponse<Payload.Transforms["MemberReceipt"]>;
1010
+ /** Response from updateMemberProfileImage() - contains new profile image URL */
1011
+ type UpdateMemberProfileImagePayload = Response<{
1012
+ profileImage: string;
1013
+ }>;
1014
+ /** Response from deleteMemberProfileImage() - confirms profile image was removed */
1015
+ type DeleteMemberProfileImagePayload = Response<{
1016
+ profileImage: null;
1017
+ }>;
1018
+ /** Response from getSecureContent() - contains the gated content HTML */
1019
+ type GetSecureContentPayload = Response<Payload.Transforms["SecureContent"]>;
1020
+ /** Response from setPassword() - contains updated member data */
1021
+ type SetPasswordPayload = Response<Payload.Transforms["Member"]>;
1022
+ /** Response from getRestrictedUrlGroups() - array of content access groups */
1023
+ type GetRestrictedUrlGroupsPayload = Response<Payload.Transforms["RestrictedUrlGroup"][]>;
1024
+ /** Response from getPlans() - array of available plans */
1025
+ type GetPlansPayload = Response<Payload.Transforms["Plan"][]>;
1026
+ /** Response from getPlan() - single plan details */
1027
+ type GetPlanPayload = Response<Payload.Transforms["Plan"]>;
1028
+ /**
1029
+ * Response from loginMemberEmailPassword() - contains member and tokens.
1030
+ *
1031
+ * @example
1032
+ * ```typescript
1033
+ * const { data } = await memberstack.loginMemberEmailPassword({
1034
+ * email: 'user@example.com',
1035
+ * password: 'password123'
1036
+ * });
1037
+ * console.log('Logged in:', data.member.auth.email);
1038
+ * ```
1039
+ */
1040
+ type LoginMemberEmailPasswordPayload = Response<Payload.Transforms["MemberAuth"]>;
1041
+ /** Response from sendMemberLoginPasswordlessEmail() - success indicator */
1042
+ type SendMemberLoginPasswordlessEmailPayload = Response<{
1043
+ success: boolean;
1044
+ }>;
1045
+ /** Response from logout() - optional redirect URL */
1046
+ type LogoutMemberPayload = Response<{
1047
+ redirect?: string;
1048
+ }>;
1049
+ /** Response from purchasePlans() - contains purchase details */
1050
+ type PurchasePlansPayload = Response<Payload.Transforms["Purchase"]>;
1051
+ /** Response from addPlan() - contains updated plan connections */
1052
+ type AddPlanPayload = Response<Payload.Transforms["AddPlan"]>;
1053
+ /** Response from purchasePlansWithCheckout() - contains Stripe checkout URL */
1054
+ type PurchasePlansWithCheckoutPayload = Response<Payload.Transforms["PurchaseWithCheckout"]>;
1055
+ /** Response from launchStripeCustomerPortal() - contains portal URL */
1056
+ type LaunchStripeCustomerPortalPayload = Response<Payload.Transforms["LaunchStripeCustomerPortal"]>;
1057
+ /** Response from openStripeCustomerPortal() - contains portal URL */
1058
+ type OpenStripeCustomerPortalPayload = Response<Payload.Transforms["OpenStripeCustomerPortal"]>;
1059
+ /**
1060
+ * Response from signupMemberEmailPassword() - contains new member and tokens.
1061
+ *
1062
+ * @example
1063
+ * ```typescript
1064
+ * const { data } = await memberstack.signupMemberEmailPassword({
1065
+ * email: 'newuser@example.com',
1066
+ * password: 'password123'
1067
+ * });
1068
+ * console.log('Signed up:', data.member.id);
1069
+ * ```
1070
+ */
1071
+ type SignupMemberEmailPasswordPayload = Response<Payload.Transforms["MemberAuth"]>;
1072
+ /** Response from signupMemberAuthProvider() - contains member and tokens */
1073
+ type SignupMemberAuthProviderPayload = Response<Payload.Transforms["MemberAuth"]>;
1074
+ /** Response from updateDefaultCard() - contains updated member data */
1075
+ type UpdateDefaultCardPayload = Response<Payload.Transforms["Member"]>;
1076
+ /** Response from updateMemberAuth() - contains updated member data */
1077
+ type UpdateMemberAuthPayload = Response<Payload.Transforms["Member"]>;
1078
+ /** Response from updateMember() - contains updated member data */
1079
+ type UpdateMemberPayload = Response<Payload.Transforms["Member"]>;
1080
+ /** Response from updatePlanPayment() - contains updated member data */
1081
+ type UpdatePlanPaymentPayload = Response<Payload.Transforms["Member"]>;
1082
+ /** Response from refreshMemberTokens() - contains new access tokens */
1083
+ type RefreshMemberTokensPayload = Response<Payload.Transforms["MemberAuth"]["tokens"]>;
1084
+ /** Response from sendMemberResetPasswordEmail() - success message */
1085
+ type SendMemberResetPasswordEmailPayload = Response<string>;
1086
+ /** Response from replacePlan() - contains purchase/upgrade details */
1087
+ type ReplacePlanPayload = Response<Payload.Transforms["Purchase"]>;
1088
+ /** Response from getAuthProviders() - array of configured OAuth providers */
1089
+ type GetAuthProvidersPayload = Response<Payload.Transforms["AuthProvider"][]>;
1090
+ /** Response from getTotalCheckoutAmount() - calculated checkout total */
1091
+ type GetTotalCheckoutAmountPayload = Response<Payload.Transforms["TotalCheckoutAmount"]>;
1092
+ /** Response from getAuthenticationClientSecret() - Stripe client secret for SCA */
1093
+ type GetAuthenticationClientSecretPayload = Response<Payload.Transforms["AuthenticationClientSecret"]>;
1094
+ /** Response from sendMemberVerificationEmail() - success indicator */
1095
+ type SendMemberVerificationEmailPayload = Response<Payload.Transforms["SendMemberVerificationEmail"]>;
1096
+ /** Response from resetMemberPassword() - success indicator */
1097
+ type ResetMemberPasswordPayload = Response<Payload.Transforms["ResetMemberPassword"]>;
1098
+ /** @deprecated Use `ResetMemberPasswordPayload` instead (typo fix) */
1099
+ type ResetMemberPassworPayload = ResetMemberPasswordPayload;
1100
+ /** Response from getPosts() - contains posts array */
1101
+ type GetPostsPayload = Response<Payload.Transforms["Posts"]>;
1102
+ /** Response from getThreads() - contains threads array */
1103
+ type GetThreadsPayload = Response<Payload.Transforms["Threads"]>;
1104
+ /** Response from createPost() - contains created post */
1105
+ type CreatePostPayload = Response<Payload.Transforms["Post"]>;
1106
+ /** Response from createThread() - contains created thread */
1107
+ type CreateThreadPayload = Response<Payload.Transforms["Thread"]>;
1108
+ /** Response from updatePost() - contains updated post */
1109
+ type UpdatePostPayload = Response<Payload.Transforms["Post"]>;
1110
+ /** Response from updateThread() - contains updated thread */
1111
+ type UpdateThreadPayload = Response<Payload.Transforms["Thread"]>;
1112
+ /**
1113
+ * Response from getDataTables() - list of all data tables.
1114
+ *
1115
+ * @example
1116
+ * ```typescript
1117
+ * const { data } = await memberstack.getDataTables();
1118
+ * data.tables.forEach(table => console.log(table.name, table.key));
1119
+ * ```
1120
+ */
1121
+ type GetDataTablesPayload = Response<{
1122
+ tables: DataTableResponse[];
1123
+ }>;
1124
+ /**
1125
+ * Response from getDataTable() - single table schema.
1126
+ *
1127
+ * @example
1128
+ * ```typescript
1129
+ * const { data: table } = await memberstack.getDataTable({ table: 'posts' });
1130
+ * console.log('Fields:', table.fields.map(f => f.name));
1131
+ * ```
1132
+ */
1133
+ type GetDataTablePayload = Response<DataTableResponse>;
1134
+ /**
1135
+ * Response from getDataRecords() - paginated records list.
1136
+ *
1137
+ * @example
1138
+ * ```typescript
1139
+ * const { data } = await memberstack.getDataRecords({ table: 'posts', limit: 10 });
1140
+ * console.log('Records:', data.records.length);
1141
+ * console.log('Has more:', data.pagination.hasMore);
1142
+ * ```
1143
+ */
1144
+ type GetDataRecordsPayload = Response<{
1145
+ /** Array of data records */
1146
+ records: DataRecordResponse[];
1147
+ /** Pagination information */
1148
+ pagination: {
1149
+ /** Number of records returned */
1150
+ limit: number;
1151
+ /** Cursor for next page (null if no more) */
1152
+ endCursor: number | null;
1153
+ /** Whether more records exist */
1154
+ hasMore: boolean;
1155
+ };
1156
+ }>;
1157
+ /** Response from createDataRecord() - the created record */
1158
+ type CreateDataRecordPayload = Response<DataRecordResponse>;
1159
+ /** Response from getDataRecord() - single record data */
1160
+ type GetDataRecordPayload = Response<DataRecordResponse>;
1161
+ /** Response from updateDataRecord() - the updated record */
1162
+ type UpdateDataRecordPayload = Response<DataRecordResponse>;
1163
+ /** Response from deleteDataRecord() - deleted record ID */
1164
+ type DeleteDataRecordPayload = Response<{
1165
+ id: string;
1166
+ }>;
1167
+ /**
1168
+ * Response from queryDataRecords() - advanced query results.
1169
+ * Can return either records with pagination or a count result.
1170
+ *
1171
+ * @example Records response
1172
+ * ```typescript
1173
+ * const { data } = await memberstack.queryDataRecords({
1174
+ * table: 'posts',
1175
+ * query: { where: { published: { equals: true } }, take: 10 }
1176
+ * });
1177
+ * if ('records' in data) {
1178
+ * console.log('Found:', data.records.length);
1179
+ * }
1180
+ * ```
1181
+ */
1182
+ type QueryDataRecordsPayload = Response<{
1183
+ /** Array of matching records */
1184
+ records: QueryDataRecordResponse[];
1185
+ /** Pagination info (if applicable) */
1186
+ pagination?: {
1187
+ limit: number;
1188
+ hasMore: boolean;
1189
+ endCursor: number;
1190
+ };
1191
+ }> | Response<{
1192
+ /** Count result when using _count query */
1193
+ _count: number;
1194
+ }>;
1195
+ /**
1196
+ * Data table schema and configuration.
1197
+ */
1198
+ type DataTableResponse = {
1199
+ /** Unique table ID */
1200
+ id: string;
1201
+ /** Table key/slug for API calls */
1202
+ key: string;
1203
+ /** Display name */
1204
+ name: string;
1205
+ /** Create permission rule */
1206
+ createRule: string;
1207
+ /** Read permission rule */
1208
+ readRule: string;
1209
+ /** Update permission rule */
1210
+ updateRule: string;
1211
+ /** Delete permission rule */
1212
+ deleteRule: string;
1213
+ /** ISO timestamp of creation */
1214
+ createdAt: string;
1215
+ /** ISO timestamp of last update */
1216
+ updatedAt?: string;
1217
+ /** Total number of records in table */
1218
+ recordCount: number;
1219
+ /** Array of field definitions */
1220
+ fields: {
1221
+ /** Unique field ID */
1222
+ id: string;
1223
+ /** Field key for data access */
1224
+ key: string;
1225
+ /** Display name */
1226
+ name: string;
1227
+ /** Field type (text, number, boolean, date, reference, etc.) */
1228
+ type: string;
1229
+ /** Whether field is required */
1230
+ required: boolean;
1231
+ /** Default value if not provided */
1232
+ defaultValue?: any;
1233
+ /** Display order in table */
1234
+ tableOrder?: number;
1235
+ /** For reference fields: ID of referenced table */
1236
+ referencedTableId?: string;
1237
+ /** For reference fields: referenced table info */
1238
+ referencedTable?: {
1239
+ id: string;
1240
+ key: string;
1241
+ name: string;
1242
+ };
1243
+ }[];
1244
+ };
1245
+ /**
1246
+ * Single data record from a table.
1247
+ */
1248
+ type DataRecordResponse = {
1249
+ /** Unique record ID */
1250
+ id: string;
1251
+ /** Key of the table this record belongs to */
1252
+ tableKey: string;
1253
+ /** ID of member who created this record (if applicable) */
1254
+ createdByMemberId?: string;
1255
+ /** Record data as key-value pairs */
1256
+ data: Record<string, any>;
1257
+ /** ISO timestamp of creation */
1258
+ createdAt: string;
1259
+ /** ISO timestamp of last update */
1260
+ updatedAt: string;
1261
+ /** Internal ordering value for pagination */
1262
+ internalOrder: number;
1263
+ /** Whether current authenticated member owns this record */
1264
+ activeMemberOwnsIt: boolean;
1265
+ };
1266
+ /**
1267
+ * Result of a reference field connect/disconnect operation.
1268
+ */
1269
+ type ReferenceFieldResult = {
1270
+ /** Number of records affected */
1271
+ count: number;
1272
+ /** Action that was performed */
1273
+ action: 'connected' | 'disconnected' | 'unchanged';
1274
+ };
1275
+ /**
1276
+ * Result of a member reference field operation.
1277
+ */
1278
+ type MemberReferenceFieldResult = {
1279
+ /** Number of records affected */
1280
+ count: number;
1281
+ /** Whether the current member is referenced */
1282
+ hasself: boolean;
1283
+ /** Action that was performed */
1284
+ action: 'connected' | 'disconnected' | 'unchanged';
1285
+ };
1286
+ /**
1287
+ * Enhanced record response for query API including relationships.
1288
+ */
1289
+ type QueryDataRecordResponse = DataRecordResponse & {
1290
+ /** Included relationships appear as top-level properties */
1291
+ [relationName: string]: any;
1292
+ /** Count of related records when using _count */
1293
+ _count?: Record<string, number>;
1294
+ };
1295
+ /**
1296
+ * Paginated response wrapper for list endpoints.
1297
+ */
1298
+ type PaginatedResponse<T> = {
1299
+ /** Whether more pages exist */
1300
+ hasNext: boolean;
1301
+ /** Cursor for fetching next page */
1302
+ endCursor: string | null;
1303
+ /** Total count of all matching items */
1304
+ totalCount: number;
1305
+ /** Array of items for current page */
1306
+ data: T[];
1307
+ };
1308
+ /**
1309
+ * Standard response wrapper - all SDK methods return this shape.
1310
+ */
1311
+ type Response<T> = {
1312
+ /** The response data */
1313
+ data: T;
1314
+ };
1315
+
1316
+ interface MemberstackOptions {
1317
+ token?: BearerToken;
1318
+ /** @internal Used by Webflow package to include content groups in response */
1319
+ includeContentGroups?: boolean;
1320
+ /** @internal Used by Webflow package to identify requests from Webflow integration */
1321
+ isWebflow?: boolean;
1322
+ }
1323
+ interface GetCurrentMemberParams {
1324
+ useCache?: boolean;
1325
+ }
1326
+ type BearerToken = string;
1327
+
1328
+ /**
1329
+ * Memberstack UI Translation Keys
1330
+ *
1331
+ * Define custom translations for the Memberstack pre-built UI modals.
1332
+ * All keys are optional - any undefined keys will use the default English text.
1333
+ */
1334
+ interface MemberstackTranslations {
1335
+ email_address?: string;
1336
+ email_error_message?: string;
1337
+ password?: string;
1338
+ password_error_message?: string;
1339
+ forgot_password?: string;
1340
+ login_to_your_account?: string;
1341
+ login_email_placeholder?: string;
1342
+ login_password_placeholder?: string;
1343
+ login?: string;
1344
+ login_with_email?: string;
1345
+ login_with_password?: string;
1346
+ dont_have_an_account?: string;
1347
+ continue_with?: string;
1348
+ or?: string;
1349
+ continue_with_email?: string;
1350
+ signup_with_password?: string;
1351
+ create_an_account?: string;
1352
+ already_have_an_account?: string;
1353
+ signup_button?: string;
1354
+ signup_email_placeholder?: string;
1355
+ signup_password_placeholder?: string;
1356
+ reset_your_password?: string;
1357
+ reset_instructions?: string;
1358
+ reset_email_placeholder?: string;
1359
+ reset?: string;
1360
+ reset_already_have_code?: string;
1361
+ reset_enter_code?: string;
1362
+ reset_password_placeholder?: string;
1363
+ reset_confirm_reset?: string;
1364
+ passwordless_token_heading?: string;
1365
+ login_passwordless_instructions?: string;
1366
+ login_verification_code?: string;
1367
+ login_verify_email?: string;
1368
+ test_card_title?: string;
1369
+ test_card_subtitle?: string;
1370
+ test_card_copy_button?: string;
1371
+ test_card_copied_button?: string;
1372
+ test_successful_payments?: string;
1373
+ test_declined_payments?: string;
1374
+ test_card_visa?: string;
1375
+ test_card_mastercard?: string;
1376
+ test_card_amex?: string;
1377
+ test_card_generic_decline?: string;
1378
+ test_card_insufficient_funds?: string;
1379
+ test_card_instructions?: string;
1380
+ test_card_continue?: string;
1381
+ test_card_alternatives?: string;
1382
+ success_title?: string;
1383
+ password_reset_success?: string;
1384
+ save_button?: string;
1385
+ cancel_button?: string;
1386
+ copy_button?: string;
1387
+ copied_button?: string;
1388
+ remove_button?: string;
1389
+ upgrade_button?: string;
1390
+ delete_account?: string;
1391
+ set_password?: string;
1392
+ change_password?: string;
1393
+ connect_additional_accounts?: string;
1394
+ disconnect_provider?: string;
1395
+ connect_with_provider?: string;
1396
+ delete_confirmation_title?: string;
1397
+ delete_confirmation_message?: string;
1398
+ yes_delete_account?: string;
1399
+ team_title?: string;
1400
+ loading_text?: string;
1401
+ regenerate_invite_link?: string;
1402
+ seats_full_warning?: string;
1403
+ are_you_sure?: string;
1404
+ member_avatar_alt?: string;
1405
+ plans_title?: string;
1406
+ paid_plans?: string;
1407
+ team_plans?: string;
1408
+ free_plans?: string;
1409
+ no_plans_message?: string;
1410
+ manage_subscriptions?: string;
1411
+ leave_team?: string;
1412
+ profile_button?: string;
1413
+ security_button?: string;
1414
+ plans_button?: string;
1415
+ team_button?: string;
1416
+ logout_button?: string;
1417
+ profile_information_title?: string;
1418
+ security_title?: string;
1419
+ upload_profile_image?: string;
1420
+ replace_image?: string;
1421
+ }
1422
+ declare global {
1423
+ interface Window {
1424
+ memberstackTranslations?: MemberstackTranslations;
1425
+ }
1426
+ }
1427
+
1428
+ /**
1429
+ * Configuration options for initializing the Memberstack SDK.
1430
+ */
1431
+ type DOMConfig = {
1432
+ /**
1433
+ * Your Memberstack public API key.
1434
+ * - Sandbox keys start with `pk_sb_` (use for development/testing)
1435
+ * - Live keys start with `pk_` (use for production)
1436
+ * @example "pk_sb_abc123def456"
1437
+ */
1438
+ publicKey: string;
1439
+ /**
1440
+ * Optional app ID for multi-app configurations.
1441
+ * Only needed if you have multiple Memberstack apps.
1442
+ */
1443
+ appId?: string;
1444
+ /**
1445
+ * Enable cookie-based session storage.
1446
+ * Recommended when you need sessions to persist across subdomains.
1447
+ * @default false
1448
+ */
1449
+ useCookies?: boolean;
1450
+ /**
1451
+ * When `useCookies` is true, set cookies on the root domain.
1452
+ * This allows session sharing across subdomains (e.g., app.example.com and www.example.com).
1453
+ * @default false
1454
+ */
1455
+ setCookieOnRootDomain?: boolean;
1456
+ /**
1457
+ * Custom API domain for enterprise or self-hosted deployments.
1458
+ * Most users don't need to set this.
1459
+ */
1460
+ domain?: string;
1461
+ /**
1462
+ * Enable debug mode for verbose console logging.
1463
+ * Useful during development to see API calls, auth state changes, and errors.
1464
+ * Also exposes `window.__MEMBERSTACK_DEBUG__` for DevTools inspection.
1465
+ * @default false
1466
+ *
1467
+ * @example
1468
+ * ```typescript
1469
+ * const memberstack = MemberstackDOM.init({
1470
+ * publicKey: 'pk_sb_...',
1471
+ * debug: true // Enable in development
1472
+ * });
1473
+ * ```
1474
+ */
1475
+ debug?: boolean;
1476
+ /**
1477
+ * @deprecated This option is no longer used. Session duration is controlled server-side.
1478
+ * @internal
1479
+ */
1480
+ sessionDurationDays?: number;
1481
+ };
1482
+
1483
+ /**
1484
+ * @fileoverview Error handling utilities for Memberstack SDK.
1485
+ * Provides type guards and helper functions for working with SDK errors.
1486
+ *
1487
+ * Error codes align with the REST API error codes returned by the Memberstack API.
1488
+ * See: https://docs.memberstack.com/errors
1489
+ */
1490
+ /**
1491
+ * Error category for organizing errors
1492
+ */
1493
+ type ErrorCategory = 'authentication' | 'authorization' | 'validation' | 'not_found' | 'conflict' | 'payment' | 'limit' | 'account' | 'data_tables' | 'network' | 'unknown';
1494
+ /**
1495
+ * Shape of errors returned by Memberstack SDK methods.
1496
+ * Errors contain a code for programmatic handling and a message for display.
1497
+ */
1498
+ interface MemberstackErrorShape {
1499
+ /** Error code for programmatic handling (e.g., 'invalid-credentials', 'client/invalid-token') */
1500
+ code: string;
1501
+ /** Human-readable error message */
1502
+ message: string;
1503
+ /** HTTP status code (if applicable) */
1504
+ statusCode?: number;
1505
+ /** Error category for grouping related errors */
1506
+ category?: ErrorCategory;
1507
+ /** Actionable suggestions for resolving the error */
1508
+ suggestions?: string[];
1509
+ /** URL to documentation for this error */
1510
+ docsUrl?: string;
1511
+ }
1512
+ /**
1513
+ * Common Memberstack error codes for reference.
1514
+ * Use these for programmatic error handling.
1515
+ *
1516
+ * These codes align with the REST API error codes returned by the Memberstack API.
1517
+ * Use `isErrorCode()` or `getErrorCode()` to check errors against these values.
1518
+ *
1519
+ * @example
1520
+ * ```typescript
1521
+ * import { ErrorCodes, isErrorCode } from '@memberstack/dom';
1522
+ *
1523
+ * try {
1524
+ * await memberstack.loginMemberEmailPassword({ email, password });
1525
+ * } catch (error) {
1526
+ * if (isErrorCode(error, ErrorCodes.INVALID_CREDENTIALS)) {
1527
+ * showError('Wrong email or password');
1528
+ * }
1529
+ * }
1530
+ * ```
1531
+ */
1532
+ declare const ErrorCodes: {
1533
+ /** Email or password is incorrect */
1534
+ readonly INVALID_CREDENTIALS: "invalid-credentials";
1535
+ /** Authentication token is invalid or expired */
1536
+ readonly INVALID_TOKEN: "client/invalid-token";
1537
+ /** No member found with this identifier */
1538
+ readonly MEMBER_NOT_FOUND: "member-not-found";
1539
+ /** Password reset code is invalid or expired */
1540
+ readonly INVALID_RESET_CODE: "invalid-reset-code";
1541
+ /** Passwordless verification code is invalid or expired */
1542
+ readonly INVALID_PASSWORDLESS_CODE: "invalid-passwordless-login-code";
1543
+ /** Must be logged in to perform this action */
1544
+ readonly LOGIN_REQUIRED: "login-required";
1545
+ /** An account with this email already exists */
1546
+ readonly EMAIL_ALREADY_EXISTS: "email-already-in-use";
1547
+ /** Account uses social login - use social provider to sign in */
1548
+ readonly USE_SOCIAL_LOGIN: "use-social-login";
1549
+ /** Account uses email/password - use email to sign in */
1550
+ readonly USE_EMAIL_LOGIN: "use-email-login";
1551
+ /** No password set for this account */
1552
+ readonly NO_PASSWORD_SET: "no-password-set";
1553
+ /** Social account already connected */
1554
+ readonly ACCOUNT_ALREADY_CONNECTED: "account-already-connected";
1555
+ /** Social account not connected to this member */
1556
+ readonly ACCOUNT_NOT_CONNECTED: "account-not-connected";
1557
+ /** Failed to connect social account */
1558
+ readonly ACCOUNT_CONNECT_FAILED: "account-connect-failed";
1559
+ /** Must be logged in to connect accounts */
1560
+ readonly ACCOUNT_CONNECT_REQUIRES_LOGIN: "account-connect-requires-login";
1561
+ /** Set password before disconnecting last provider */
1562
+ readonly ACCOUNT_SET_PASSWORD_FIRST: "account-set-password-before-disconnect";
1563
+ /** No account found with these credentials */
1564
+ readonly ACCOUNT_NOT_FOUND: "account-not-found";
1565
+ /** Email format is invalid */
1566
+ readonly INVALID_EMAIL: "invalid-email";
1567
+ /** Password is incorrect */
1568
+ readonly INVALID_PASSWORD: "invalid-password";
1569
+ /** Password must be at least 8 characters */
1570
+ readonly PASSWORD_TOO_SHORT: "invalid-password-too-short";
1571
+ /** A required field is missing */
1572
+ readonly REQUIRED_FIELD_MISSING: "required-field-missing";
1573
+ /** CAPTCHA verification failed */
1574
+ readonly INVALID_CAPTCHA: "invalid-captcha";
1575
+ /** Plan does not exist */
1576
+ readonly PLAN_NOT_FOUND: "plan-not-found";
1577
+ /** Member does not have this plan */
1578
+ readonly NO_PLAN_FOUND: "no-plan-found";
1579
+ /** Member already has this plan */
1580
+ readonly ALREADY_HAS_PLAN: "already-have-plan";
1581
+ /** Plan requires payment */
1582
+ readonly PLAN_NOT_FREE: "plan-not-free";
1583
+ /** Plan member limit reached */
1584
+ readonly PLAN_MEMBER_LIMIT_REACHED: "plan-member-limit-reached";
1585
+ /** Plan restricted to admin assignment only */
1586
+ readonly PLAN_RESTRICTED_TO_ADMIN: "plan-restricted-to-admin";
1587
+ /** Email domain not permitted for this plan */
1588
+ readonly DOMAIN_NOT_PERMITTED: "domain-not-permitted";
1589
+ /** Pricing option no longer available */
1590
+ readonly PRICE_NOT_AVAILABLE: "price-no-longer-available";
1591
+ /** Team has reached its seat limit */
1592
+ readonly TEAM_FULL: "team-full";
1593
+ /** Can only belong to one active team */
1594
+ readonly ONE_ACTIVE_TEAM_ONLY: "can-only-have-one-active-team";
1595
+ /** Remove team members before making this change */
1596
+ readonly CANNOT_CHANGE_TEAM: "cannot-change-team-account";
1597
+ /** Only PNG, JPG, JPEG files supported */
1598
+ readonly INVALID_FILE_TYPE: "invalid-file-type";
1599
+ /** File exceeds 1MB size limit */
1600
+ readonly FILE_TOO_LARGE: "file-size-too-large";
1601
+ /** Data table not found */
1602
+ readonly DATA_TABLE_NOT_FOUND: "data-table-not-found";
1603
+ /** Data record not found */
1604
+ readonly DATA_RECORD_NOT_FOUND: "data-record-not-found";
1605
+ /** Invalid table key format */
1606
+ readonly INVALID_TABLE_KEY: "invalid-table-key";
1607
+ /** Value must be unique */
1608
+ readonly UNIQUE_CONSTRAINT_VIOLATION: "unique-constraint-violation";
1609
+ /** Maximum fields reached for table */
1610
+ readonly FIELD_LIMIT_EXCEEDED: "field-limit-exceeded";
1611
+ /** Field type not supported */
1612
+ readonly INVALID_FIELD_TYPE: "invalid-field-type";
1613
+ /** Field value doesn't match expected type */
1614
+ readonly INVALID_FIELD_VALUE: "invalid-field-value";
1615
+ /** No permission to access this resource */
1616
+ readonly ACCESS_DENIED: "access-denied";
1617
+ /** Application not found */
1618
+ readonly APP_NOT_FOUND: "app-not-found";
1619
+ /** Sandbox mode limited to 50 members */
1620
+ readonly TEST_MODE_LIMIT_REACHED: "test-mode-member-limit-reached";
1621
+ /** Network request failed */
1622
+ readonly NETWORK_ERROR: "network-error";
1623
+ /** Unknown error occurred */
1624
+ readonly UNKNOWN_ERROR: "unknown-error";
1625
+ };
1626
+ /** Type for error code values */
1627
+ type ErrorCode = typeof ErrorCodes[keyof typeof ErrorCodes];
1628
+ /**
1629
+ * Type guard to check if an error is a Memberstack SDK error.
1630
+ * Memberstack errors have a `code` and `message` property.
1631
+ *
1632
+ * @param error - The error to check
1633
+ * @returns True if the error matches the Memberstack error shape
1634
+ *
1635
+ * @example
1636
+ * ```typescript
1637
+ * try {
1638
+ * await memberstack.loginMemberEmailPassword({ email, password });
1639
+ * } catch (error) {
1640
+ * if (isMemberstackError(error)) {
1641
+ * console.log('Memberstack error:', error.code);
1642
+ * // Handle based on error code
1643
+ * if (isErrorCode(error, ErrorCodes.INVALID_CREDENTIALS)) {
1644
+ * showMessage('Invalid email or password');
1645
+ * }
1646
+ * } else {
1647
+ * console.error('Unexpected error:', error);
1648
+ * }
1649
+ * }
1650
+ * ```
1651
+ */
1652
+ declare function isMemberstackError(error: unknown): error is MemberstackErrorShape;
1653
+ /**
1654
+ * Safely extracts an error message from any error type.
1655
+ * Handles Memberstack errors, standard Error objects, and unknown errors.
1656
+ *
1657
+ * @param error - The error to extract a message from
1658
+ * @param defaultMessage - Optional default message if no message can be extracted
1659
+ * @returns A human-readable error message
1660
+ *
1661
+ * @example
1662
+ * ```typescript
1663
+ * try {
1664
+ * await memberstack.signupMemberEmailPassword({ email, password });
1665
+ * } catch (error) {
1666
+ * const message = getErrorMessage(error);
1667
+ * showToast(message);
1668
+ * }
1669
+ * ```
1670
+ */
1671
+ declare function getErrorMessage(error: unknown, defaultMessage?: string): string;
1672
+ /**
1673
+ * Safely extracts an error code from any error type.
1674
+ * Returns undefined if no code can be extracted.
1675
+ *
1676
+ * @param error - The error to extract a code from
1677
+ * @returns The error code or undefined
1678
+ *
1679
+ * @example
1680
+ * ```typescript
1681
+ * try {
1682
+ * await memberstack.loginMemberEmailPassword({ email, password });
1683
+ * } catch (error) {
1684
+ * const code = getErrorCode(error);
1685
+ * switch (code) {
1686
+ * case ErrorCodes.INVALID_CREDENTIALS:
1687
+ * showError('Wrong email or password');
1688
+ * break;
1689
+ * case ErrorCodes.EMAIL_ALREADY_EXISTS:
1690
+ * showError('An account with this email already exists');
1691
+ * break;
1692
+ * default:
1693
+ * showError('Something went wrong');
1694
+ * }
1695
+ * }
1696
+ * ```
1697
+ */
1698
+ declare function getErrorCode(error: unknown): string | undefined;
1699
+ /**
1700
+ * Checks if an error is a specific Memberstack error code.
1701
+ * Supports both the new kebab-case API codes and legacy SCREAMING_SNAKE_CASE constants.
1702
+ *
1703
+ * @param error - The error to check
1704
+ * @param code - The error code to match (use ErrorCodes constant)
1705
+ * @returns True if the error matches the specified code
1706
+ *
1707
+ * @example
1708
+ * ```typescript
1709
+ * import { ErrorCodes, isErrorCode } from '@memberstack/dom';
1710
+ *
1711
+ * try {
1712
+ * await memberstack.loginMemberEmailPassword({ email, password });
1713
+ * } catch (error) {
1714
+ * if (isErrorCode(error, ErrorCodes.INVALID_CREDENTIALS)) {
1715
+ * // Handle invalid credentials specifically
1716
+ * } else if (isErrorCode(error, ErrorCodes.USE_SOCIAL_LOGIN)) {
1717
+ * // Prompt user to sign in with social provider
1718
+ * }
1719
+ * }
1720
+ * ```
1721
+ */
1722
+ declare function isErrorCode(error: unknown, code: string): boolean;
1723
+ /**
1724
+ * Gets actionable suggestions for resolving an error.
1725
+ * Returns an empty array if no suggestions are available.
1726
+ *
1727
+ * @param error - The error to get suggestions for
1728
+ * @returns Array of suggestion strings
1729
+ *
1730
+ * @example
1731
+ * ```typescript
1732
+ * try {
1733
+ * await memberstack.loginMemberEmailPassword({ email, password });
1734
+ * } catch (error) {
1735
+ * const suggestions = getErrorSuggestions(error);
1736
+ * if (suggestions.length > 0) {
1737
+ * console.log('Try:', suggestions[0]);
1738
+ * }
1739
+ * }
1740
+ * ```
1741
+ */
1742
+ declare function getErrorSuggestions(error: unknown): string[];
1743
+ /**
1744
+ * Gets the documentation URL for an error.
1745
+ * Returns undefined if no docs URL is available.
1746
+ *
1747
+ * @param error - The error to get docs URL for
1748
+ * @returns Documentation URL or undefined
1749
+ *
1750
+ * @example
1751
+ * ```typescript
1752
+ * try {
1753
+ * await memberstack.loginMemberEmailPassword({ email, password });
1754
+ * } catch (error) {
1755
+ * const docsUrl = getErrorDocsUrl(error);
1756
+ * if (docsUrl) {
1757
+ * console.log('Learn more:', docsUrl);
1758
+ * }
1759
+ * }
1760
+ * ```
1761
+ */
1762
+ declare function getErrorDocsUrl(error: unknown): string | undefined;
1763
+ /**
1764
+ * Gets the category for an error.
1765
+ *
1766
+ * @param error - The error to get category for
1767
+ * @returns Error category or 'unknown'
1768
+ */
1769
+ declare function getErrorCategory(error: unknown): ErrorCategory;
1770
+ /**
1771
+ * Creates a formatted error message suitable for user display.
1772
+ * Uses enhanced metadata when available for better messages.
1773
+ *
1774
+ * @param error - The error to format
1775
+ * @returns A user-friendly error message
1776
+ *
1777
+ * @example
1778
+ * ```typescript
1779
+ * try {
1780
+ * await memberstack.signupMemberEmailPassword({ email, password });
1781
+ * } catch (error) {
1782
+ * showToast(formatErrorForUser(error));
1783
+ * }
1784
+ * ```
1785
+ */
1786
+ declare function formatErrorForUser(error: unknown): string;
1787
+ /**
1788
+ * Creates a detailed error report for debugging.
1789
+ * Includes all available information about the error.
1790
+ *
1791
+ * @param error - The error to create a report for
1792
+ * @returns Detailed error information
1793
+ *
1794
+ * @example
1795
+ * ```typescript
1796
+ * try {
1797
+ * await memberstack.loginMemberEmailPassword({ email, password });
1798
+ * } catch (error) {
1799
+ * const report = getErrorReport(error);
1800
+ * console.error('Error details:', report);
1801
+ * // Send to error tracking service
1802
+ * errorTracker.capture(report);
1803
+ * }
1804
+ * ```
1805
+ */
1806
+ declare function getErrorReport(error: unknown): {
1807
+ code: string | undefined;
1808
+ message: string;
1809
+ category: ErrorCategory;
1810
+ statusCode: number | undefined;
1811
+ suggestions: string[];
1812
+ docsUrl: string | undefined;
1813
+ };
9
1814
 
10
1815
  declare const _default: {
11
1816
  init: (props: DOMConfig) => {
12
1817
  openModal: (type: "LOGIN" | "SIGNUP" | "FORGOT_PASSWORD" | "RESET_PASSWORD" | "PROFILE", params?: {
13
- [key: string]: any;
14
- translations?: MemberstackTranslations;
1818
+ [key: string]: unknown;
1819
+ translations?: MemberstackTranslations | undefined;
15
1820
  }) => Promise<unknown>;
16
1821
  hideModal: () => void;
17
- _hideLoader: (element?: any) => void;
18
- _showLoader: (element?: any) => void;
19
- _showMessage: (msg: any, isError: any) => Promise<void>;
1822
+ preloadModals: () => Promise<void>;
1823
+ _hideLoader: (element?: HTMLElement | undefined) => void;
1824
+ _showLoader: (element?: HTMLElement | undefined) => void;
1825
+ _showMessage: (msg: string, isError?: boolean | undefined) => Promise<void>;
20
1826
  getMemberCookie: () => any;
21
- onAuthChange: (cb: any) => {
1827
+ onAuthChange: (cb: (member: {
1828
+ id: string;
1829
+ verified: boolean;
1830
+ profileImage: string;
1831
+ auth: {
1832
+ email: string;
1833
+ hasPassword: boolean;
1834
+ providers: {
1835
+ provider: string;
1836
+ }[];
1837
+ };
1838
+ loginRedirect: string;
1839
+ stripeCustomerId: string;
1840
+ createdAt: string;
1841
+ metaData: Record<string, unknown>;
1842
+ customFields: Record<string, unknown>;
1843
+ permissions: [] | string[];
1844
+ planConnections: {
1845
+ id: string;
1846
+ active: boolean;
1847
+ status: string;
1848
+ planId: string;
1849
+ type: string;
1850
+ payment: {
1851
+ amount: number;
1852
+ currency: string;
1853
+ status: string;
1854
+ lastBillingDate: number | null;
1855
+ nextBillingDate: number | null;
1856
+ cancelAtDate: number | null;
1857
+ priceId: string;
1858
+ } | null;
1859
+ }[];
1860
+ } | null) => void) => {
22
1861
  unsubscribe: () => boolean;
23
1862
  };
24
1863
  _captchaReady: Promise<unknown>;
@@ -30,69 +1869,78 @@ declare const _default: {
30
1869
  postIsTyping(params: {
31
1870
  channelKey: string;
32
1871
  }): Promise<void>;
33
- getChannelInfo(params?: {
1872
+ getChannelInfo(params: {
34
1873
  channelKey: string;
35
- }): Promise<any>;
36
- subscribeToChannel(params?: {
1874
+ }): Promise<{
1875
+ data: Record<string, unknown>;
1876
+ }>;
1877
+ subscribeToChannel(params: {
37
1878
  channelKey: string;
38
1879
  action: "NONE" | "THREADS_ONLY";
39
1880
  }): Promise<void>;
40
- getPosts(params?: GetPostsParams): Promise<GetPostsPayload>;
41
- getThreads(params?: GetThreadsParams): Promise<GetThreadsPayload>;
42
- createPost(params?: CreatePostParams): Promise<CreatePostPayload>;
43
- updatePost(params?: UpdatePostParams): Promise<UpdatePostPayload>;
44
- postVote(params?: PostVoteParams): Promise<void>;
45
- deletePost(params?: DeletePostParams): Promise<void>;
46
- createThread(params?: CreateThreadParams): Promise<CreateThreadPayload>;
47
- updateThread(params?: UpdateThreadParams): Promise<UpdateThreadPayload>;
48
- threadVote(params?: ThreadVoteParams): Promise<void>;
49
- deleteThread(params?: DeleteThreadParams): Promise<void>;
50
- getSecureContent(params?: GetSecureContentParams): Promise<GetSecureContentPayload>;
51
- signupWithProvider(params?: SignupWithProviderParams): Promise<unknown>;
52
- loginWithProvider(params?: LoginWithProviderParams): Promise<unknown>;
53
- connectProvider(params?: LoginWithProviderParams): Promise<ConnectProviderPayload>;
1881
+ getPosts(params: GetPostsParams): Promise<GetPostsPayload>;
1882
+ getThreads(params: GetThreadsParams): Promise<GetThreadsPayload>;
1883
+ createPost(params: CreatePostParams): Promise<CreatePostPayload>;
1884
+ updatePost(params: UpdatePostParams): Promise<UpdatePostPayload>;
1885
+ postVote(params: PostVoteParams): Promise<void>;
1886
+ deletePost(params: DeletePostParams): Promise<void>;
1887
+ createThread(params: CreateThreadParams): Promise<CreateThreadPayload>;
1888
+ updateThread(params: UpdateThreadParams): Promise<UpdateThreadPayload>;
1889
+ threadVote(params: ThreadVoteParams): Promise<void>;
1890
+ deleteThread(params: DeleteThreadParams): Promise<void>;
1891
+ getSecureContent(params: GetSecureContentParams): Promise<GetSecureContentPayload>;
1892
+ signupWithProvider(params: SignupWithProviderParams): Promise<unknown>;
1893
+ loginWithProvider(params: LoginWithProviderParams): Promise<unknown>;
1894
+ connectProvider(params: LoginWithProviderParams): Promise<ConnectProviderPayload>;
54
1895
  disconnectProvider(params: LoginWithProviderParams): Promise<ConnectProviderPayload>;
55
- getAppAndMember(params?: any): Promise<GetAppAndMemberPayload>;
1896
+ getAppAndMember(params?: {
1897
+ trackPageView?: boolean | undefined;
1898
+ } | undefined): Promise<GetAppAndMemberPayload>;
56
1899
  getApp(): Promise<AppPayload>;
57
- loginMemberEmailPassword(params: LoginMemberEmailPasswordParams, options?: any): Promise<LoginMemberEmailPasswordPayload>;
58
- sendMemberLoginPasswordlessEmail(params: SendMemberLoginPasswordlessEmailParams, options?: any): Promise<SendMemberLoginPasswordlessEmailPayload>;
59
- sendMemberSignupPasswordlessEmail(params: SendMemberLoginPasswordlessEmailParams, options?: any): Promise<SendMemberLoginPasswordlessEmailPayload>;
60
- loginMemberPasswordless(params: LoginMemberPasswordlessParams, options?: any): Promise<LoginMemberEmailPasswordPayload>;
1900
+ loginMemberEmailPassword(params: LoginMemberEmailPasswordParams, options?: MemberstackOptions | undefined): Promise<LoginMemberEmailPasswordPayload>;
1901
+ sendMemberLoginPasswordlessEmail(params: SendMemberLoginPasswordlessEmailParams, options?: MemberstackOptions | undefined): Promise<SendMemberLoginPasswordlessEmailPayload>;
1902
+ sendMemberSignupPasswordlessEmail(params: SendMemberLoginPasswordlessEmailParams, options?: MemberstackOptions | undefined): Promise<SendMemberLoginPasswordlessEmailPayload>;
1903
+ loginMemberPasswordless(params: LoginMemberPasswordlessParams, options?: MemberstackOptions | undefined): Promise<LoginMemberEmailPasswordPayload>;
61
1904
  getPlan(params: GetPlanParams): Promise<GetPlanPayload>;
62
1905
  getPlans(): Promise<GetPlansPayload>;
63
1906
  getRestrictedUrlGroups(): Promise<GetRestrictedUrlGroupsPayload>;
64
- getCurrentMember(options?: GetCurrentMemberParams): Promise<GetCurrentMemberPayload>;
65
- getMemberJSON(options?: MemberstackOptions): Promise<GetMemberJSONPayload>;
66
- updateMemberJSON(params: UpdateMemberJSONParams, options?: MemberstackOptions): Promise<GetMemberJSONPayload>;
67
- addPlan(params: AddPlanParams, options?: MemberstackOptions): Promise<AddPlanPayload>;
68
- purchasePlansWithCheckout(params: PurchasePlansWithCheckoutParams, options?: MemberstackOptions): Promise<PurchasePlansWithCheckoutPayload>;
69
- launchStripeCustomerPortal(params: LaunchStripeCustomerPortalParams, options?: MemberstackOptions): Promise<LaunchStripeCustomerPortalPayload>;
70
- removePlan(params: RemovePlanParams, options?: MemberstackOptions): Promise<RemovePlanPayload>;
71
- updateMember(params: UpdateMemberParams, options?: MemberstackOptions): Promise<UpdateMemberPayload>;
72
- updateMemberAuth(params: UpdateMemberAuthParams, options?: MemberstackOptions): Promise<UpdateMemberAuthPayload>;
73
- setPassword(params: SetPasswordParams, options?: MemberstackOptions): Promise<SetPasswordPayload>;
1907
+ getCurrentMember(options?: GetCurrentMemberParams | undefined): Promise<GetCurrentMemberPayload>;
1908
+ getMemberJSON(options?: MemberstackOptions | undefined): Promise<GetMemberJSONPayload>;
1909
+ updateMemberJSON(params: UpdateMemberJSONParams, options?: MemberstackOptions | undefined): Promise<GetMemberJSONPayload>;
1910
+ addPlan(params: AddPlanParams, options?: MemberstackOptions | undefined): Promise<AddPlanPayload>;
1911
+ purchasePlansWithCheckout(params: PurchasePlansWithCheckoutParams, options?: MemberstackOptions | undefined): Promise<PurchasePlansWithCheckoutPayload>;
1912
+ launchStripeCustomerPortal(params: LaunchStripeCustomerPortalParams, options?: MemberstackOptions | undefined): Promise<LaunchStripeCustomerPortalPayload>;
1913
+ removePlan(params: RemovePlanParams, options?: MemberstackOptions | undefined): Promise<RemovePlanPayload>;
1914
+ updateMember(params: UpdateMemberParams, options?: MemberstackOptions | undefined): Promise<UpdateMemberPayload>;
1915
+ updateMemberAuth(params: UpdateMemberAuthParams, options?: MemberstackOptions | undefined): Promise<UpdateMemberAuthPayload>;
1916
+ setPassword(params: SetPasswordParams, options?: MemberstackOptions | undefined): Promise<SetPasswordPayload>;
74
1917
  signupMemberPasswordless(params: Omit<SignupMemberEmailPasswordParams, "password"> & {
75
1918
  passwordlessToken: string;
76
- }, options?: any): Promise<SignupMemberEmailPasswordPayload>;
77
- signupMemberEmailPassword(params: SignupMemberEmailPasswordParams, options?: any): Promise<SignupMemberEmailPasswordPayload>;
78
- joinTeam(params: JoinTeamParams, options?: MemberstackOptions): Promise<void>;
79
- getTeam(params: GetTeamParams, options?: MemberstackOptions): Promise<void>;
80
- removeMemberFromTeam(params: RemoveMemberFromTeamParams, options?: MemberstackOptions): Promise<void>;
81
- generateInviteToken(params: GenerateInviteTokenParams, options?: MemberstackOptions): Promise<void>;
82
- updateMemberProfileImage(params: UpdateMemberProfileImageParams): Promise<UpdateMemberProfileImagePayload>;
1919
+ }, options?: MemberstackOptions | undefined): Promise<SignupMemberEmailPasswordPayload>;
1920
+ signupMemberEmailPassword(params: SignupMemberEmailPasswordParams, options?: MemberstackOptions | undefined): Promise<SignupMemberEmailPasswordPayload>;
1921
+ joinTeam(params: JoinTeamParams, options?: MemberstackOptions | undefined): Promise<void>;
1922
+ getTeam(params: GetTeamParams, options?: MemberstackOptions | undefined): Promise<void>;
1923
+ removeMemberFromTeam(params: RemoveMemberFromTeamParams, options?: MemberstackOptions | undefined): Promise<void>;
1924
+ generateInviteToken(params: GenerateInviteTokenParams, options?: MemberstackOptions | undefined): Promise<void>;
1925
+ updateMemberProfileImage<T extends File | null>(params: {
1926
+ profileImage: T;
1927
+ }): Promise<T extends File ? UpdateMemberProfileImagePayload : DeleteMemberProfileImagePayload>;
1928
+ deleteMemberProfileImage(): Promise<DeleteMemberProfileImagePayload>;
83
1929
  sendMemberVerificationEmail(): Promise<SendMemberVerificationEmailPayload>;
84
1930
  sendMemberResetPasswordEmail(params: SendMemberResetPasswordEmailParams): Promise<SendMemberResetPasswordEmailPayload>;
85
- resetMemberPassword(params: ResetMemberPasswordParams): Promise<ResetMemberPassworPayload>;
86
- logout(options?: MemberstackOptions): Promise<LogoutMemberPayload>;
87
- getDataTables(options?: MemberstackOptions): Promise<GetDataTablesPayload>;
88
- getDataTable(params: GetDataTableParams, options?: MemberstackOptions): Promise<GetDataTablePayload>;
89
- getDataRecords(params: GetDataRecordsParams, options?: MemberstackOptions): Promise<GetDataRecordsPayload>;
90
- createDataRecord(params: CreateDataRecordParams, options?: MemberstackOptions): Promise<CreateDataRecordPayload>;
91
- getDataRecord(params: GetDataRecordParams, options?: MemberstackOptions): Promise<GetDataRecordPayload>;
92
- updateDataRecord(params: UpdateDataRecordParams, options?: MemberstackOptions): Promise<UpdateDataRecordPayload>;
93
- deleteDataRecord(params: DeleteDataRecordParams, options?: MemberstackOptions): Promise<DeleteDataRecordPayload>;
94
- queryDataRecords(params: QueryDataRecordsParams, options?: MemberstackOptions): Promise<QueryDataRecordsPayload>;
1931
+ resetMemberPassword(params: ResetMemberPasswordParams): Promise<ResetMemberPasswordPayload>;
1932
+ logout(options?: MemberstackOptions | undefined): Promise<LogoutMemberPayload>;
1933
+ getDataTables(options?: MemberstackOptions | undefined): Promise<GetDataTablesPayload>;
1934
+ getDataTable(params: GetDataTableParams, options?: MemberstackOptions | undefined): Promise<GetDataTablePayload>;
1935
+ getDataRecords(params: GetDataRecordsParams, options?: MemberstackOptions | undefined): Promise<GetDataRecordsPayload>;
1936
+ createDataRecord(params: CreateDataRecordParams, options?: MemberstackOptions | undefined): Promise<CreateDataRecordPayload>;
1937
+ getDataRecord(params: GetDataRecordParams, options?: MemberstackOptions | undefined): Promise<GetDataRecordPayload>;
1938
+ updateDataRecord(params: UpdateDataRecordParams, options?: MemberstackOptions | undefined): Promise<UpdateDataRecordPayload>;
1939
+ deleteDataRecord(params: DeleteDataRecordParams, options?: MemberstackOptions | undefined): Promise<DeleteDataRecordPayload>;
1940
+ queryDataRecords(params: QueryDataRecordsParams, options?: MemberstackOptions | undefined): Promise<QueryDataRecordsPayload>;
1941
+ } & {
1942
+ destroy: () => void;
95
1943
  };
96
1944
  };
97
1945
 
98
- export { AddPlanParams, AddPlanPayload, AppPayload, ConnectProviderPayload, CreateDataRecordParams, CreateDataRecordPayload, CreatePostParams, CreatePostPayload, CreateThreadParams, CreateThreadPayload, DeleteDataRecordParams, DeleteDataRecordPayload, DeleteMemberPayload, DeletePostParams, DeleteThreadParams, GenerateInviteTokenParams, GetAppAndMemberPayload, GetCurrentMemberPayload, GetDataRecordParams, GetDataRecordPayload, GetDataRecordsParams, GetDataRecordsPayload, GetDataTableParams, GetDataTablePayload, GetDataTablesPayload, GetMemberJSONPayload, GetPlanParams, GetPlanPayload, GetPlansPayload, GetPostsParams, GetPostsPayload, GetRestrictedUrlGroupsPayload, GetSecureContentParams, GetSecureContentPayload, GetTeamParams, GetThreadsParams, GetThreadsPayload, JoinTeamParams, LaunchStripeCustomerPortalParams, LaunchStripeCustomerPortalPayload, LoginMemberEmailPasswordParams, LoginMemberEmailPasswordPayload, LoginMemberPasswordlessParams, LoginWithProviderParams, LogoutMemberPayload, MemberstackTranslations, PostVoteParams, PurchasePlansWithCheckoutParams, PurchasePlansWithCheckoutPayload, QueryDataRecordsParams, QueryDataRecordsPayload, RemoveMemberFromTeamParams, RemovePlanParams, RemovePlanPayload, ResetMemberPassworPayload, ResetMemberPasswordParams, SendMemberLoginPasswordlessEmailParams, SendMemberLoginPasswordlessEmailPayload, SendMemberResetPasswordEmailParams, SendMemberResetPasswordEmailPayload, SendMemberVerificationEmailPayload, SetPasswordParams, SetPasswordPayload, SignupMemberEmailPasswordParams, SignupMemberEmailPasswordPayload, SignupWithProviderParams, ThreadVoteParams, UpdateDataRecordParams, UpdateDataRecordPayload, UpdateMemberAuthParams, UpdateMemberAuthPayload, UpdateMemberJSONParams, UpdateMemberParams, UpdateMemberPayload, UpdateMemberProfileImageParams, UpdateMemberProfileImagePayload, UpdatePostParams, UpdatePostPayload, UpdateThreadParams, UpdateThreadPayload, _default as default };
1946
+ export { type AddMemberCardParams, type AddMemberCardPayload, type AddPlanParams, type AddPlanPayload, type AppPayload, type CancelPlanParams, type CancelPlanPayload, type ConnectProviderPayload, type CountClause, type CreateDataRecordParams, type CreateDataRecordPayload, type CreatePostParams, type CreatePostPayload, type CreateThreadParams, type CreateThreadPayload, type DataRecordsQuery, type DeleteDataRecordParams, type DeleteDataRecordPayload, type DeleteMemberPayload, type DeleteMemberProfileImagePayload, type DeletePostParams, type DeleteThreadParams, type ErrorCategory, type ErrorCode, ErrorCodes, type GenerateInviteTokenParams, type GetAppAndMemberPayload, type GetAuthProvidersPayload, type GetAuthenticationClientSecretParams, type GetAuthenticationClientSecretPayload, type GetCurrentMemberPayload, type GetDataRecordParams, type GetDataRecordPayload, type GetDataRecordsParams, type GetDataRecordsPayload, type GetDataTableParams, type GetDataTablePayload, type GetDataTablesPayload, type GetMemberCardsPayload, type GetMemberInvoicesParams, type GetMemberInvoicesPayload, type GetMemberJSONPayload, type GetMemberPurchasesParams, type GetMemberReceiptsParams, type GetMemberReceiptsPayload, type GetPlanParams, type GetPlanPayload, type GetPlansParams, type GetPlansPayload, type GetPostsParams, type GetPostsPayload, type GetRestrictedUrlGroupsPayload, type GetSecureContentParams, type GetSecureContentPayload, type GetTeamParams, type GetThreadsParams, type GetThreadsPayload, type GetTotalCheckoutAmountParams, type GetTotalCheckoutAmountPayload, type IncludeClause, type JoinTeamParams, type LaunchStripeCustomerPortalParams, type LaunchStripeCustomerPortalPayload, type LoginMemberEmailPasswordParams, type LoginMemberEmailPasswordPayload, type LoginMemberPasswordlessParams, type LoginWithProviderParams, type LogoutMemberPayload, type MemberReferenceFieldResult, type MemberReferenceOperation, type MemberReferenceSelector, type MemberstackErrorShape, type MemberstackTranslations, type OAuthProvider, type OpenStripeCustomerPortalParams, type OpenStripeCustomerPortalPayload, type OrderByClause, type PostVoteParams, type PurchasePlansParams, type PurchasePlansPayload, type PurchasePlansWithCheckoutParams, type PurchasePlansWithCheckoutPayload, type QueryDataRecordsParams, type QueryDataRecordsPayload, type ReferenceFieldResult, type ReferenceOperation, type ReferenceSelector, type RefreshMemberTokensPayload, type RemoveMemberFromTeamParams, type RemovePlanParams, type RemovePlanPayload, type ReplacePlanParams, type ReplacePlanPayload, type ResetMemberPassworPayload, type ResetMemberPasswordParams, type ResetMemberPasswordPayload, type SelectClause, type SendMemberLoginPasswordlessEmailParams, type SendMemberLoginPasswordlessEmailPayload, type SendMemberResetPasswordEmailParams, type SendMemberResetPasswordEmailPayload, type SendMemberVerificationEmailPayload, type SetPasswordParams, type SetPasswordPayload, type SignupMemberAuthProviderParams, type SignupMemberAuthProviderPayload, type SignupMemberEmailPasswordParams, type SignupMemberEmailPasswordPayload, type SignupWithProviderParams, type ThreadVoteParams, type UpdateDataRecordParams, type UpdateDataRecordPayload, type UpdateDefaultCardParams, type UpdateDefaultCardPayload, type UpdateMemberAuthParams, type UpdateMemberAuthPayload, type UpdateMemberJSONParams, type UpdateMemberParams, type UpdateMemberPayload, type UpdateMemberProfileImageParams, type UpdateMemberProfileImagePayload, type UpdatePlanPaymentParams, type UpdatePlanPaymentPayload, type UpdatePostParams, type UpdatePostPayload, type UpdateThreadParams, type UpdateThreadPayload, type WhereClause, type WhereOperators, _default as default, formatErrorForUser, getErrorCategory, getErrorCode, getErrorDocsUrl, getErrorMessage, getErrorReport, getErrorSuggestions, isErrorCode, isMemberstackError };