@upstep/js 0.5.9 → 0.5.10

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.
Files changed (3) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +84 -0
  3. package/package.json +17 -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,84 @@
1
+ # @upstep/js
2
+
3
+ A feedback widget for web apps: a floating button, a voting board, and a submit form, backed by your [Upstep](https://upstep.dev) project. Drops into a React app, a vanilla JS app, or a plain HTML page with no build step, in two lines of code.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ npm install @upstep/js
9
+ ```
10
+
11
+ Get an API key by creating a free project at [upstep.dev](https://upstep.dev) — no credit card required.
12
+
13
+ ## Quick start
14
+
15
+ ### React
16
+
17
+ ```tsx
18
+ import { UpstepProvider, FeedbackWidget } from "@upstep/js/react";
19
+
20
+ export default function App({ children }) {
21
+ return (
22
+ <UpstepProvider apiKey="upstep_xxx">
23
+ {children}
24
+ <FeedbackWidget />
25
+ </UpstepProvider>
26
+ );
27
+ }
28
+ ```
29
+
30
+ ### Vanilla JavaScript
31
+
32
+ ```js
33
+ import Upstep from "@upstep/js";
34
+
35
+ // Mounts the feedback button automatically
36
+ Upstep.init({ apiKey: "upstep_xxx" });
37
+ ```
38
+
39
+ ### No build step (WordPress, Webflow, Shopify, static HTML)
40
+
41
+ ```html
42
+ <script
43
+ type="module"
44
+ src="https://unpkg.com/@upstep/js/dist/index.js"
45
+ data-api-key="upstep_xxx"
46
+ ></script>
47
+ ```
48
+
49
+ All three report to the same project, so feedback from your React app, a script tag on your marketing site, and (if you add [`@upstep/react-native`](https://www.npmjs.com/package/@upstep/react-native)) your mobile app all land on one board, sorted by votes.
50
+
51
+ ## Configuration
52
+
53
+ Every entry point (`Upstep.init`, `<UpstepProvider>`, and the script tag's `data-*` attributes) takes the same options:
54
+
55
+ | Option | Type | Default | Description |
56
+ | --- | --- | --- | --- |
57
+ | `apiKey` | `string` | — | **Required.** Your project's API key. |
58
+ | `userId` | `string` | — | End-user id from your app, used to deduplicate votes per user. Call `identify(userId)` if it's only known after login. |
59
+ | `baseUrl` | `string` | `https://upstep.dev` | Only needed for self-hosted or staging setups. |
60
+ | `accentColor` | `string` | `#D97757` | Any CSS color, used for the launcher button and highlights. |
61
+ | `theme` | `"light" \| "dark" \| "auto"` | `"auto"` | `"auto"` follows the host page's `prefers-color-scheme`. |
62
+ | `position` | `"left" \| "right"` | `"right"` | Which corner the launcher button docks to. |
63
+ | `launcher` | `boolean` | `true` | Set `false` to hide the floating button and trigger the widget yourself via `Upstep.open()`. |
64
+
65
+ ## API
66
+
67
+ ### Vanilla / script-tag (`Upstep` default export)
68
+
69
+ - `Upstep.init(config)` — mounts the widget, returns the underlying API client.
70
+ - `Upstep.open()` / `Upstep.close()` — open or close the widget from your own UI (e.g. a nav link).
71
+ - `Upstep.identify(userId)` — set or update the end-user id after the widget has mounted.
72
+ - `Upstep.client` — the raw `UpstepApiClient` instance, if you want to call the API directly.
73
+
74
+ ### React (`@upstep/js/react`)
75
+
76
+ - `<UpstepProvider apiKey="..." />` — wraps your app, all `UpstepConfig` options are valid props.
77
+ - `<FeedbackWidget position? accentColor? theme? hideLauncher? />` — the launcher button and panel. Renders nothing until it's shown; safe to mount once near the root.
78
+ - `useUpstep()` — the same state and actions the widget uses (`feedItems`, `submit`, `vote`, `open`, `close`, `identify`, ...), if you want to build your own UI on top instead of the default widget.
79
+
80
+ ## Links
81
+
82
+ - [Full documentation](https://upstep.dev/#integrate)
83
+ - [Dashboard / sign up](https://upstep.dev/login)
84
+ - [@upstep/react-native](https://www.npmjs.com/package/@upstep/react-native) for React Native apps
package/package.json CHANGED
@@ -1,7 +1,22 @@
1
1
  {
2
2
  "name": "@upstep/js",
3
- "version": "0.5.9",
3
+ "version": "0.5.10",
4
4
  "description": "Upstep feedback widget for web apps",
5
+ "license": "MIT",
6
+ "homepage": "https://upstep.dev",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/TheBugEater/upstep.git",
10
+ "directory": "packages/sdk-web"
11
+ },
12
+ "bugs": "https://github.com/TheBugEater/upstep/issues",
13
+ "keywords": [
14
+ "feedback",
15
+ "widget",
16
+ "roadmap",
17
+ "upstep",
18
+ "react"
19
+ ],
5
20
  "main": "./dist/index.cjs",
6
21
  "module": "./dist/index.js",
7
22
  "types": "./dist/index.d.ts",
@@ -21,7 +36,7 @@
21
36
  "dist"
22
37
  ],
23
38
  "dependencies": {
24
- "@upstep/types": "0.5.3"
39
+ "@upstep/types": "0.5.4"
25
40
  },
26
41
  "peerDependencies": {
27
42
  "react": ">=18",