Update user attributes e.g. user phone number
In this example, we demonstrate how to update a user's attributes, such as their phone number, using the OneEntry API.
โ
Purpose of the scenario:
- The user auth with a login and password
- We get the current user data to pre-fill the frontend form
- The user edits a field (e.g. phone) and saves
- Saves user data in OneEntry Platform
โ
What you need:
- A valid PROJECT_URL and APP_TOKEN for authentication with the OneEntry API.
- Registration form with marker "reg"
- Form fields (attributes) with markers "email_reg", "password_reg", "name_reg", "phone_reg"
- An existing, activated user to authenticate as
๐ Important:
- These examples do not include error handling.
- You can manage errors using a try-catch block or by employing a construction like await Promise.catch((error) => error).
- Ensure that the formIdentifier used in the updateUser() method matches the one configured in your OneEntry project.
๐ See in documentation:
๐ฆ SDK reference:
Loading sandboxโฆ
