The same plugin works in an Expo app. Reviewers comment on a screen inside the app, and each comment goes to your project. It supports Expo SDK 58, and React Native 0.83 or later.
Install
npx expo install @ontrackd/expo
npm and pnpm install every module it needs. With Yarn, which does not install them, name them all. npx expo install runs Yarn for you and picks the versions that match Expo SDK 58:
npx expo install @ontrackd/expo expo-crypto expo-secure-store expo-constants expo-web-browser @expo/config react-native-safe-area-context
Install @ontrackd/expo instead of ontrackd, not beside it. The app imports the overlay at runtime, so it is a regular dependency, not a dev dependency.
Let reviewers attach photos and files
Optional. The attach button appears once a picker is installed.
npx expo install expo-image-picker expo-document-picker
Apple rejects a TestFlight upload that uses the photo library or the camera without saying why.
Add the sentences to app.json:
{
"expo": {
"plugins": [
["expo-image-picker", {
"photosPermission": "Attach a photo to your feedback.",
"cameraPermission": "Take a photo to attach to your feedback."
}]
]
}
}
Then rebuild the app.
Moving from @ontrackd/feedback
- Remove
@ontrackd/feedback. - Run
npx expo install @ontrackd/expo. - Change the four import paths:
@ontrackd/feedback/expo-go/metrobecomes@ontrackd/expo/go/metro,@ontrackd/feedback/expo-gobecomes@ontrackd/expo/go,@ontrackd/feedback/expo/metrobecomes@ontrackd/expo/metro, and@ontrackd/feedback/expobecomes@ontrackd/expo. - Restart Metro with
--clear.
Connect a coding agent
Run npx feedback-mcp init. It works through @ontrackd/expo.
Set the project secret
ONTRACKD_SECRET is your project’s secret from the Ontrackd dashboard. The older name FEEDBACK_SECRET still works. It carries the project, so no other variable is needed. Locally, put it in .env and keep that file out of version control.
ONTRACKD_SECRET=sk_prj_…
Metro reads it when it builds the bundle. It is never embedded in the app.
Try it in Expo Go
If your app doesn’t run in Expo Go, skip to An app with a development build.
In metro.config.js:
const { getDefaultConfig } = require('expo/metro-config');
const { withFeedback } = require('@ontrackd/expo/go/metro');
module.exports = withFeedback(getDefaultConfig(__dirname), { mode: 'cloud' });
In your root component, create the adapter once at module level and wrap the app:
import { FeedbackProvider, createExpoGoAdapter } from '@ontrackd/expo/go';
const feedbackAdapter = createExpoGoAdapter();
export default function App() {
return (
<FeedbackProvider adapter={feedbackAdapter}>
{/* your app */}
</FeedbackProvider>
);
}
createExpoGoAdapter works in development only. It throws outside Expo Go or in a production bundle.
In Expo Go the app is identified by its Expo account and slug, so your app config needs owner and slug.
With expo-router, wrap the root layout in app/_layout.tsx instead. Pass route={usePathname()} to FeedbackProvider to record the screen in each comment.
Ship it in a TestFlight build
A build you install on a device uses the expo entries instead of expo-go. That covers a development build, a TestFlight build and an EAS build. Which Metro setup you need depends on how you run the app while you develop.
An app with a development build
If your app uses expo-dev-client, or native modules that Expo Go doesn’t include, it never runs in Expo Go. Use the expo entries everywhere.
In metro.config.js:
const { getDefaultConfig } = require('expo/metro-config');
const { withFeedback } = require('@ontrackd/expo/metro');
const mode = process.env.ONTRACKD_SECRET ? 'cloud' : 'off';
module.exports = withFeedback(getDefaultConfig(__dirname), { mode });
In your root component:
import { FeedbackProvider, createExpoAdapter } from '@ontrackd/expo';
const feedbackAdapter = createExpoAdapter();
Wrap the app in <FeedbackProvider adapter={feedbackAdapter}> as above. To try it on your phone, npx expo run:ios --device builds the development build and installs it. Metro reads ONTRACKD_SECRET from .env.
An app that also runs in Expo Go
If you develop in Expo Go and build on EAS, use the Expo Go wrapper locally and the installed-build wrapper on EAS. EAS sets EAS_BUILD=true during its builds:
const { getDefaultConfig } = require('expo/metro-config');
const config = getDefaultConfig(__dirname);
const mode = process.env.ONTRACKD_SECRET ? 'cloud' : 'off';
const { withFeedback } = process.env.EAS_BUILD === 'true'
? require('@ontrackd/expo/metro')
: require('@ontrackd/expo/go/metro');
module.exports = withFeedback(config, { mode });
In your root component, pick the adapter the same way. Both entries export the same FeedbackProvider:
import Constants, { ExecutionEnvironment } from 'expo-constants';
import { FeedbackProvider, createExpoAdapter } from '@ontrackd/expo';
import { createExpoGoAdapter } from '@ontrackd/expo/go';
const feedbackAdapter = Constants.executionEnvironment === ExecutionEnvironment.StoreClient
? createExpoGoAdapter()
: createExpoAdapter();
Don’t run a development build against this config locally. Outside EAS it bundles for Expo Go, and createExpoAdapter refuses that bundle. An app with a development build uses the setup above.
Your app’s identity
Your app config needs ios.bundleIdentifier, and android.package for Android. The build is tied to that identity, and the overlay refuses to start in a different app.
In the dashboard, create the project as a Mobile app and add that identifier under Settings → Allowed apps. For Expo Go, add your owner/slug. A Mobile project has no allowed sites, and builds of an app that isn’t on its list are refused.
Review builds and store builds
Give the build you send to reviewers ONTRACKD_SECRET, and leave it out of the build you send to the App Store. Without it, Metro bundles with mode: 'off' and the store build carries no overlay.
Build with EAS
Add the secret on the environment your review profile uses (for example preview), not on production:
eas env:set --name ONTRACKD_SECRET --environment preview --visibility secret
The CLI asks for the value, so it stays out of your shell history. Then point the review profile at that environment in eas.json:
{
"build": {
"review": { "distribution": "store", "environment": "preview" },
"production": { "environment": "production" }
}
}
Build with Xcode Cloud
Metro runs inside the Xcode build, in the “Bundle React Native code and images” phase. That phase reads ios/.xcode.env.local, so hand the secret over through that file.
- In App Store Connect, add
ONTRACKD_SECRETas a secret environment variable to the workflow that builds review builds. Have that workflow distribute to an internal TestFlight group. - Keep the workflow that builds your App Store release without it.
- Add
ios/ci_scripts/ci_pre_xcodebuild.sh, or add these lines to the one you have:
#!/bin/sh
set -e
# Only the review workflow sets ONTRACKD_SECRET. Without it the build bundles with the overlay off.
if [ -n "$ONTRACKD_SECRET" ]; then
printf "export ONTRACKD_SECRET='%s'\n" "$ONTRACKD_SECRET" >> "$(dirname "$0")/../.xcode.env.local"
fi
Make it executable with chmod +x ios/ci_scripts/ci_pre_xcodebuild.sh, or Xcode Cloud skips it. .xcode.env.local is ignored by git, and Xcode Cloud discards the build machine after each build.
Send reviewers the review workflow’s builds, and never promote one of them to the App Store.
Reviewers
Reviewers sign in with an email code inside the app. That sign-in is the access boundary, so you do not need a list of allowed builds. Sending reviewers to a TestFlight build is enough.
Provider options
FeedbackProvider takes these props:
adapter: the adapter fromcreateExpoGoAdapterorcreateExpoAdapter.route: the current screen’s path, for the comment’s context.enabled: set it tofalseto turn the overlay off.
Releases stay clean
A build made with mode: 'off' carries no feedback config, and FeedbackProvider renders only its children. mode: 'cloud' without a valid ONTRACKD_SECRET stops the build with an error rather than shipping a broken overlay.