Advanced integration

To integrate advanced features with your UI, you can add the following event listener:
window.addEventListener('message', function (event) { if ( event.data?.type === 'state' && ['https://onlineapp.pro', 'https://onlineapp.live', 'https://onlineapp.stream'].includes(event.origin) ) { // Make some actions } });
interface State { visibility_status?: 'init' | 'invisible' | 'visible'; purchase_status?: 'init' | 'paid' | 'failed'; auth_status?: 'init' | 'signed-in' | 'signed-out' | 'failed'; visibility_status_reason?: | 'openings-trial' | 'time-trial' | 'country-not-match' | 'visibility-turned-off' | 'closed-by-user' | 'active-payment-found' | 'success-payment' | 'tokenization-sign-in' | 'error'; purchase_status_reason?: | 'restored' | 'active-payment-found' | 'success-payment'; user?: {}; subscription?: {}; payment?: {}; }

Visibility status reasons

REASON
DESCRIPTION
openings-trial
When calling paywall.open(), if the type of trial specified in the paywall settings is "number of trial actions" and the user's actions have not exceeded the specified number, the paywall will not open.
time-trial
When calling paywall.open(), if the type of trial specified in the paywall settings is "trial time" and the user's first time open have not exceeded the specified time in hours, the paywall will not open.
country-not-match
The user's country does not match the country specified in the paywall settings.
visibility-turned-off
Paywall’s visibility setting is turned off.
closed-by-user
The user closed the paywall.
active-payment-found
The user's purchase has been restored after the account recovery.
success-payment
The user made a purchase.
tokenization-sign-in
The user is authenticated, which triggers when tokenization is enabled.
error
An error occurred.