> For the complete documentation index, see [llms.txt](https://sdk-doc.tyrads.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://sdk-doc.tyrads.com/iframe/installation/manual-integration.md).

# Manual Integration

{% hint style="warning" %}

#### Initialize After Media Source or MMP Initialization

Please initialize our SDK only after the media source or MMP data is initialized. This ensures that the media source data is sent correctly and prevents passing empty values.
{% endhint %}

If your platform is not supported, you can integrate with us manually by making HTTP requests to our API using any HTTP client.

## Authentication

You can make a request to our API using any HTTP client by following the API documentation below

## POST /v4.0/initialize/auth

> Initialize SDK Session

```json
{"openapi":"3.0.4","info":{"title":"TyrAds SDK","version":"4.0.0"},"servers":[{"url":"https://api.tyrads.com"}],"paths":{"/v4.0/initialize/auth":{"post":{"tags":["default"],"summary":"Initialize SDK Session","parameters":[{"name":"lang","in":"query","schema":{"type":"string"}},{"name":"X-Api-Key","in":"header","required":true,"schema":{"type":"string"}},{"name":"X-Api-Secret","in":"header","required":true,"schema":{"type":"string"}},{"name":"X-SDK-Platform","in":"header","required":true,"schema":{"type":"string"}},{"name":"X-SDK-Version","in":"header","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"publisherUserId":{"type":"string","description":"Publisher User/Customer unique ID","nullable":false},"age":{"type":"number","description":"User age","nullable":true},"gender":{"type":"number","description":"User gender, 1=male, 2=female","nullable":true},"email":{"type":"string","description":"User email","nullable":true},"phoneNumber":{"type":"string","description":"User phone","nullable":true},"identifierType":{"type":"string","enum":["GAID","OAID","IDFA","OTHER"],"description":"Device Identifier/Advertising ID Type","nullable":true},"identifier":{"type":"string","description":"Device Identifier/Advertising ID","nullable":true},"sub1":{"type":"string","nullable":true},"sub2":{"type":"string","nullable":true},"sub3":{"type":"string","nullable":true},"sub4":{"type":"string","nullable":true},"sub5":{"type":"string","nullable":true},"userGroup":{"type":"string","description":"Segment identifier passed as a JSON string (a stringified JSON object, not a raw JSON object).","nullable":true},"mediaSourceName":{"type":"string","nullable":true},"mediaSourceId":{"type":"string","nullable":true},"mediaSubSourceId":{"type":"string","nullable":true},"incentivized":{"type":"boolean","nullable":true},"mediaAdsetName":{"type":"string","nullable":true},"mediaAdsetId":{"type":"string","nullable":true},"mediaCreativeName":{"type":"string","nullable":true},"mediaCreativeId":{"type":"string","nullable":true},"mediaCampaignName":{"type":"string","nullable":true},"engagementId":{"type":"number","nullable":true}},"required":["publisherUserId"]}}},"required":true},"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"token":{"type":"string"}}},"message":{"type":"string"}}}}}},"403":{"description":"Unsuccessful operation","content":{"application/json":{"schema":{"type":"object"}}}},"422":{"description":"Unsuccessful operation","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}}},"429":{"description":"Unsuccessful operation","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}}}}}}}}
```

{% hint style="info" %}

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
   {% endhint %}

After obtaining the token successfully, you can pass the token to our iframe link and embed the iframe on your page.

```
https://v4.sdk.tyrads.com?token=[TOKEN_HERE]
```

For example:

```
https://v4.sdk.tyrads.com?token=eyJ2YWwiOiI3M3NIeUpNQlp4QzA1TlRHVzhxRExhWWNTeUQ5TTJIT0h3NXBvL3djVVp1Z09MR20wOTJJOTRReDBuYUFLeXhmVGRCaGYra2gvVGcydWFlbUh6aWR6S00vTmV0SEtVZVlWNk5Pdkc5Wnd5bytkSkxmUnA0aWt2eE9yQ01YTXF6LzBnRmZ3RUpucHMxem95WnRkYkVlQXJQNER3cDRZVkttb1lBdEIrZlB6cFZ3R25SSEE5UjROa2U2cGJTeTJod2c2UmI3UnN0QzZiN2Y2cENBYTlqaEhvQXhtdjM5UERPU2tDdWpHMmJIQ2N1cVRldVQ4a3hDSEE9PSIsInZlYyI6InNWbzZrejZRa09iS0tDeDUiLCJ0YWciOiJ1eDNnbjEwNEdUWXpvV1J2TTZVck1BPT0ifQ==
```

### Embedding The Iframe

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

```html
<iframe id="tyrads_iframe" src="[IFRAME_LINK]" height="650" width="300"></iframe>
```

For example:

```html
<iframe id="tyrads_iframe" src="https://v4.sdk.tyrads.com?token=eyJ2YWwiOiI3M3NIeUpNQlp4QzA1TlRHVzhxRExhWWNTeUQ5TTJIT0h3NXBvL3djVVp1Z09MR20wOTJJOTRReDBuYUFLeXhmVGRCaGYra2gvVGcydWFlbUh6aWR6S00vTmV0SEtVZVlWNk5Pdkc5Wnd5bytkSkxmUnA0aWt2eE9yQ01YTXF6LzBnRmZ3RUpucHMxem95WnRkYkVlQXJQNER3cDRZVkttb1lBdEIrZlB6cFZ3R25SSEE5UjROa2U2cGJTeTJod2c2UmI3UnN0QzZiN2Y2cENBYTlqaEhvQXhtdjM5UERPU2tDdWpHMmJIQ2N1cVRldVQ4a3hDSEE9PSIsInZlYyI6InNWbzZrejZRa09iS0tDeDUiLCJ0YWciOiJ1eDNnbjEwNEdUWXpvV1J2TTZVck1BPT0ifQ==" height="650" width="300"></iframe>
```

## 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:

```
// iframeUrl(token, null, 123)
https://v4.sdk.tyrads.com?token=demo.jwt.token&placementId=123

// iframeUrl(token, "/offers/3454", 123)
https://v4.sdk.tyrads.com?token=demo.jwt.token&to=%2Foffers%2F3454&placementId=123

// iframePremiumWidget(token, null, 123)
https://v4.sdk.tyrads.com/widget?token=demo.jwt.token&placementId=123

// iframePremiumWidget(token, "rewards", 123)
https://v4.sdk.tyrads.com/widget?token=demo.jwt.token&name=rewards-widget&placementId=123
```

## Deeplinking Routes

The Tyrads SDK supports deeplinking to specific sections of the offerwall. When initializing or interacting with the SDK, you can specify a route to open a particular page. For campaign-specific routes, you'll need to provide the campaignID as well. Click [here](broken://pages/MKFNwkbxpNryiN9b0Cnj)

## Localization

### Overview

In addition to using URL parameters, the web application itself can change the localization settings. This allows users to switch languages directly within the application. Click [here](broken://pages/X0gL2BEg4Nc9tWOV2urd)
