> For the complete documentation index, see [llms.txt](https://docs.blueseasx.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.blueseasx.com/server-bidding/sdk-integration/initialize-sdk.md).

# Initialize SDK

Refer to [Android](/android/initialize-sdk.md) and [iOS](/ios/initialize-sdk.md)

After SDK initialization, please use the following API to get a token, later this will be passed in the bidding request. The token can be stored and used repeatedly during an app’s running lifecycle. If you start a new session to initialize the SDK, then use the API to get a new token.

**Android**

```
Token tokenObj = BlueseasxSDK.getToken();
AdError adError = tokenObj.getError();
String token = "";
if (adError != null) {
  Log.e(AdApplication.TAG, "token error, errorCode=" + adError.getCode() + ", message=" + adError.getMessage());
} else {
  token = tokenObj.getToken();
  Log.e(AdApplication.TAG, "token success, token=" + token);
}
```

**iOS**

```
BSXToken *tokenObj = [BlueSeaSDK getToken];
BSXAdError *adError = tokenObj.error;
NSString *token = @"";
if (adError) {
  NSLog(@"#Demo# getToken error, errorCode=%d, errorMsg=%@", adError.errorCode, adError.errorMsg);
} else {
  token = tokenObj.token;
  NSLog(@"#Demo# getToken success, token=%@", token);
}
```
