Skip to content
Launch price$9/moLock it in

Install for Expo and React Native

The component works in Expo Go on iOS and Android. It only uses parts that Expo Go includes: react-native-view-shot, expo-device and expo-constants.

Not on the web. The component does not work in Expo for the web (expo start --web). Do not test it there. A coding agent must not test through the web, and must never switch off the security of a browser (for example --disable-web-security) to make a request work: reports sent that way arrive as the wrong platform. Test in Expo Go on a simulator or a device, and ask the builder to tap (see step 5).

You need a Nitpick account with a running subscription to get an app and a public key. nitpick login opens the browser where you create the account and start the subscription; see Billing and limits. The component itself needs nothing but the public key.

Quickest: run nitpick init

In the folder of your repository:

npx -y @nitpickhq/cli@latest init

init finds the app, links it to an app on your Nitpick account (or creates one), writes nitpick.json, installs the packages with npx expo install (only what is missing), wraps the content of app/_layout.tsx in NitpickProvider where it is sure of the code, and prints what is left. The ScreenName component and tabScreens of section 2 below still apply after init. It needs a login first (nitpick login). Run nitpick doctor afterwards to check the setup. All options: CLI reference. When something stops, see Troubleshooting.

By hand

If you prefer to do it yourself, or init gave you a manual step, these are the steps. Sections 3 to 5 apply after init too.

1. Add the package

npx expo install @nitpickhq/react-native@0.3.0 react-native-view-shot expo-device expo-constants

2. Wrap your app

With Expo Router, in app/_layout.tsx:

import { Stack, usePathname } from "expo-router";
import { NitpickProvider, useNitpickScreen } from "@nitpickhq/react-native";

function ScreenName() {
  useNitpickScreen(usePathname());
  return null;
}

export default function RootLayout() {
  return (
    <NitpickProvider appKey="npk_YOUR_PUBLIC_KEY">
      <ScreenName />
      <Stack />
    </NitpickProvider>
  );
}

The public key is safe to ship in the app. It can only create reports for this one app.

With Expo Router the screen name is the route path (/settings/profile), but only through the ScreenName component above: the component does not read the router by itself, and without it the screen field of every report stays empty. With React Navigation, pass your navigation container ref to the screen name hook (see Screen names).

Show the edge tab only on some screens: pass the names you gave them as tabScreens. With Expo Router the name is the path as usePathname() returns it, with dynamic parts filled in (/product/42), without (group) folders, and / for the start screen.

<NitpickProvider appKey="npk_YOUR_PUBLIC_KEY" options={{ tabScreens: ["/checkout", "/settings", "/settings/*"] }}>

A name must be equal to the screen name (capitals count). A name that ends on * matches every screen whose name starts with what comes before the *: "/settings/*" matches /settings/profile but not /settings itself, so for the whole section list both "/settings" and "/settings/*". Choose a dynamic route with * ("/product/*", which matches /product/42), never with [id]. The tab shows on the current screen only when its name is in the list, and never on a screen without a name, so the ScreenName component above is required. An empty list shows the tab nowhere (one line in the log), and tab: false in options always wins (it is an option, not a prop). The panel stays open when the screen changes, and open() works on every screen. Without tabScreens the tab shows on every screen.

Use your own button instead of the edge tab:

import { Button } from "react-native";
import { useNitpick } from "@nitpickhq/react-native";

function FeedbackButton() {
  const { open } = useNitpick();
  return <Button title="Send feedback" onPress={open} />;
}

Hide the edge tab with options={{ tab: false }} on the provider. Your own button does nothing while no settings have been fetched yet, while the app is switched off, or when both kinds are off; useNitpick().available tells you, so the button can hide itself.

The component asks the platform for your settings when the app starts, and keeps them in memory while the app runs. After a cold start the tab appears once that request has succeeded. Pass options={{ dryRun: true }} to try it without a network: the tab shows at once and nothing is sent.

3. Name elements

Use a name that points at the code, such as Home/StartButton.

import { NitpickElement } from "@nitpickhq/react-native";

<NitpickElement name="Home/StartButton">
  <Pressable onPress={start}><Text>Start workout</Text></Pressable>
</NitpickElement>

If you cannot wrap an element, a testID works too: the component reads it as a fallback name.

4. Mask sensitive parts

import { NitpickMask } from "@nitpickhq/react-native";

<NitpickMask><Text>{account.iban}</Text></NitpickMask>

5. Test it

Run the app in Expo Go (not on the web), wait a moment for the settings to arrive, and if you chose screens with tabScreens, go to one of them first: the tab shows only there. Then open the tab, tap "Point at something", tap an element and send. The report shows up in your dashboard, and in nitpick feedback list.

Next: Theme, where you choose a color and a font, and Settings.