setAppMetadata & setUserMetadata not working

Hi! I am currently trying to create an action which is Post Registration and creates some App Metadata for the user. However, even if I break down my code into just these few lines:

exports.onExecutePostUserRegistration = async (event, api) => {

api.user.setAppMetadata(“key”, “value”);

};

It still throws the following error:

“Cannot read properties of undefined (reading ‘setAppMetadata’)”

I already have searched the forums but I’m still unable to find a solution. Any help is very appreciated! Thank you so much in advance!!

Hey @anonetics welcome to the community!

Sorry for the delayed response here - As noted in the following post, adding app and or user metadata to users should be done in pre registration or post login actions:

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.