Skip to content
Dashboard

Migration to v2

Two paths lead to @swmansion/react-native-detour@2.0.0. Pick the one that matches your current version:

AreaIn 0.xIn 2.0.0
Config keyLegacy API_KEY form in older integrationsapiKey
Link data in contextlinkRoute / legacy fieldslink object (route, pathname, params, url, type)
Link-source controlNo explicit mode in older flowslinkProcessingMode: 'all' | 'web-only' | 'deferred-only'
Device fingerprint dependenciesreact-native-device-infoexpo-constants + expo-device
Expo Web behaviorNot explicitly guardedDetourProvider disabled on web (no-op context)

Remove old dependency:

Terminal window
npm uninstall react-native-device-info

Install current peer dependencies:

Terminal window
npm install expo-localization expo-clipboard expo-constants expo-device @react-native-async-storage/async-storage expo-application

If you use Yarn/PNPM/Bun, use equivalent commands from Installation.

// before (legacy)
const config = {
API_KEY: process.env.EXPO_PUBLIC_DETOUR_API_KEY,
appID: process.env.EXPO_PUBLIC_DETOUR_APP_ID,
};
// after
const config = {
apiKey: process.env.EXPO_PUBLIC_DETOUR_API_KEY,
appID: process.env.EXPO_PUBLIC_DETOUR_APP_ID,
linkProcessingMode: 'all',
};
// before (legacy route string)
const { isLinkProcessed, linkRoute, clearLink } = useDetourContext();
if (isLinkProcessed && linkRoute) {
router.replace(linkRoute);
clearLink();
}
// after
const { isLinkProcessed, link, clearLink } = useDetourContext();
if (isLinkProcessed && link) {
router.replace({ pathname: link.pathname, params: link.params });
clearLink();
}
  • 'all' (default) — deferred + Universal/App + scheme links
  • 'web-only' — deferred + Universal/App links, no scheme links
  • 'deferred-only' — deferred only (recommended if Expo Router +native-intent.tsx handles runtime links)
AreaIn 1.0.1In 2.0.0
Device fingerprint dependenciesreact-native-device-infoexpo-constants + expo-device
Peer dependency install commandIncluded react-native-device-infoUses Expo modules only (no react-native-device-info)
Expo Web behaviorNot explicitly guardedDetourProvider is disabled on web (no-op context + one dev warning)
  1. Remove old dependency:
Terminal window
npm uninstall react-native-device-info
  1. Install current peer dependencies:
Terminal window
npm install expo-localization expo-clipboard expo-constants expo-device @react-native-async-storage/async-storage expo-application

If you use Yarn/PNPM/Bun, use equivalent commands from Installation.

In 2.0.0, DetourProvider does not initialize on Expo Web. It returns a no-op context instead:

  • isLinkProcessed: true
  • link: null
  • clearLink: () => {}

This keeps the app tree stable and avoids a partial initialization on a platform the SDK does not support.

Whichever path you took, confirm that:

  1. The iOS and Android deferred flow still resolves the route and its parameters.
  2. Runtime Universal/App Links still resolve according to linkProcessingMode.
  3. Expo Web no longer attempts Detour processing, and the app renders without provider errors.
  4. Exactly one DetourProvider is mounted in the app root.