@virex-tech/paywallo-sdk 2.5.2 → 2.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +27 -29
- package/dist/index.d.ts +27 -29
- package/dist/index.js +476 -338
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +472 -334
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -641,7 +641,6 @@ type NotificationsEnvironment = "sandbox" | "production";
|
|
|
641
641
|
interface NotificationsConfig {
|
|
642
642
|
debug?: boolean;
|
|
643
643
|
environment?: NotificationsEnvironment;
|
|
644
|
-
apiBaseUrl?: string;
|
|
645
644
|
}
|
|
646
645
|
|
|
647
646
|
declare const NOTIFICATIONS_ERROR_CODES: {
|
|
@@ -748,7 +747,6 @@ interface HandlersConfig {
|
|
|
748
747
|
}
|
|
749
748
|
interface NotificationsManagerConfig {
|
|
750
749
|
appKey: string;
|
|
751
|
-
apiBaseUrl?: string;
|
|
752
750
|
debug?: boolean;
|
|
753
751
|
environment?: NotificationsConfig["environment"];
|
|
754
752
|
}
|
|
@@ -1532,7 +1530,7 @@ declare class IAPService {
|
|
|
1532
1530
|
private finishTransaction;
|
|
1533
1531
|
startTransactionListener(): void;
|
|
1534
1532
|
stopTransactionListener(): void;
|
|
1535
|
-
emitTransactionUpdate(
|
|
1533
|
+
emitTransactionUpdate(update: NativeTransactionUpdate): Promise<void>;
|
|
1536
1534
|
purchase(productId: string, options?: ValidateOptions): Promise<PurchaseResult>;
|
|
1537
1535
|
restore(): Promise<Purchase[]>;
|
|
1538
1536
|
reset(): void;
|
|
@@ -1632,8 +1630,25 @@ declare class OnboardingError extends PaywalloError {
|
|
|
1632
1630
|
declare const ONBOARDING_ERROR_CODES: {
|
|
1633
1631
|
readonly NOT_INITIALIZED: "ONBOARDING_NOT_INITIALIZED";
|
|
1634
1632
|
readonly INVALID_STEP_NAME: "ONBOARDING_INVALID_STEP_NAME";
|
|
1633
|
+
readonly INVALID_ORDER: "ONBOARDING_INVALID_ORDER";
|
|
1635
1634
|
};
|
|
1636
1635
|
|
|
1636
|
+
/** Payload sent with onboarding.step events. */
|
|
1637
|
+
interface OnboardingStepPayload {
|
|
1638
|
+
step_name: string;
|
|
1639
|
+
/** Ordem de exibição do step (aceita decimais, ex: 2.1 para variantes A/B). Obrigatório. */
|
|
1640
|
+
order: number;
|
|
1641
|
+
variant_key?: string;
|
|
1642
|
+
time_on_prev_s?: number;
|
|
1643
|
+
}
|
|
1644
|
+
interface OnboardingStepOptions {
|
|
1645
|
+
variantKey?: string;
|
|
1646
|
+
timeOnPrevS?: number;
|
|
1647
|
+
}
|
|
1648
|
+
interface OnboardingCompleteOptions {
|
|
1649
|
+
variantKey?: string;
|
|
1650
|
+
}
|
|
1651
|
+
|
|
1637
1652
|
/**
|
|
1638
1653
|
* Minimal surface the OnboardingManager needs from the unified event pipeline.
|
|
1639
1654
|
* `PaywalloClient` satisfies this interface (forwarding to
|
|
@@ -1661,42 +1676,26 @@ declare class OnboardingManager {
|
|
|
1661
1676
|
* Saves the step name internally for implicit drop detection on the backend.
|
|
1662
1677
|
*
|
|
1663
1678
|
* @param stepName - Unique name for this onboarding step.
|
|
1664
|
-
* @param order -
|
|
1679
|
+
* @param order - Ordem de exibição do step. Obrigatório. Aceita decimais (ex: 2.1 para variantes A/B).
|
|
1680
|
+
* Deve ser um número finito e não-negativo. O servidor faz o floor — não arredondar aqui.
|
|
1665
1681
|
*/
|
|
1666
|
-
step(stepName: string, order?:
|
|
1682
|
+
step(stepName: string, order: number, options?: OnboardingStepOptions): Promise<void>;
|
|
1667
1683
|
/**
|
|
1668
1684
|
* Tracks successful completion of the onboarding flow.
|
|
1669
1685
|
* Marks the flow as finished.
|
|
1670
1686
|
*/
|
|
1671
|
-
complete(): Promise<void>;
|
|
1672
|
-
/**
|
|
1673
|
-
* Tracks an explicit drop (abandonment) at the given step.
|
|
1674
|
-
* Marks the flow as finished.
|
|
1675
|
-
*
|
|
1676
|
-
* @param stepName - The step name where the user dropped off.
|
|
1677
|
-
*/
|
|
1678
|
-
drop(stepName: string): Promise<void>;
|
|
1687
|
+
complete(options?: OnboardingCompleteOptions): Promise<void>;
|
|
1679
1688
|
/** Returns the last step name seen, or null if no step was tracked yet. */
|
|
1680
1689
|
getLastStep(): string | null;
|
|
1681
|
-
/** Returns whether the flow has been marked as finished (complete
|
|
1690
|
+
/** Returns whether the flow has been marked as finished (complete). */
|
|
1682
1691
|
isFinished(): boolean;
|
|
1683
1692
|
private emit;
|
|
1684
1693
|
private assertConfig;
|
|
1685
1694
|
private validateStepName;
|
|
1695
|
+
private validateOrder;
|
|
1686
1696
|
}
|
|
1687
1697
|
declare const onboardingManager: OnboardingManager;
|
|
1688
1698
|
|
|
1689
|
-
/** Payload sent with onboarding.step events. */
|
|
1690
|
-
interface OnboardingStepPayload {
|
|
1691
|
-
step_name: string;
|
|
1692
|
-
/** Optional explicit order (accepts decimals, e.g. 2.1 for A/B variants). */
|
|
1693
|
-
order?: number;
|
|
1694
|
-
}
|
|
1695
|
-
/** Payload sent with onboarding.drop events. */
|
|
1696
|
-
interface OnboardingDropPayload {
|
|
1697
|
-
step_name: string;
|
|
1698
|
-
}
|
|
1699
|
-
|
|
1700
1699
|
interface PaywallContextValue {
|
|
1701
1700
|
nodes: Record<string, PaywallNode>;
|
|
1702
1701
|
rootId: string;
|
|
@@ -1863,9 +1862,8 @@ interface UseOfferingsResult {
|
|
|
1863
1862
|
declare function useOfferings(ids?: string[]): UseOfferingsResult;
|
|
1864
1863
|
|
|
1865
1864
|
interface UseOnboardingResult {
|
|
1866
|
-
step: (stepName: string, order?:
|
|
1867
|
-
complete: () => Promise<void>;
|
|
1868
|
-
drop: (stepName: string) => Promise<void>;
|
|
1865
|
+
step: (stepName: string, order: number, options?: OnboardingStepOptions) => Promise<void>;
|
|
1866
|
+
complete: (options?: OnboardingCompleteOptions) => Promise<void>;
|
|
1869
1867
|
}
|
|
1870
1868
|
/**
|
|
1871
1869
|
* React hook that exposes bound onboarding tracking methods.
|
|
@@ -2017,4 +2015,4 @@ declare function hasVariables(text: string): boolean;
|
|
|
2017
2015
|
|
|
2018
2016
|
declare const Paywallo: IPaywalloClient;
|
|
2019
2017
|
|
|
2020
|
-
export { type AllPlansResponse, ApiClient, type ApiClientConfig, type AttributionCapture, AttributionTracker, type BlockType, type BoxSpacing, CAMPAIGN_ERROR_CODES, type CachedOfferings, type CachedPlans, type CachedSubscription, CampaignError, type CampaignPresentOptions, type CampaignResponse, type CampaignResult, type ConditionalFlagContext, type ConditionalFlagResult, type DeviceTokenRegistration, PURCHASE_ERROR_CODES as ERROR_CODES, type EmergencyPaywallResponse, type Environment, type FlagVariant, HttpClient, type HttpClientConfig, type HttpResponse, type IAPProduct, type IAPPurchase, IAPService, IDENTITY_ERROR_CODES, type IPaywalloClient, type IPushBridge, type IdentifyOptions, IdentityError, IdentityManager, type IdentityState, type LocalizedText, MetaBridge, NOTIFICATIONS_ERROR_CODES, NativePushBridge, type NetworkListener, type NetworkMonitorConfig, type NetworkState, type NotificationEventType, type NotificationListener, type NotificationPayload, NotificationsError, NotificationsManager, ONBOARDING_ERROR_CODES, type Offering, type OfferingProduct, OfferingService, type OfferingServiceConfig, type OfflineQueueConfig,
|
|
2018
|
+
export { type AllPlansResponse, ApiClient, type ApiClientConfig, type AttributionCapture, AttributionTracker, type BlockType, type BoxSpacing, CAMPAIGN_ERROR_CODES, type CachedOfferings, type CachedPlans, type CachedSubscription, CampaignError, type CampaignPresentOptions, type CampaignResponse, type CampaignResult, type ConditionalFlagContext, type ConditionalFlagResult, type DeviceTokenRegistration, PURCHASE_ERROR_CODES as ERROR_CODES, type EmergencyPaywallResponse, type Environment, type FlagVariant, HttpClient, type HttpClientConfig, type HttpResponse, type IAPProduct, type IAPPurchase, IAPService, IDENTITY_ERROR_CODES, type IPaywalloClient, type IPushBridge, type IdentifyOptions, IdentityError, IdentityManager, type IdentityState, type LocalizedText, MetaBridge, NOTIFICATIONS_ERROR_CODES, NativePushBridge, type NetworkListener, type NetworkMonitorConfig, type NetworkState, type NotificationEventType, type NotificationListener, type NotificationPayload, NotificationsError, NotificationsManager, ONBOARDING_ERROR_CODES, type Offering, type OfferingProduct, OfferingService, type OfferingServiceConfig, type OfflineQueueConfig, OnboardingError, OnboardingManager, type OnboardingStepPayload, PAYWALL_ERROR_CODES, PURCHASE_ERROR_CODES, type PaywallBlockConfig, type PaywallConfig, PaywallContext, PaywallError, type PaywallErrorStrings$1 as PaywallErrorStrings, PaywallModal, type PaywallNode, type PaywallPresentOptions, type PaywallResult, type PaywallState, Paywallo, PaywalloClient, type PaywalloConfig, PaywalloContext, PaywalloError, type PaywalloInitConfig, PaywalloProvider, type PaywalloProviderProps, type Plan, PlanCache, type PlanProduct, PlanService, type PlanServiceConfig, type PlansResponse, type PrePromptHandle, type PrePromptOptions, type PreloadCampaignResult, type PreloadResult, type Product, type ProductPriceInfo, type Purchase, type PurchaseControllerConfig, PurchaseError, type PurchaseResult, type PurchaseState, type PushPermissionStatus, type PushPlatform, type QueueEvent, type QueueItem, type QueueListener, type QueueProcessorConfig, type RequestOptions, type RestoreResult$1 as RestoreResult, type RetryConfig, SESSION_ERROR_CODES, type SessionConfig, SessionError, SessionManager, type SessionState, type Subscription, SubscriptionCache, type SubscriptionInfo, type SubscriptionManagerConfig, type SubscriptionPlatform, type SubscriptionStatus$1 as SubscriptionStatus, type SubscriptionStatusResponse$1 as SubscriptionStatusResponse, type TapBehavior, type TrackEventOptions, type UserProperties, type ValidatePurchaseResponse, type VariableContext, attributionTracker, createPurchaseError, Paywallo as default, detectDeviceLanguage, getActiveRouteName, getCurrentLanguage, getDefaultLanguage, getIAPService, getLocalizedString, hasVariables, identityManager, initLocalization, metaBridge, nativeStoreKit, networkMonitor, notificationsManager, offeringService, offlineQueue, onboardingManager, parseVariables, planCache, planService, queueProcessor, resolveText, sessionManager, setCurrentLanguage, setDefaultLanguage, subscriptionManager, useOfferingPurchase, useOfferings, useOnboarding, usePaywallContext, usePaywallo, usePaywalloScreenTracking, usePlanPurchase, usePlans, useProducts, usePurchase, useSubscription };
|
package/dist/index.d.ts
CHANGED
|
@@ -641,7 +641,6 @@ type NotificationsEnvironment = "sandbox" | "production";
|
|
|
641
641
|
interface NotificationsConfig {
|
|
642
642
|
debug?: boolean;
|
|
643
643
|
environment?: NotificationsEnvironment;
|
|
644
|
-
apiBaseUrl?: string;
|
|
645
644
|
}
|
|
646
645
|
|
|
647
646
|
declare const NOTIFICATIONS_ERROR_CODES: {
|
|
@@ -748,7 +747,6 @@ interface HandlersConfig {
|
|
|
748
747
|
}
|
|
749
748
|
interface NotificationsManagerConfig {
|
|
750
749
|
appKey: string;
|
|
751
|
-
apiBaseUrl?: string;
|
|
752
750
|
debug?: boolean;
|
|
753
751
|
environment?: NotificationsConfig["environment"];
|
|
754
752
|
}
|
|
@@ -1532,7 +1530,7 @@ declare class IAPService {
|
|
|
1532
1530
|
private finishTransaction;
|
|
1533
1531
|
startTransactionListener(): void;
|
|
1534
1532
|
stopTransactionListener(): void;
|
|
1535
|
-
emitTransactionUpdate(
|
|
1533
|
+
emitTransactionUpdate(update: NativeTransactionUpdate): Promise<void>;
|
|
1536
1534
|
purchase(productId: string, options?: ValidateOptions): Promise<PurchaseResult>;
|
|
1537
1535
|
restore(): Promise<Purchase[]>;
|
|
1538
1536
|
reset(): void;
|
|
@@ -1632,8 +1630,25 @@ declare class OnboardingError extends PaywalloError {
|
|
|
1632
1630
|
declare const ONBOARDING_ERROR_CODES: {
|
|
1633
1631
|
readonly NOT_INITIALIZED: "ONBOARDING_NOT_INITIALIZED";
|
|
1634
1632
|
readonly INVALID_STEP_NAME: "ONBOARDING_INVALID_STEP_NAME";
|
|
1633
|
+
readonly INVALID_ORDER: "ONBOARDING_INVALID_ORDER";
|
|
1635
1634
|
};
|
|
1636
1635
|
|
|
1636
|
+
/** Payload sent with onboarding.step events. */
|
|
1637
|
+
interface OnboardingStepPayload {
|
|
1638
|
+
step_name: string;
|
|
1639
|
+
/** Ordem de exibição do step (aceita decimais, ex: 2.1 para variantes A/B). Obrigatório. */
|
|
1640
|
+
order: number;
|
|
1641
|
+
variant_key?: string;
|
|
1642
|
+
time_on_prev_s?: number;
|
|
1643
|
+
}
|
|
1644
|
+
interface OnboardingStepOptions {
|
|
1645
|
+
variantKey?: string;
|
|
1646
|
+
timeOnPrevS?: number;
|
|
1647
|
+
}
|
|
1648
|
+
interface OnboardingCompleteOptions {
|
|
1649
|
+
variantKey?: string;
|
|
1650
|
+
}
|
|
1651
|
+
|
|
1637
1652
|
/**
|
|
1638
1653
|
* Minimal surface the OnboardingManager needs from the unified event pipeline.
|
|
1639
1654
|
* `PaywalloClient` satisfies this interface (forwarding to
|
|
@@ -1661,42 +1676,26 @@ declare class OnboardingManager {
|
|
|
1661
1676
|
* Saves the step name internally for implicit drop detection on the backend.
|
|
1662
1677
|
*
|
|
1663
1678
|
* @param stepName - Unique name for this onboarding step.
|
|
1664
|
-
* @param order -
|
|
1679
|
+
* @param order - Ordem de exibição do step. Obrigatório. Aceita decimais (ex: 2.1 para variantes A/B).
|
|
1680
|
+
* Deve ser um número finito e não-negativo. O servidor faz o floor — não arredondar aqui.
|
|
1665
1681
|
*/
|
|
1666
|
-
step(stepName: string, order?:
|
|
1682
|
+
step(stepName: string, order: number, options?: OnboardingStepOptions): Promise<void>;
|
|
1667
1683
|
/**
|
|
1668
1684
|
* Tracks successful completion of the onboarding flow.
|
|
1669
1685
|
* Marks the flow as finished.
|
|
1670
1686
|
*/
|
|
1671
|
-
complete(): Promise<void>;
|
|
1672
|
-
/**
|
|
1673
|
-
* Tracks an explicit drop (abandonment) at the given step.
|
|
1674
|
-
* Marks the flow as finished.
|
|
1675
|
-
*
|
|
1676
|
-
* @param stepName - The step name where the user dropped off.
|
|
1677
|
-
*/
|
|
1678
|
-
drop(stepName: string): Promise<void>;
|
|
1687
|
+
complete(options?: OnboardingCompleteOptions): Promise<void>;
|
|
1679
1688
|
/** Returns the last step name seen, or null if no step was tracked yet. */
|
|
1680
1689
|
getLastStep(): string | null;
|
|
1681
|
-
/** Returns whether the flow has been marked as finished (complete
|
|
1690
|
+
/** Returns whether the flow has been marked as finished (complete). */
|
|
1682
1691
|
isFinished(): boolean;
|
|
1683
1692
|
private emit;
|
|
1684
1693
|
private assertConfig;
|
|
1685
1694
|
private validateStepName;
|
|
1695
|
+
private validateOrder;
|
|
1686
1696
|
}
|
|
1687
1697
|
declare const onboardingManager: OnboardingManager;
|
|
1688
1698
|
|
|
1689
|
-
/** Payload sent with onboarding.step events. */
|
|
1690
|
-
interface OnboardingStepPayload {
|
|
1691
|
-
step_name: string;
|
|
1692
|
-
/** Optional explicit order (accepts decimals, e.g. 2.1 for A/B variants). */
|
|
1693
|
-
order?: number;
|
|
1694
|
-
}
|
|
1695
|
-
/** Payload sent with onboarding.drop events. */
|
|
1696
|
-
interface OnboardingDropPayload {
|
|
1697
|
-
step_name: string;
|
|
1698
|
-
}
|
|
1699
|
-
|
|
1700
1699
|
interface PaywallContextValue {
|
|
1701
1700
|
nodes: Record<string, PaywallNode>;
|
|
1702
1701
|
rootId: string;
|
|
@@ -1863,9 +1862,8 @@ interface UseOfferingsResult {
|
|
|
1863
1862
|
declare function useOfferings(ids?: string[]): UseOfferingsResult;
|
|
1864
1863
|
|
|
1865
1864
|
interface UseOnboardingResult {
|
|
1866
|
-
step: (stepName: string, order?:
|
|
1867
|
-
complete: () => Promise<void>;
|
|
1868
|
-
drop: (stepName: string) => Promise<void>;
|
|
1865
|
+
step: (stepName: string, order: number, options?: OnboardingStepOptions) => Promise<void>;
|
|
1866
|
+
complete: (options?: OnboardingCompleteOptions) => Promise<void>;
|
|
1869
1867
|
}
|
|
1870
1868
|
/**
|
|
1871
1869
|
* React hook that exposes bound onboarding tracking methods.
|
|
@@ -2017,4 +2015,4 @@ declare function hasVariables(text: string): boolean;
|
|
|
2017
2015
|
|
|
2018
2016
|
declare const Paywallo: IPaywalloClient;
|
|
2019
2017
|
|
|
2020
|
-
export { type AllPlansResponse, ApiClient, type ApiClientConfig, type AttributionCapture, AttributionTracker, type BlockType, type BoxSpacing, CAMPAIGN_ERROR_CODES, type CachedOfferings, type CachedPlans, type CachedSubscription, CampaignError, type CampaignPresentOptions, type CampaignResponse, type CampaignResult, type ConditionalFlagContext, type ConditionalFlagResult, type DeviceTokenRegistration, PURCHASE_ERROR_CODES as ERROR_CODES, type EmergencyPaywallResponse, type Environment, type FlagVariant, HttpClient, type HttpClientConfig, type HttpResponse, type IAPProduct, type IAPPurchase, IAPService, IDENTITY_ERROR_CODES, type IPaywalloClient, type IPushBridge, type IdentifyOptions, IdentityError, IdentityManager, type IdentityState, type LocalizedText, MetaBridge, NOTIFICATIONS_ERROR_CODES, NativePushBridge, type NetworkListener, type NetworkMonitorConfig, type NetworkState, type NotificationEventType, type NotificationListener, type NotificationPayload, NotificationsError, NotificationsManager, ONBOARDING_ERROR_CODES, type Offering, type OfferingProduct, OfferingService, type OfferingServiceConfig, type OfflineQueueConfig,
|
|
2018
|
+
export { type AllPlansResponse, ApiClient, type ApiClientConfig, type AttributionCapture, AttributionTracker, type BlockType, type BoxSpacing, CAMPAIGN_ERROR_CODES, type CachedOfferings, type CachedPlans, type CachedSubscription, CampaignError, type CampaignPresentOptions, type CampaignResponse, type CampaignResult, type ConditionalFlagContext, type ConditionalFlagResult, type DeviceTokenRegistration, PURCHASE_ERROR_CODES as ERROR_CODES, type EmergencyPaywallResponse, type Environment, type FlagVariant, HttpClient, type HttpClientConfig, type HttpResponse, type IAPProduct, type IAPPurchase, IAPService, IDENTITY_ERROR_CODES, type IPaywalloClient, type IPushBridge, type IdentifyOptions, IdentityError, IdentityManager, type IdentityState, type LocalizedText, MetaBridge, NOTIFICATIONS_ERROR_CODES, NativePushBridge, type NetworkListener, type NetworkMonitorConfig, type NetworkState, type NotificationEventType, type NotificationListener, type NotificationPayload, NotificationsError, NotificationsManager, ONBOARDING_ERROR_CODES, type Offering, type OfferingProduct, OfferingService, type OfferingServiceConfig, type OfflineQueueConfig, OnboardingError, OnboardingManager, type OnboardingStepPayload, PAYWALL_ERROR_CODES, PURCHASE_ERROR_CODES, type PaywallBlockConfig, type PaywallConfig, PaywallContext, PaywallError, type PaywallErrorStrings$1 as PaywallErrorStrings, PaywallModal, type PaywallNode, type PaywallPresentOptions, type PaywallResult, type PaywallState, Paywallo, PaywalloClient, type PaywalloConfig, PaywalloContext, PaywalloError, type PaywalloInitConfig, PaywalloProvider, type PaywalloProviderProps, type Plan, PlanCache, type PlanProduct, PlanService, type PlanServiceConfig, type PlansResponse, type PrePromptHandle, type PrePromptOptions, type PreloadCampaignResult, type PreloadResult, type Product, type ProductPriceInfo, type Purchase, type PurchaseControllerConfig, PurchaseError, type PurchaseResult, type PurchaseState, type PushPermissionStatus, type PushPlatform, type QueueEvent, type QueueItem, type QueueListener, type QueueProcessorConfig, type RequestOptions, type RestoreResult$1 as RestoreResult, type RetryConfig, SESSION_ERROR_CODES, type SessionConfig, SessionError, SessionManager, type SessionState, type Subscription, SubscriptionCache, type SubscriptionInfo, type SubscriptionManagerConfig, type SubscriptionPlatform, type SubscriptionStatus$1 as SubscriptionStatus, type SubscriptionStatusResponse$1 as SubscriptionStatusResponse, type TapBehavior, type TrackEventOptions, type UserProperties, type ValidatePurchaseResponse, type VariableContext, attributionTracker, createPurchaseError, Paywallo as default, detectDeviceLanguage, getActiveRouteName, getCurrentLanguage, getDefaultLanguage, getIAPService, getLocalizedString, hasVariables, identityManager, initLocalization, metaBridge, nativeStoreKit, networkMonitor, notificationsManager, offeringService, offlineQueue, onboardingManager, parseVariables, planCache, planService, queueProcessor, resolveText, sessionManager, setCurrentLanguage, setDefaultLanguage, subscriptionManager, useOfferingPurchase, useOfferings, useOnboarding, usePaywallContext, usePaywallo, usePaywalloScreenTracking, usePlanPurchase, usePlans, useProducts, usePurchase, useSubscription };
|