SDK Installation (React Native)
Detour provides a React Native SDK (@swmansion/react-native-detour) compatible with Expo and bare React Native projects.
Before installation, make sure your app is created in the Detour Dashboard and you have:
appIDfrom API configuration- publishable
apiKeyfrom API configuration - platform integration snippets from App configuration
Install package
- NPM
- YARN
- PNPM
- BUN
npm install @swmansion/react-native-detour
yarn add @swmansion/react-native-detour
pnpm add @swmansion/react-native-detour
bun add @swmansion/react-native-detour
Install peer dependencies
- NPM
- YARN
- PNPM
- BUN
npm install expo-localization react-native-device-info expo-clipboard @react-native-async-storage/async-storage expo-application
yarn add expo-localization react-native-device-info expo-clipboard @react-native-async-storage/async-storage expo-application
pnpm add expo-localization react-native-device-info expo-clipboard @react-native-async-storage/async-storage expo-application
bun add expo-localization react-native-device-info expo-clipboard @react-native-async-storage/async-storage expo-application
@react-native-async-storage/async-storageis optional if you provide a custom storage adapter in config. See Custom Storage.
After installing
react-native-device-infoin Expo managed workflow, create a custom development build: https://docs.expo.dev/develop/development-builds/introduction/
Credentials in app config
import { type Config } from '@swmansion/react-native-detour';
export const detourConfig: Config = {
apiKey: process.env.EXPO_PUBLIC_DETOUR_API_KEY!,
appID: process.env.EXPO_PUBLIC_DETOUR_APP_ID!,
shouldUseClipboard: true,
};
Keep apiKey and appID in environment variables or another secure configuration layer.
Next steps
- Implement the provider and link handling in SDK Usage.
- Pick a runnable app pattern in Examples.
- If upgrading existing code, follow Migration to v1.