Installation
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
Section titled “Install package”npm install @swmansion/react-native-detouryarn add @swmansion/react-native-detourpnpm add @swmansion/react-native-detourbun add @swmansion/react-native-detourInstall peer dependencies
Section titled “Install peer dependencies”npm install expo-localization react-native-device-info expo-clipboard @react-native-async-storage/async-storage expo-applicationyarn add expo-localization react-native-device-info expo-clipboard @react-native-async-storage/async-storage expo-applicationpnpm add expo-localization react-native-device-info expo-clipboard @react-native-async-storage/async-storage expo-applicationbun add expo-localization react-native-device-info expo-clipboard @react-native-async-storage/async-storage expo-applicationCredentials in app config
Section titled “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
Section titled “Next steps”- Implement the provider and link handling in Usage.
- Pick a runnable app pattern in Examples.
- If upgrading existing code, follow Migration to v1.