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

NodeJS

Integrate your NodeJS app with us using our NodeJS package

Installation

Add @tyrads.com/tyrads-sdk-iframe to your package.json as follows:

npm install --save @tyrads.com/tyrads-sdk-iframe
# or
yarn add @tyrads.com/tyrads-sdk-iframe

The latest available version of NodeJS @tyrads.com/tyrads-sdk-iframe is v0.2.2.

Get Started

After successfully installing our package, create a TyrAdsSdk object with your API key and API secret:

const tyradsSDK = TyradsSDK.make(API_KEY, API_SECRET);

Localization

This TyrAdsSdk class also supports localization, more info about localization

For example:

const tyradsSDK = TyradsSDK.make(API_KEY, API_SECRET, "en");

Authentication

You can do the authentication by calling to our package

After obtaining the token successfully, you can call iframeUrl method to get the iframe URL

  1. A new token must be requested each time a user wants to access the offerwall.

  2. Each token is valid for 7 days only

Deeplinking Routes

This iframeUrl method also supports deeplinking, more info about deeplinking routes

For example:

Embedding The Iframe

If your website is using html, you can add an iframe to your page to integrate TyrAds web:

For example:

Media Source Data Sending

The authenticate method accepts additional user attributes for UTM/media-source attribution. Example request payload:

Attributes Table

Parameter
Type
Description/ Formatting

publisherUserId

String

Specific identifier of a user for conversion tracking

age

Int

User's age (e.g. "1-99"

gender

Int

User's gender (e.g. "1-Male", "2-Female"

email

String

User's email address

phoneNumber

String

User's phone number. Prefix + must be replaced with 00 (e.g. 0015555551234)

sub1 to sub5

String

Custom parameters for publisher tracking

userGroup

JSON String

Segment identifier passed as a JSON string (a stringified JSON object, not a raw JSON object). [e.g. "{\"promo_affinity_ratio\":0.42,\"dynamic_payer_segment\":\"NonPayer\",\"activity_segment\":\"Tier 3\",\"seniority_segment\":\"Tier 4\",\"rewarded_video_watcher_category\":\"High\"}"] **Can be any usergroup data that you would want to pass.

mediaSourceName

l

Platform of acquisition (e.g. "Facebook", "Google")

mediaSourceId

String

Unique ID representing the media source

mediaSubSourceId

String

Sub-source ID

incentivized

Boolean

If the acquisition was via incentivized networks

mediaAdsetName

String

Acquisition ad set name

mediaAdsetId

String

Acquisition ad set ID

mediaCreativeName

String

Acquisition ad creative asset name

mediaCreativeId

String

Acquisition ad creative asset ID

mediaCampaignName

String

Associated ad campaign name

engagementId

Int

Optional engagement identifier to associate SDK activity with specific user engagements or campaigns

Implementation of Placement ID

The placementId identifies the specific placement (ad unit) that the offerwall or widget is opened from, allowing you to track and configure performance per placement. Pass it as an argument to the iframeUrl or iframePremiumWidget methods, and the SDK appends it to the generated URL as a placementId query parameter. The optional second argument lets you deeplink to a specific route (for iframeUrl) or specify a widget name (for iframePremiumWidget). The examples below show the method calls and their resulting URLs:

Example

For example implementation using our NodeJS SDK, you can find it here

Last updated