API Reference

Feature is still in development and subject to change.

The Tapjoy SDK works on a queue based interface. Each call will be added to a queue that is being processed in the background.

If multiple commands are in the queue, only the last will be executed. This behaviour is intentional to prevent flooding the SDK with too many commands.

Tapjoy('command', {
  // command arguments
});

init

Init call must be called before showing offerwall content. By default, offerwall content is being preloaded.

Tapjoy('init', options);
Option Type Default Value Description
sdkKey* ID - Application SDK Key
publisherUserId* string - Publisher User ID used to reward users
ageRestrictedUser* bool false For more on GDPR and COPPA compliance, see the User Privacy section.
gdprConsentGiven* bool false For more on GDPR and COPPA compliance, see the User Privacy section.
userSubjectToGdpr* bool false For more on GDPR and COPPA compliance, see the User Privacy section.
eventName* string iOS Offerwall - Web Placement Name
preload boolean true Whether to preload offerwall content
callback function () => {} Callback when initialization has been finished

update

Update call updates initial data and acts as a reset for the SDK.

preload

Tapjoy('preload', options);
Option Type Default Value Description
callback function (err, status) => {} Callback when content is loaded

showOfferwall

Init call must be called before showing offerwall content. By default, offerwall content is being preloaded.

Tapjoy('showOfferwall', options);
Option Type Default Value Description
node HTMLElement document.body Element that should
callback Function noop Function that is being called with current offerwall status

closeOfferwall

Closes any active offerwall windows.

Tapjoy('closeOfferwall');

subscribeLogs

This call subscribes to logs about SDK events. If you want to debug your app, please call this event before init call to get all the logging.

For Debug purposes only

Tapjoy('subscribeLog', {
  logger: window.console,
});
Option Type Default Value Description
logger Console-like object null Object with .log, .info, .error methods, if value is null, it removes logging