Parameters
Key | Type | Required | Description |
---|---|---|---|
experienceId | string | Yes | ID of the Paywall experience created in the Business Portal |
purchaseMetadata | object | No | Key-value pairs of custom information associated with the purchase. |
Returns
A promise that resolves to the initial state of the Paywall and methods for showing it to users. Type of the response isPaywallExperienceResult
.
Field | Type | Description |
---|---|---|
initialState | ExperienceStateSummary | The state of the paywall immediately after config is loaded, can be used to check if the user is logged in or has a priort entitlement already. |
logIn | () => Promise<ExperienceStateSummary> | Launch an auth flow immediately, if necessary. The returned promise resolves when the login flow is completed. |
show | () => Promise<ExperienceStateSummary> | Display the paywall to the user, the returned promise resolves when the paywall closes. |
destroy | () => void | Clean up and remove all Supertab elements from the DOM. |
Example
Types
ExperienceStateSummary
ExperienceStateSummary type definition
PaywallExperienceResult
PaywallExperienceResult type definition