@upstep/react-native 0.6.11 → 0.6.12
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/.turbo/turbo-type-check.log +4 -0
- package/LICENSE +21 -0
- package/README.md +74 -0
- package/package.json +9 -2
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Upstep
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# @upstep/react-native
|
|
2
|
+
|
|
3
|
+
The [Upstep](https://upstep.dev) feedback SDK for React Native: a launcher button and a bottom sheet with a voting board and submit form, backed by the same project as your web app.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @upstep/react-native react-native-safe-area-context
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
`react-native-safe-area-context` is a required peer dependency (the sheet needs it for safe-area insets). Get an API key by creating a free project at [upstep.dev](https://upstep.dev).
|
|
12
|
+
|
|
13
|
+
## Quick start
|
|
14
|
+
|
|
15
|
+
```tsx
|
|
16
|
+
import { FeedbackProvider, FeedbackButton, FeedbackSheet } from "@upstep/react-native";
|
|
17
|
+
|
|
18
|
+
export default function App() {
|
|
19
|
+
return (
|
|
20
|
+
<FeedbackProvider apiKey="upstep_xxx">
|
|
21
|
+
{/* your app */}
|
|
22
|
+
<FeedbackButton />
|
|
23
|
+
<FeedbackSheet />
|
|
24
|
+
</FeedbackProvider>
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Same idea as the web widget: a floating button opens a sheet with a voting board and a submit form. It reports to the same project and the same board as your web app, so mobile and web feedback end up in one place, sorted by votes.
|
|
30
|
+
|
|
31
|
+
## Shake to submit feedback
|
|
32
|
+
|
|
33
|
+
Optional, and only active if [`expo-sensors`](https://www.npmjs.com/package/expo-sensors) is installed:
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
npm install expo-sensors
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
```tsx
|
|
40
|
+
import { useShakeToFeedback } from "@upstep/react-native";
|
|
41
|
+
|
|
42
|
+
function App() {
|
|
43
|
+
useShakeToFeedback(); // opens the sheet when the device is shaken
|
|
44
|
+
// ...
|
|
45
|
+
}
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
If `expo-sensors` isn't installed, the hook is a no-op — safe to call unconditionally.
|
|
49
|
+
|
|
50
|
+
## Configuration
|
|
51
|
+
|
|
52
|
+
`FeedbackProvider` takes the same options as the web SDK:
|
|
53
|
+
|
|
54
|
+
| Option | Type | Default | Description |
|
|
55
|
+
| --- | --- | --- | --- |
|
|
56
|
+
| `apiKey` | `string` | — | **Required.** Your project's API key. |
|
|
57
|
+
| `userId` | `string` | — | End-user id from your app, used to deduplicate votes per user. Call `identify(userId)` if it's only known after login. |
|
|
58
|
+
| `baseUrl` | `string` | `https://upstep.dev` | Only needed for self-hosted or staging setups. |
|
|
59
|
+
| `accentColor` | `string` | `#D97757` | Any CSS color, used for the launcher button and highlights. |
|
|
60
|
+
| `theme` | `"light" \| "dark" \| "auto"` | `"auto"` | `"auto"` follows the device color scheme. |
|
|
61
|
+
|
|
62
|
+
## API
|
|
63
|
+
|
|
64
|
+
- `<FeedbackProvider apiKey="..." />` — wraps your app, all config options above are valid props.
|
|
65
|
+
- `<FeedbackButton position? label? icon? />` — floating launcher, `position` is `"bottom-right"` (default) or `"bottom-left"`.
|
|
66
|
+
- `<FeedbackSheet />` — the modal sheet with the board and submit form. Mount once, anywhere inside the provider.
|
|
67
|
+
- `useShakeToFeedback()` — opens the sheet on a device shake, requires `expo-sensors`.
|
|
68
|
+
- `useUpstep()` — the underlying state and actions (`feedItems`, `submit`, `vote`, `openSheet`, `closeSheet`, `identify`, ...), if you want to build a custom UI instead of `FeedbackSheet`.
|
|
69
|
+
|
|
70
|
+
## Links
|
|
71
|
+
|
|
72
|
+
- [Full documentation](https://upstep.dev/#integrate)
|
|
73
|
+
- [Dashboard / sign up](https://upstep.dev/login)
|
|
74
|
+
- [@upstep/js](https://www.npmjs.com/package/@upstep/js) for web apps
|
package/package.json
CHANGED
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@upstep/react-native",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.12",
|
|
4
4
|
"description": "Upstep feedback SDK for React Native",
|
|
5
|
+
"homepage": "https://upstep.dev",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/TheBugEater/upstep.git",
|
|
9
|
+
"directory": "packages/sdk-react-native"
|
|
10
|
+
},
|
|
11
|
+
"bugs": "https://github.com/TheBugEater/upstep/issues",
|
|
5
12
|
"main": "./src/index.ts",
|
|
6
13
|
"types": "./src/index.ts",
|
|
7
14
|
"exports": {
|
|
@@ -12,7 +19,7 @@
|
|
|
12
19
|
}
|
|
13
20
|
},
|
|
14
21
|
"dependencies": {
|
|
15
|
-
"@upstep/types": "0.5.
|
|
22
|
+
"@upstep/types": "0.5.4"
|
|
16
23
|
},
|
|
17
24
|
"peerDependencies": {
|
|
18
25
|
"react": ">=18",
|