# @getuserfeedback/react-native

Add in-product surveys, forms, and messages to React Native applications with
[getuserfeedback.com](https://getuserfeedback.com).

## Get started

Install the SDK and its WebView peer dependency.

For Expo projects:

```bash
npm install @getuserfeedback/react-native
npx expo install react-native-webview
```

For other React Native projects:

```bash
npm install @getuserfeedback/react-native react-native-webview
```

Then link the native dependency in bare iOS projects:

```bash
npx pod-install
```

Requires React 18, React Native 0.73, and React Native WebView 13 or later.

Mount the provider near the root of your app using the Public API key from
[Widget settings](https://getuserfeedback.com/app/_/settings/widget):

```tsx
import { GetUserFeedbackProvider } from "@getuserfeedback/react-native";

export function App() {
	return (
		<GetUserFeedbackProvider clientOptions={{ apiKey: "YOUR_API_KEY" }}>
			<YourApp />
		</GetUserFeedbackProvider>
	);
}
```

That is enough to receive flows published for automatic Widget delivery.

## Native color scheme

For flows using the native renderer, set `clientOptions.colorScheme` to
`"light"`, `"dark"`, or `"system"`. Omitted values and browser auto-detect
objects follow the device appearance on native (light when unavailable).

Scheme-only prop changes and `client.configure({ colorScheme: "dark" })`
repaint the SDK's default native palette without restarting the flow or
clearing its draft. An unchanged prop does not override a later configure call.
The selection belongs to that client: runtime recreation retains it, while a
replacement client (for example, a new API key) starts from its initial prop.
Native repaint does not wait for Core: configure still forwards to Core and
retains its existing promise/error behavior, but remote failure does not roll
back native appearance. WebView flows keep their existing scheme forwarding
and browser auto-detection behavior. This does not add a style override API.

- [React Native SDK guide](https://getuserfeedback.com/docs/get-started/react-native-sdk)
- [React Native SDK reference](https://getuserfeedback.com/docs/reference/react-native-sdk-reference)
- [Package versions](https://www.npmjs.com/package/@getuserfeedback/react-native?activeTab=versions)
- [Support](mailto:hello@getuserfeedback.com)
