mirror of
https://github.com/formbricks/formbricks.git
synced 2026-01-26 19:00:22 -06:00
Co-authored-by: tykerr <tykerr@gmail.com> Co-authored-by: Dhruwang <dhruwangjariwala18@gmail.com> Co-authored-by: Dhruwang Jariwala <67850763+Dhruwang@users.noreply.github.com> Co-authored-by: pandeymangg <anshuman.pandey9999@gmail.com> Co-authored-by: Matthias Nannt <mail@matthiasnannt.com>
48 lines
1.7 KiB
Markdown
48 lines
1.7 KiB
Markdown
# Formbricks React Native SDK
|
|
|
|
[](https://www.npmjs.com/package/@formbricks/react-native)
|
|
[](https://opensource.org/licenses/MIT)
|
|
|
|
Please see [Formbricks Docs](https://formbricks.com/docs).
|
|
Specifically, [Framework Guides](https://formbricks.com/docs/getting-started/framework-guides).
|
|
|
|
## What is Formbricks
|
|
|
|
Formbricks is your go-to solution for in-product micro-surveys that will supercharge your product experience! 🚀 For more information please check out [formbricks.com](https://formbricks.com).
|
|
|
|
## How to use this library
|
|
|
|
1. Install the Formbricks package inside your project using npm:
|
|
|
|
```bash
|
|
npm install @formbricks/react-native
|
|
```
|
|
|
|
1. Import Formbricks and initialize the widget in your main component (e.g., App.tsx or App.js):
|
|
|
|
```javascript
|
|
import Formbricks, { track } from "@formbricks/react-native";
|
|
|
|
export default function App() {
|
|
const config = {
|
|
environmentId: "your-environment-id",
|
|
apiHost: "https://app.formbricks.com",
|
|
userId: "hello-user",
|
|
attributes: {
|
|
plan: "free",
|
|
},
|
|
};
|
|
|
|
return (
|
|
<View>
|
|
{/* Your app code */}
|
|
<Formbricks initConfig={config} />
|
|
</View>
|
|
);
|
|
}
|
|
```
|
|
|
|
Replace your-environment-id with your actual environment ID. You can find your environment ID in the **Connections instructions** in the Formbricks **Configuration** pages. Please make sure to pass a unique user identifier as `userId` to the Formbricks SDK (e.g. database id, email address).
|
|
|
|
For more detailed guides for different frameworks, check out our [Framework Guides](https://formbricks.com/docs/getting-started/framework-guides).
|