Can't Update Current User

Calling the code below as explained in the docs doesn’t seem to work. The user’s properties are not updated, and the result does not return a failure indicating something went wrong. I can get it to work through the REST API so maybe I’m doing something wrong.

const result = await kitty.updateCurrentUser(user => {
    user.properties = {
        test: 123
    }

    return user;
})

console.log(result.succeeded) // Output: true
console.log(result.user.properties) // Output: {} <-- Expected: {test:123}

Hey @MrGVSV, kitty.updateCurrentUser( ... ) returns a promise. You have to await the function or use the then function to get the result.

Like this

const result = await kitty.updateCurrentUser((user) => {
      user.properties = {
        test: 123,
      };

      return user;
    });

console.log(result.user.properties) // Output: {test:123}

My apologies, I left off the await in the question. I meant to put that. I updated the question.

1 Like

Hey @MrGVSV, I’ve tested updating the current user properties with the same code and it’s working. Can you provide some additional context to help me figure this out? You can direct message me a printout of the result object. Thanks