Install by hand
This page is for whoever sets up the SDK by hand, when keepsnappy init leaves a step to you. It gives the versions that work together, the install commands and the two config changes. The measuring build says what the SDK does.
Versions that work together
The SDK, the Appium driver and the keepsnappy command are released separately. Each version of the keepsnappy command was tested with the SDK and driver versions on its row. The commands on this page install the latest releases, which are the newest row. If you pin versions, take them all from one row.
keepsnappy init adds @keepsnappy/react-native and @keepsnappy/agent. When the SDK in your app is outside the row, keepsnappy doctor --group app warns, names the tested versions and prints the command that installs the right one.
A BrowserStack journey module is a JavaScript file that imports the Appium driver. Install the driver separately:
npm install --save-dev --save-exact @keepsnappy/appium-driver| keepsnappy | @keepsnappy/react-native | @keepsnappy/appium-driver |
|---|---|---|
| 0.1.0-alpha.27 | 0.1.0-alpha.27 | 0.1.0-alpha.27 |
| 0.1.0-alpha.28 | 0.1.0-alpha.27 | 0.1.0-alpha.27 to 0.1.0-alpha.28 |
| 0.1.0-alpha.29 | 0.1.0-alpha.27 | 0.1.0-alpha.27 to 0.1.0-alpha.28 |
| 0.1.0-alpha.30 | 0.1.0-alpha.27 | 0.1.0-alpha.27 to 0.1.0-alpha.28 |
| 0.1.0-alpha.31 | 0.1.0-alpha.27 | 0.1.0-alpha.27 to 0.1.0-alpha.28 |
| 0.1.0-alpha.32 | 0.1.0-alpha.27 | 0.1.0-alpha.27 to 0.1.0-alpha.28 |
| 0.1.0-alpha.33 | 0.1.0-alpha.27 | 0.1.0-alpha.27 to 0.1.0-alpha.28 |
| 0.1.0-alpha.34 | 0.1.0-alpha.27 | 0.1.0-alpha.27 to 0.1.0-alpha.28 |
| 0.1.0-alpha.35 | 0.1.0-alpha.27 | 0.1.0-alpha.27 to 0.1.0-alpha.28 |
Each new release adds its row.
The keepsnappy command is the package @keepsnappy/agent. There is no @keepsnappy/cli.
Install and build by hand
You need:
- An Expo app, or a bare React Native app with the
expopackage and Expo modules (Bare React Native). - Node.js 22.12 or newer, for the
keepsnappycommand. - For iOS, Xcode and an iOS simulator on a Mac. In CI, that is a macOS CI machine, such as GitHub Actions
macos-15.
Add the SDK, and the keepsnappy command as a dev dependency. --save-exact records the exact version npm installs, so every machine gets the same one:
npm install --save-exact @keepsnappy/react-nativenpm install --save-dev --save-exact @keepsnappy/agentMake the two config changes, then create keepsnappy.yml in your app’s repository root. For an iOS simulator with Maestro, start with:
app: bundle_id: com.example.appflows: runner: maestro paths: - .maestro/Use your app’s bundle ID and the path to its existing Maestro flows. For another runner, use the test command example. For Android, use the application ID, link scheme and platform from the Android emulator example.
To check the app’s setup without CI, run:
npx --no-install keepsnappy doctor --group app --localEvery line should start with ok. Under a line that doesn’t, doctor says what to fix.
Without the dev dependency, npx @keepsnappy/agent doctor --group app --local runs the same check.
Then build your app with the build switch on (Make a Release build).
Two config changes
Wrap your Metro config
withKeepSnappy must be the outermost wrapper.
const { getDefaultConfig } = require('expo/metro-config');const { withKeepSnappy } = require('@keepsnappy/react-native/metro');
module.exports = withKeepSnappy(getDefaultConfig(__dirname));If your Metro config is an ES module, require and module.exports don’t work in it. That is a metro.config.mjs or metro.config.mts, a config with import or export lines, or a metro.config.js in a package whose type is module. Import the wrapper by its file name, @keepsnappy/react-native/metro.js:
// metro.config.mjs or metro.config.tsimport { getDefaultConfig } from 'expo/metro-config.js';import { withKeepSnappy } from '@keepsnappy/react-native/metro.js';
const config = getDefaultConfig(import.meta.dirname);
export default withKeepSnappy(config);Init leaves an ES module config to you and prints the two lines to add. keepsnappy doctor checks the import. In a metro.config.ts, doctor may warn that the SDK ships no types for that path (TS7016). The build still works.
The SDK names each component by the file it is defined in, for the components of your own project. In a monorepo, it names a component from another workspace package only when you list that package:
module.exports = withKeepSnappy(getDefaultConfig(__dirname), { clientPackages: ['@my-app/ui'] });Add the config plugin
Add it to app.json, or to the plugins list of app.config.js:
{ "expo": { "plugins": [ ["@keepsnappy/react-native", { "measureFromLaunch": true, "renderTimes": true }] ] }}Plugin options says what each option does.
Next
Build your app with the build switch on: Make a Release build.