This repository contains a basic React Native Expo application integrated with Auth0 to authenticate users and call a protected API endpoint.
Check out the article "Call Protected APIs from a React Native Mobile Application"
This application uses the react-native-auth0
SDK which is not compatible with "Expo Go" app. It is compatible only with Custom Dev Client and EAS builds.
-
Install all dependencies with
npm install
-
Copy the
.env.example
file to.env
and complete the values forAUTH0_DOMAIN
,AUTH0_CLIENT_ID
, andAUTH0_AUDIENCE
from your Auth0 settings. -
Set up an API using the stack of your choice following one of our API guides
-
Set the environment variable
API_URL
to match the root URL of your API -
Run the mobile application in your favorite mobile platform:
# iOS target platform npm run ios # Android target platform npm run android