@appfunnel-dev/sdk 0.7.0 → 0.9.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.
@@ -7,8 +7,8 @@ interface AppFunnelConfig {
7
7
  /** Funnel ID — set automatically on first publish. */
8
8
  funnelId?: string;
9
9
  name: string;
10
- /** Page key to start on. Defaults to first entry in `pages`. */
11
- initialPageKey?: string;
10
+ /** Page key to start on. */
11
+ initialPageKey: string;
12
12
  /**
13
13
  * Response variables — user answers to quiz/survey questions.
14
14
  * Stored internally as `answers.<key>`.
@@ -212,10 +212,13 @@ interface UserState {
212
212
  stripeCustomerId: string;
213
213
  paddleCustomerId: string;
214
214
  dateOfBirth: string;
215
- /** Set email (does NOT fire identify — use tracking.identify() explicitly) */
215
+ marketingConsent: boolean;
216
216
  setEmail: (email: string) => void;
217
217
  setName: (name: string) => void;
218
218
  setDateOfBirth: (dateOfBirth: string) => void;
219
+ setMarketingConsent: (consent: boolean) => void;
220
+ /** Identify the user by email — fires user.registered event */
221
+ identify: (email: string) => void;
219
222
  }
220
223
  interface NavigationState {
221
224
  goToNextPage: () => void;
@@ -232,19 +235,15 @@ interface ProductsState {
232
235
  }
233
236
  interface TrackingState {
234
237
  track: (eventName: string, data?: Record<string, unknown>) => void;
235
- identify: (email: string) => void;
236
238
  }
237
239
  interface PaymentState {
238
- customerId: string | null;
239
- isAuthorized: boolean;
240
240
  loading: boolean;
241
241
  error: string | null;
242
- cardDetails: {
243
- last4: string;
244
- brand: string;
245
- expMonth: number;
246
- expYear: number;
247
- } | null;
242
+ /** Purchase a product using the card on file. */
243
+ purchase: (productId: string, options?: {
244
+ onSuccess?: () => void;
245
+ onError?: (error: string) => void;
246
+ }) => Promise<boolean>;
248
247
  }
249
248
  interface DeviceInfo {
250
249
  os: {
@@ -7,8 +7,8 @@ interface AppFunnelConfig {
7
7
  /** Funnel ID — set automatically on first publish. */
8
8
  funnelId?: string;
9
9
  name: string;
10
- /** Page key to start on. Defaults to first entry in `pages`. */
11
- initialPageKey?: string;
10
+ /** Page key to start on. */
11
+ initialPageKey: string;
12
12
  /**
13
13
  * Response variables — user answers to quiz/survey questions.
14
14
  * Stored internally as `answers.<key>`.
@@ -212,10 +212,13 @@ interface UserState {
212
212
  stripeCustomerId: string;
213
213
  paddleCustomerId: string;
214
214
  dateOfBirth: string;
215
- /** Set email (does NOT fire identify — use tracking.identify() explicitly) */
215
+ marketingConsent: boolean;
216
216
  setEmail: (email: string) => void;
217
217
  setName: (name: string) => void;
218
218
  setDateOfBirth: (dateOfBirth: string) => void;
219
+ setMarketingConsent: (consent: boolean) => void;
220
+ /** Identify the user by email — fires user.registered event */
221
+ identify: (email: string) => void;
219
222
  }
220
223
  interface NavigationState {
221
224
  goToNextPage: () => void;
@@ -232,19 +235,15 @@ interface ProductsState {
232
235
  }
233
236
  interface TrackingState {
234
237
  track: (eventName: string, data?: Record<string, unknown>) => void;
235
- identify: (email: string) => void;
236
238
  }
237
239
  interface PaymentState {
238
- customerId: string | null;
239
- isAuthorized: boolean;
240
240
  loading: boolean;
241
241
  error: string | null;
242
- cardDetails: {
243
- last4: string;
244
- brand: string;
245
- expMonth: number;
246
- expYear: number;
247
- } | null;
242
+ /** Purchase a product using the card on file. */
243
+ purchase: (productId: string, options?: {
244
+ onSuccess?: () => void;
245
+ onError?: (error: string) => void;
246
+ }) => Promise<boolean>;
248
247
  }
249
248
  interface DeviceInfo {
250
249
  os: {
@@ -1,2 +1,2 @@
1
- export { r as FunnelContextValue, f as FunnelProvider, g as FunnelProviderProps, s as TranslationMap } from './internal-C7seLJBr.cjs';
1
+ export { r as FunnelContextValue, f as FunnelProvider, g as FunnelProviderProps, s as TranslationMap } from './internal-C9MOEdND.cjs';
2
2
  import 'react/jsx-runtime';
@@ -1,2 +1,2 @@
1
- export { r as FunnelContextValue, f as FunnelProvider, g as FunnelProviderProps, s as TranslationMap } from './internal-C7seLJBr.js';
1
+ export { r as FunnelContextValue, f as FunnelProvider, g as FunnelProviderProps, s as TranslationMap } from './internal-C9MOEdND.js';
2
2
  import 'react/jsx-runtime';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@appfunnel-dev/sdk",
3
- "version": "0.7.0",
3
+ "version": "0.9.0",
4
4
  "description": "Headless SDK for building AppFunnel pages with React",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",