Search code examples
react-nativeauth0

How to set the user id when creating a new user using react-native-auth0


When using the Auth0 API, if I create a new user, I can set the user_id. This is useful so that I can set the user with the same ID as I have in my database. So if I need to look them up or patch them, then it's quite easy.

However, in react-native-auth0 there isn't a way to do this. You can only set the email, password, username and metadata (here). But this gives a randomly generated user id which you can't change later on. I can always get the user_id from the API using the /users-by-email endpoint, but it would be easier if it was just set first time around.

Am I missing something obvious here?


Solution

  • For anyone with the same problem, after speaking to people and searching around, there is indeed no way to set it from react-native-auth0, you have to use /users-by-email endpoint, which is what I did.