Post User Registration Flow API Object
Last Updated:
Overview
Currently, the default template of the Post User Registration code is missing the api parameter. It is as follows:
/**
* Handler that will be called during the execution of a PostUserRegistration flow.
*
* @param {Event} event - Details about the context and user that has registered.
*/
exports.onExecutePostUserRegistration = async (event) => {
...
}
Applies To
- Post User Registration Flow
- API Object
Solution
Here is how to define the api object in the Post User Registration Flow:
/**
* Handler that will be called during the execution of a PostUserRegistration flow.
*
* @param {Event} event - Details about the context and user that has registered.
* @param {PostUserRegistrationAPI} api - Details about the context and user that has registered.
*/
exports.onExecutePostUserRegistration = async (event, api) => {
...
}
The current usable functions in the api object are:
api.cache.get()- Get a cache itemapi.cache.set()- Set a cache itemapi.cache.delete()- Delete a cache item