# Initialize the SDK

To initialize the SDK, call the PubscaleOfferwall.init() method.

Pass the app API key (generated from the console) as the first parameter of the init method. Make sure to call the init method as soon as your app starts up, ideally in app.js or index.js.

#### Optional Parameters:

**user\_id:** Pass your user's id in this field to tag your user. This id will be sent along with the S2S callback. Make sure to call the init function every time the user id changes.&#x20;

**background\_Base64:** An image that will be displayed as a banner on top of the offer wall. Pass the image in base64 encoded format. The background will be black by default.

**appicon\_Base64:** An image that will be displayed in the center on the top banner of the offerwall. Pass the image in base64 encoded format. Default value is the app icon.



### Initializing the SDK

{% hint style="info" %}
Use sandbox environment app ID for testing purposes.&#x20;

[sandbox-environment](../sandbox-environment/sandbox-environment "mention") - Learn how to setup Sandbox environment
{% endhint %}

```jsx
import {NativeModules, Alert} from 'react-native';
const {PubscaleOfferwall} = NativeModules;

//initialises the SDK.
//call init once the user is logged in.

PubscaleOfferwall.init( "APP_ID", {
    "user_id": "test-user", //optional, but require to tag user to offer completion.
    "background_Base64": base64Image,
    "appicon_Base64": app64Image, //optional
}, () => { //onSuccess Callback
    console.log("success")
}, (errMsg)=>{ //onFailure Callbacks
    console.log(errMsg)
})
```



The SDK Initialization is complete. Learn how to launch the offerwall in the next step.
