RealComposer

React Native Safe & Unsafe Practices

Direct Answer

React Native JavaScript bundles ship inside the app and can be extracted, and Expo inlines EXPO_PUBLIC_ variables into that bundle. Keep secret keys off the device, store session tokens with SecureStore or Keychain, and proxy private API calls.

Credentials & Where They Belong

Client safe
EXPO_PUBLIC_ variables

Inlined into the JavaScript bundle.

Client safe
Session tokens

Store with expo-secure-store or Keychain wrappers.

Server only
Upstream API secrets

Never in app config or bundled files.

Safe Practices

  • Use SecureStore for tokens

    It is backed by Keychain on iOS and Keystore on Android.

  • Slim payloads before JSON parsing

    Large JSON parsing blocks the JS thread and causes dropped frames.

Unsafe Practices

  • Storing tokens in AsyncStorage

    AsyncStorage is unencrypted and readable on compromised devices.

  • Putting secret keys in app.config or react-native-config

    Those values are bundled into the binary.

The RealComposer Pattern

Ship only a client token in the React Native app and call RealComposer edge URLs that return compact, pre-shaped JSON for each screen.

START BUILDING FREE

Frequently Asked Questions

Q:Are EXPO_PUBLIC_ environment variables secret?

No. Expo inlines them into the bundle, so treat them as public.

React Native Recipes

Security & Secret Vault

Hide firebase api key in react native mobile app

Client uses anon rules; privileged reads run through edge proxy with Firebase tokens injected. For "hide firebase api key in react native mobile app", store FIREBASE_ACCESS_TOKEN in Secret Vault, call https://firestore.googleapis.com/v1/projects/{{query.projectId}}/databases/(default)/documents/{{query.collection}}/{{query.docId}} from a Worker, and let React Native hit only https://realcomposer.com/v1/workspace/hide-firebase-api-key-react-native with an rc_live_ client token.

Sub-10ms edgeView Recipe
Multi-API Aggregation

Stitch firebase with clerk session bootstrap

Clerk session and Firebase FCM registration merged at startup. For "stitch firebase with clerk session bootstrap", store FIREBASE_ACCESS_TOKEN, CLERK_SECRET_KEY in Secret Vault, call https://firestore.googleapis.com/v1/projects/{{query.projectId}}/databases/(default)/documents/{{query.collection}}/{{query.docId}} from a Worker, and let React Native hit only https://realcomposer.com/v1/workspace/stitch-firebase-with-clerk-bootstrap with an rc_live_ client token.

Sub-10ms edgeView Recipe
Payload Slimmer

Salesforce api response too large trim fields mobile

Map only id name email and owner fields; drop nested attributes URLs. For "salesforce api response too large trim fields mobile", store SALESFORCE_ACCESS_TOKEN in Secret Vault, call https://{{secrets.SALESFORCE_INSTANCE}}.my.salesforce.com/services/data/v68.0/sobjects/Contact/{{query.contactId}} from a Worker, and let React Native hit only https://realcomposer.com/v1/workspace/trim-salesforce-json-for-mobile with an rc_live_ client token.

Sub-10ms edgeView Recipe
Payload Slimmer

Firebase user profile api strip sensitive fields

Remove refresh tokens providerData internals at edge. For "firebase user profile api strip sensitive fields", store FIREBASE_ACCESS_TOKEN in Secret Vault, call https://firestore.googleapis.com/v1/projects/{{query.projectId}}/databases/(default)/documents/{{query.collection}}/{{query.docId}} from a Worker, and let React Native hit only https://realcomposer.com/v1/workspace/strip-firebase-user-profile-sensitive with an rc_live_ client token.

Sub-10ms edgeView Recipe
Security & Secret Vault

Linear api proxy for react native app

iOS and Android call one edge URL for Linear issue lists. For "linear api proxy for react native app", store LINEAR_API_KEY in Secret Vault, call https://api.linear.app/graphql from a Worker, and let React Native hit only https://realcomposer.com/v1/workspace/linear-api-proxy-react-native with an rc_live_ client token. POST upstream calls are not stored in caches.default; clients must send JSON bodies and headers forward unchanged.

Sub-10ms edgeView Recipe
Security & Secret Vault

Mailchimp api proxy for react native signup

Mobile posts to edge; Mailchimp list subscribe runs server-side. For "mailchimp api proxy for react native signup", store MAILCHIMP_BASIC_AUTH in Secret Vault, call https://{{secrets.MAILCHIMP_DC}}.api.mailchimp.com/3.0/lists/{{query.listId}}/members?count=10 from a Worker, and let React Native hit only https://realcomposer.com/v1/workspace/mailchimp-api-proxy-react-native with an rc_live_ client token.

Sub-10ms edgeView Recipe

Related Concepts