SDK Objects

The SDK consists of the following classes.

Personalization Class

Personalization is the main class. You can use an instance of this to invoke the different methods of SDK.

Create an instance of this class using the following code:

Personalization personalization = new Personalization(user,account);

account and user are classes, and must be initialized to use as arguments for creating an instance of personalization. Refer to the objects below for information on how to initialize them.

Account Object

This object contains information about the account.

Create an instance of this class using the following code:

Account account = new Account();     
account.setDomain(""); // Domain name
account.setName(""); // Account name
account.setInstance(""); // Instance for the domain
account.setShortname(""); // Short name for the account

You must provide data for the Account object.

Example code:

Account account = new Account();     
account.setDomain("monetate.mybigcommerce.com");
account.setName("a-3e41bf76");
account.setInstance("p");
account.setShortname("monetatebc");

User Object

This object contains information about the user.

Create an instance of this class using the following code:

User user = new User(); 
user.setCustomerId(null); // Customer ID
user.setDeviceId(null); // Device ID

You must provide the device ID.

The customer ID is optional. If this ID is defined, you must also pass it in all calls along with the device ID. If you need to later change the customer ID, use the setCustomerId method.