Custom Storage
The Web SDK by default uses Local Storage as the storage mechanism for persistent data like Access Token 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
})
Updated 12 months ago