Hi everyone, I'm currently struggling with using `client.get` and `client.set` in custom managed com

Hi everyone, I'm currently struggling with using client.get and client.set in custom managed components. I'm 99% certain that my code worked before, but after checking today, it's not behaving like I expected it to. Shouldn't the following code log the value the second time I visit the page? I have enabled the "Access client key-value store" permission for this component.
manager.addEventListener('pageview', event => {
const { client } = event
const id = client.get('someId')
console.log('id', id)
if (!id) {
client.set('someId', '4711')
}
})
manager.addEventListener('pageview', event => {
const { client } = event
const id = client.get('someId')
console.log('id', id)
if (!id) {
client.set('someId', '4711')
}
})
0 Replies
No replies yetBe the first to reply to this messageJoin

Did you find this page helpful?