For the complete documentation index, see llms.txt. This page is also available as Markdown.

Initialization

This guide provides detailed instructions on how to properly initialize and integrate the Tyrads SDK into your React Native application.

Table of Contents


Overview

Tyrads SDK introduces a more modular approach to offerwall integration, including native React components and enhanced data tracking capabilities. To ensure optimal user experience and accurate attribution, please follow the initialization patterns described below.

Initialization Timing

Initialize After Media Source or MMP Initialization

MMP & Media Source Dependency

CRITICAL: It is highly recommended to initialize the Tyrads SDK only after your Mobile Measurement Partner (MMP) or internal media source data has been fully resolved.

Initializing the SDK with valid media source data ensures:

  • Accurate Attribution: Users are correctly mapped to their acquisition sources.

  • Customized Rewards: The earning journey can be tailored based on the user's entry point.

  • Better Analytics: Provides clearer feedback on the quality of users from different segments.


The Tyrads.init Method

The init method is the entry point for the SDK. In v4, several optional parameters have been added to provide more context about the user and the session.

Parameter Details

Parameter
Type
Required
Description

apiKey

string

Yes

Your unique Tyrads API Key.

apiSecret

string

Yes

Your unique Tyrads API Secret.

encKey

string

No

Encryption Key. Used for encrypting data transmitted from the SDK. If omitted, data is sent in plain text.

engagementId

string

No

A unique identifier for tracking specific user engagement campaigns.

placementId

string

No

Used to differentiate between different coins and use as per your selection within your app.

mediaSourceInfo

TyradsMediaSourceInfo

No

Detailed attribution data (see Data Structures).

userInfo

TyradsUserInfo

No

Additional user metadata like email or user group.

config

TyradsConfig

No

Android Only:

SDK behavioral configuration such as skipInitialPages to bypass privacy/permission screens. .


Data Structures

TyradsMediaSourceInfo

Used to provide the SDK with information about the user's acquisition source.

TyradsUserInfo

Provides basic demographic or segment data for the user.


User Authentication

After initialization, you must identify the user before showing offers.


Displaying Offers

You can display the full offerwall or use native components.

Full Offerwall (Modal/Browser)

Native Premium Widget

Render premium offers directly inside your React components for a more native feel.

The PremiumWidgetStyles enum allows you to choose between two distinct layouts:

Style
Description

PremiumWidgetStyles.list

Renders offers in a vertical list format (Best for dedicated offer screens).

PremiumWidgetStyles.sliderCards

Renders offers in a horizontal swipeable carousel (Best for home screens or small spaces).

sliderCards
list

iOS Launch Modes

On iOS, you can control how the offerwall is presented to comply with Apple's policies.

Mode
Value
Behavior

External

3

Opens the Offerwall in Safari (Default).

Embedded

2

Opens the Offerwall in an embedded WKWebView.


Deeplinking & Routing

The SDK supports routing users directly to specific sections of the offerwall.

Route

Description

Requires campaignID?

offers

Main campaigns list

No

active-offers

List of user's active campaigns

No

offers

Details for a specific campaign

Yes

support

Support tickets for a specific campaign

Yes

Example Usage:

Last updated