<SuperwallProvider />.
Function Signature
Parameters
An optional object containing callback functions for paywall events.usePlacementCallbacks properties:
Called when a paywall is presented.
Called when a paywall is dismissed.
Called when a paywall is skipped (e.g., user in holdout, no audience match).
Called when a paywall fails to present or another SDK error occurs.
callbacks.onCustomCallback
(callback: CustomCallback) => Promise<CustomCallbackResult> | CustomCallbackResult
Called when a custom callback is invoked from a paywall. Return a result to send back to the paywall.CustomCallback:
name: string- The callback namevariables?: Record<string, any>- Optional variables passed from paywall
status: "success" | "failure"- Whether the callback succeededdata?: Record<string, any>- Optional data to return to paywall
Return Value
An object containing:A function to register a placement and potentially trigger a paywall.RegisterPlacementArgs:
The placement name defined on the Superwall dashboard.
Optional parameters passed to the placement. These can be used for targeting rules or displayed in the paywall.
An optional function to execute if the placement does not result in a paywall presentation. This is called when:
- The user is already subscribed
- The user is in a holdout group
- No matching campaign rules
- Any other reason the paywall is not shown
The current state of the paywall interaction for this hook instance.Possible states:
Initial state, no paywall has been registered yet.
A paywall is currently presented.
paywallInfo: PaywallInfo- Information about the presented paywall
The paywall was dismissed.
result: PaywallResult- The result of the interaction:{ type: "purchased", productId: string }- User purchased{ type: "declined" }- User closed paywall{ type: "restored" }- User restored purchases
The paywall was skipped.
reason: PaywallSkippedReason- Why it was skipped:{ type: "Holdout", experiment: Experiment }- User in holdout group{ type: "NoAudienceMatch" }- User didn’t match audience rules{ type: "PlacementNotFound" }- Placement ID not found
An error occurred.
error: string- The error message
Usage Examples
Basic placement registration
With placement parameters
Display state-based UI
Custom callback handling
Multiple placements in one component
How It Works
- When
registerPlacementis called, the SDK evaluates campaign rules on the Superwall dashboard - Based on the rules, the SDK decides whether to:
- Present a paywall
- Skip (user in holdout, already subscribed, etc.)
- Call the
featurecallback immediately
- The hook’s
stateis updated throughout the lifecycle - Callbacks are invoked at each stage (present, dismiss, skip, error)
- The
featurecallback is executed when the user should have access
Related Hooks
- useSuperwall - Core SDK access hook
- useUser - User management hook
- useSuperwallEvents - Low-level event subscription
Related Types
PaywallInfo(SuperwallExpoModule.types.ts:392)PaywallResult(SuperwallExpoModule.types.ts:177)PaywallSkippedReason(SuperwallExpoModule.types.ts:148)CustomCallback(SuperwallExpoModule.types.ts:499)CustomCallbackResult(SuperwallExpoModule.types.ts:517)