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.

Related Concepts