> ## Documentation Index
> Fetch the complete documentation index at: https://docs.threetone.in/llms.txt
> Use this file to discover all available pages before exploring further.

# Expo and React Native

> Prepare a mobile client with explicit microphone permissions, server-owned credentials, and lifecycle-aware connection handling.

Prepare an Expo application that can explain its connection state, request microphone access deliberately, and stop capture when the user ends a session. Test these application behaviors before connecting a future agent transport.

<Note>
  There is no verified Threetone Expo package or working mobile conversation walkthrough. Public session initiation remains gated. This cookbook covers mobile preparation and supported server-side configuration reads.
</Note>

## Before you begin

Use an Expo project with recorded Expo and React Native versions, a physical test device, and an authenticated application backend. Decide which data the mobile user may access and whether the application needs microphone input at all.

<Steps>
  <Step title="Keep workspace credentials on the backend" id="expo-cookbook-credentials">
    Follow the [server-side quickstart](/agents-platform/guides/quickstarts/server-side) to read permitted agent configuration. Return only the application data the user is allowed to see. Expo's [environment guide](https://docs.expo.dev/guides/environment-variables/) explains that `EXPO_PUBLIC_` values are bundled into the application; they must not contain workspace API keys.
  </Step>

  <Step title="Prepare permission and capture states" id="expo-cookbook-permissions">
    Follow the version-matched [Expo Audio documentation](https://docs.expo.dev/versions/latest/sdk/audio/) for native configuration and recording permissions. Test denied permission, a later permission change, and explicit stop. Show when capture is active. A local recording test does not prove agent streaming support.
  </Step>

  <Step title="Handle app and network transitions" id="expo-cookbook-lifecycle">
    Use React Native's [AppState](https://reactnative.dev/docs/appstate) to observe foreground and background changes. Define whether capture stops or a future session ends when the app leaves the foreground. After a network interruption, recheck authentication and session state before reconnecting. Do not replay buffered audio or tool actions without a released replay contract.
  </Step>

  <Step title="Review logout and recovery" id="expo-cookbook-cleanup">
    Release local audio resources, clear pending work, and remove application session material on logout. [SecureStore](https://docs.expo.dev/versions/latest/sdk/securestore/) can protect suitable local values, but it is not a reason to distribute a shared workspace key. Handle unavailable stored credentials by requiring sign-in again.
  </Step>
</Steps>

The result is a tested mobile lifecycle and a reviewed server boundary. Consult [React Native deployment](/agents-platform/deploy/mobile/react-native) before adding any future session transport.

## Frequently asked questions

<AccordionGroup>
  <Accordion title="Does a successful microphone test mean live voice works?" id="faq-expo-cookbook-voice">No. Device capture, network transport, session authorization, and agent execution are separate checks.</Accordion>
  <Accordion title="Should the app retry every connection error?" id="faq-expo-cookbook-retry">Use bounded retries only for recoverable failures. Stop on denied permission, expired access, user cancellation, or an unavailable runtime.</Accordion>
</AccordionGroup>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.