@originallyus/feedback-rn-sdk 4.0.0-beta.15 → 4.0.0-beta.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +58 -51
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -8,18 +8,18 @@ Scan the QR code below with **Expo Go** (Android) or the **Camera app** (iOS) to
|
|
|
8
8
|
|
|
9
9
|
Expo QR
|
|
10
10
|
|
|
11
|
-
[👉 Try on Expo Dev](https://expo.dev/preview/update?message=Demo+sdk&updateRuntimeVersion=1.0.0&createdAt=2026-03-
|
|
11
|
+
[👉 Try on Expo Dev](https://expo.dev/preview/update?message=Demo+sdk&updateRuntimeVersion=1.0.0&createdAt=2026-03-09T04%3A14%3A55.230Z&slug=exp&projectId=64be1f70-2b29-479e-8c0a-ee495f737d06&group=5b7b437e-e0b8-4c66-adb7-a831478c9320)
|
|
12
12
|
|
|
13
13
|
## 📦 Installation
|
|
14
14
|
|
|
15
15
|
```sh
|
|
16
|
-
npm
|
|
16
|
+
npm install @originallyus/feedback-rn-sdk@4.0.0-beta.16
|
|
17
17
|
```
|
|
18
18
|
|
|
19
19
|
or yarn
|
|
20
20
|
|
|
21
21
|
```sh
|
|
22
|
-
yarn add @originallyus/feedback-rn-sdk@4.0.0-beta.
|
|
22
|
+
yarn add @originallyus/feedback-rn-sdk@4.0.0-beta.16
|
|
23
23
|
```
|
|
24
24
|
|
|
25
25
|
### Peer Dependencies
|
|
@@ -28,25 +28,25 @@ This SDK requires several peer dependencies to function correctly. Make sure to
|
|
|
28
28
|
|
|
29
29
|
**Required:**
|
|
30
30
|
|
|
31
|
-
-
|
|
32
|
-
-
|
|
33
|
-
-
|
|
34
|
-
-
|
|
35
|
-
-
|
|
36
|
-
-
|
|
31
|
+
- react-native-reanimated
|
|
32
|
+
- react-native-keyboard-controller
|
|
33
|
+
- react-native-svg
|
|
34
|
+
- react-native-worklets
|
|
35
|
+
- axios
|
|
36
|
+
- crypto-js
|
|
37
37
|
|
|
38
38
|
**Haptics & Device Info (Optional but Recommended):**
|
|
39
39
|
|
|
40
40
|
Expo Projects:
|
|
41
41
|
|
|
42
|
-
-
|
|
43
|
-
-
|
|
44
|
-
-
|
|
42
|
+
- expo-haptics
|
|
43
|
+
- expo-device
|
|
44
|
+
- expo-application
|
|
45
45
|
|
|
46
46
|
Bare RN Projects:
|
|
47
47
|
|
|
48
|
-
-
|
|
49
|
-
-
|
|
48
|
+
- react-native-haptic-feedback
|
|
49
|
+
- react-native-device-info
|
|
50
50
|
|
|
51
51
|
---
|
|
52
52
|
|
|
@@ -65,41 +65,42 @@ The SDK works best with **Spoqa Han Sans Neo** or **OpenSans**. Please ensure yo
|
|
|
65
65
|
|
|
66
66
|
Mount the `FeedbackSDK` component at the root of your application (typically in `App.tsx`). It should be at the bottom of your root view tree to stay on top of other views.
|
|
67
67
|
|
|
68
|
-
```
|
|
69
|
-
import {useRef} from 'react'
|
|
70
|
-
import {View} from 'react-native'
|
|
71
|
-
import {SafeAreaProvider} from 'react-native-safe-area-context'
|
|
72
|
-
import {FeedbackSDK, type FeedbackSDKRef} from '@originallyus/feedback-rn-sdk'
|
|
68
|
+
```tsx
|
|
69
|
+
import { useRef } from 'react'
|
|
70
|
+
import { View } from 'react-native'
|
|
71
|
+
import { SafeAreaProvider } from 'react-native-safe-area-context'
|
|
72
|
+
import { FeedbackSDK, type FeedbackSDKRef } from '@originallyus/feedback-rn-sdk'
|
|
73
73
|
|
|
74
74
|
export default function App() {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
75
|
+
const feedbackRef = useRef<FeedbackSDKRef>(null)
|
|
76
|
+
|
|
77
|
+
const config = {
|
|
78
|
+
appSec: 'YOUR_APP_SEC',
|
|
79
|
+
packageId: 'YOUR_PACKAGE_ID',
|
|
80
|
+
debug: true,
|
|
81
|
+
language: 'en',
|
|
82
|
+
userId: 'USER_123',
|
|
83
|
+
metadata: { policy: '987654321' },
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
return (
|
|
87
|
+
<SafeAreaProvider>
|
|
88
|
+
<View style={{ flex: 1 }}>
|
|
89
|
+
<MainApp />
|
|
90
|
+
|
|
91
|
+
{
|
|
92
|
+
// Please insert this mount point directly in your App.js,
|
|
93
|
+
// preferably at the bottom of your root view tree for it to stay on top of all other views
|
|
94
|
+
}
|
|
95
|
+
<FeedbackSDK
|
|
96
|
+
ref={feedbackRef}
|
|
97
|
+
{...config}
|
|
98
|
+
onClose={() => console.log('Closed')}
|
|
99
|
+
onSubmit={(res) => console.log('Submitted', res)}
|
|
100
|
+
/>
|
|
101
|
+
</View>
|
|
102
|
+
</SafeAreaProvider>
|
|
103
|
+
)
|
|
103
104
|
}
|
|
104
105
|
```
|
|
105
106
|
|
|
@@ -123,6 +124,7 @@ feedbackRef.current.hide()
|
|
|
123
124
|
|
|
124
125
|
The primary component for showing high-intrusive or triggered surveys.
|
|
125
126
|
|
|
127
|
+
|
|
126
128
|
| Prop | Type | Description |
|
|
127
129
|
| ----------- | ---------- | ------------------------------------------------ |
|
|
128
130
|
| `appSec` | `string` | **Required.** Your application secret. |
|
|
@@ -134,6 +136,7 @@ The primary component for showing high-intrusive or triggered surveys.
|
|
|
134
136
|
| `onClose` | `function` | Callback when modal is dismissed. |
|
|
135
137
|
| `onSubmit` | `function` | Callback when form is successfully submitted. |
|
|
136
138
|
|
|
139
|
+
|
|
137
140
|
### `ContentUsefulness` (Inline)
|
|
138
141
|
|
|
139
142
|
Use this for inline feedback (e.g., "Was this helpful?") inside your content screens.
|
|
@@ -151,6 +154,7 @@ Use this for inline feedback (e.g., "Was this helpful?") inside your content scr
|
|
|
151
154
|
/>
|
|
152
155
|
```
|
|
153
156
|
|
|
157
|
+
|
|
154
158
|
| Prop | Type | Description |
|
|
155
159
|
| ---------------- | ------------- | ----------------------------------------------- |
|
|
156
160
|
| `slug` | `string` | **Required.** The form slug from the CMS. |
|
|
@@ -160,22 +164,25 @@ Use this for inline feedback (e.g., "Was this helpful?") inside your content scr
|
|
|
160
164
|
| `onSuccess` | `function` | Callback on success. |
|
|
161
165
|
| `onError` | `function` | Callback on error. |
|
|
162
166
|
|
|
167
|
+
|
|
163
168
|
---
|
|
164
169
|
|
|
165
170
|
## 📊 Supported Survey Types & Slugs
|
|
166
171
|
|
|
167
172
|
The SDK dynamically renders UI based on the configuration of the form slug in the backend. Use the following slugs for testing or integration:
|
|
168
173
|
|
|
174
|
+
|
|
169
175
|
| Form Type | Typical Slug | Icon | Description |
|
|
170
176
|
| ---------------- | ---------------------- | ---- | -------------------------------------------------- |
|
|
171
|
-
| **Satisfaction** | `native_rating_form` | ⭐
|
|
177
|
+
| **Satisfaction** | `native_rating_form` | ⭐ | Star rating (1-5) with optional detailed feedback. |
|
|
172
178
|
| **NPS** | `nps-1` | 📊 | Net Promoter Score scale (0-10). |
|
|
173
|
-
| **CES / Effort** | `effort-1` | ⚡
|
|
179
|
+
| **CES / Effort** | `effort-1` | ⚡ | Customer Effort Score numeric scale (1-7). |
|
|
174
180
|
| **Poll** | `poll-1` | 📝 | Multi-select tag-style buttons for quick surveys. |
|
|
175
181
|
| **Usefulness** | `content_usefulness-1` | 💡 | Inline "Yes/No" prompt for help articles. |
|
|
176
|
-
| **Comment** | `comment-1` | 🗨️
|
|
182
|
+
| **Comment** | `comment-1` | 🗨️ | Simple open-ended text feedback. |
|
|
177
183
|
| **External** | `external-1` | 🔗 | Triggers an external URL (App Store, Web). |
|
|
178
184
|
|
|
185
|
+
|
|
179
186
|
### Example: Triggering a specific form
|
|
180
187
|
|
|
181
188
|
```tsx
|
|
@@ -208,4 +215,4 @@ If your forms use external URLs, ensure your `AndroidManifest.xml` includes quer
|
|
|
208
215
|
|
|
209
216
|
## 📄 License
|
|
210
217
|
|
|
211
|
-
Built with ❤️ by **Originally US**. Released under the MIT License.
|
|
218
|
+
Built with ❤️ by **Originally US**. Released under the MIT License.
|
package/package.json
CHANGED