This app demonstrates @unkey/ratelimit and how you can rate limit your React-Native Expo routes. Setup the app and try sending emails.
react-native-unkey.mp4
-
Go to unkey ratelimits
-
Create a new namespace with the name
unkey-react-native
-
Go to settings/root-keys and create a root key with Ratelimit permissions
-
You can follow this link to create the root key with ratelimit permissions https://app.unkey.com/settings/root-keys/new?permissions=ratelimit..create_namespace,ratelimit..read_namespace,ratelimit..limit,ratelimit..update_namespace,ratelimit.*.delete_namespace
-
Add it in the .env file
UNKEY_ROOT_KEY
Copy .env.example to .env
cp .env.example .env
Set the unkey root-key that we just created:
UNKEY_ROOT_KEY=
Set the resend API key that we just created:
RESEND_API_KEY=
If you are going to run the app on mobile ( ios/android ) set the base URL as your IP http://192.168.x.x:8081
. To run on the web you can set the URL as http://localhost:8081
EXPO_PUBLIC_API_URL
Install dependencies:
npm install
Start the app. Scan the QR displayed after this to run the app on mobile. If you want to run it on the Web it will start on port 8081
npm run start