Initialize the SDK

There are 2 ways to initialize the SDK:

Option 1 | Pass a configuration object

  1. Create a configuration object called ConfigModel:
val config = ConfigModel(
  checkoutPublicKey = "XXXXXXXxxxxxxxXXXXXXXxxxxxxXXXXXXXX",
  environment = "sandbox", // "sandbox" or "production"
  customerId = "PLAYER_ID"
)
ArgumentTypeRequired?Description
checkoutPublicKeystringYesThe checkout public key, located in the Publisher Dashboard. In the sidebar menu, click Settings, then select the Integration tab. Copy the Checkout Public Key value.
environmentstringYesThe checkout environment.
One of:

- sandbox: For testing.

- production: For live operations.
customerIdstringYesThe player ID.
  1. Initialize the SDK with the ConfigModel:
bridgeAPI.init(context: Context, config: ConfigModel, callback: IUpdateCallback) {...}
ArgumentTypeDescription
contextandroid.content.ContextThe current Activity context.
configConfigModelConfiguration options for the initialization.
callbackIUpdateCallbackInterface callback.

Option 2 | Pass arguments directly

Initialize the SDK with the individual arguments:

bridgeAPI.init(
  context: Context,
  environment: String,
  checkoutPublicKey: String,
  customerId: String,
  callback: IUpdateCallback
) {...}
ArgumentTypeDescription
contextandroid.content.ContextThe current Activity context.
environmentStringThe checkout environment.
One of:

- sandbox: For testing.

- production: For live operations.
checkoutPublicKeyStringThe checkout public key, located in the Publisher Dashboard. In the sidebar menu, click Settings, then select the Integration tab. Copy the Checkout Public Key value.
customerIdStringThe player ID.
callbackIUpdateCallbackInterface callback.