Custom Storage

The Web SDK by default uses Local Storage as the storage mechanism for persistent data like Access TokenAccess Token - Token that grants access to the LiveLike REST API. Access tokens can have two levels: Profile and Admin. Profile access tokens (obtained via the SDK/APIs) allow you to store and access data for specific users, but have restricted functionality. Admin access tokens (obtained via the Producer Site) have no restrictions and allow you full access to the LiveLike REST APIs. and cached user data. If you prefer to use some other storage like cookies, you can do so by adding passing a storageStrategy property to LiveLike.init.

The storageStrategy property must be an object with a get and a set method.

Example

const localStorageStorageStrategy = {
  get: () => JSON.parse(localStorage.getItem('your-key')),
  set: (data) => localStorage.setItem('your-key', JSON.stringify(data))
}

LiveLike.init({
  clientId: "YOUR-CLIENT-ID",
  storageStrategy: localStorageStorageStrategy
})