@userreason/wizard 0.1.0 → 0.2.1
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 +116 -28
- package/dist/THIRD_PARTY_NOTICES.txt +488 -0
- package/dist/agent-note.js +17 -0
- package/dist/agent-skill.js +16 -0
- package/dist/bin.js +720 -689
- package/dist/chunk-3RDJORRS.js +153 -0
- package/dist/chunk-5SC2K42Q.js +899 -0
- package/dist/chunk-5Z5J6PY5.js +258 -0
- package/dist/chunk-6CJ4ANMN.js +70 -0
- package/dist/chunk-GGARVSPT.js +211893 -0
- package/dist/chunk-HACTNBV3.js +51 -0
- package/dist/chunk-JD5U4U26.js +125 -0
- package/dist/chunk-OEGNGGZ2.js +7403 -0
- package/dist/chunk-SJVLAYGG.js +1477 -0
- package/dist/chunk-ULHKVBPD.js +165 -0
- package/dist/chunk-WL3NOIM6.js +42 -0
- package/dist/chunk-YMSGDC4B.js +280 -0
- package/dist/chunk-ZGZOBW2B.js +115 -0
- package/dist/cli-access.js +10 -0
- package/dist/connection.js +18 -0
- package/dist/global-cli.js +14 -0
- package/dist/integrate.js +21 -0
- package/dist/project.js +35 -101
- package/dist/registry.js +8 -0
- package/dist/skills/userreason/SKILL.md +55 -0
- package/dist/skills/userreason/references/management.md +61 -0
- package/dist/startup.js +11 -0
- package/dist/state.js +18 -0
- package/dist/ui.js +23 -0
- package/package.json +7 -17
package/README.md
CHANGED
|
@@ -1,51 +1,139 @@
|
|
|
1
|
-
#
|
|
1
|
+
# UserReason installation wizard
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Add UserReason feedback to your application with a guided setup for **React,
|
|
4
|
+
Next.js, Vue and browser JavaScript**. The wizard installs the SDK and project
|
|
5
|
+
CLI, connects your workspace and previews the integration before applying it.
|
|
4
6
|
|
|
5
|
-
|
|
7
|
+
[Quickstart](https://docs.userreason.com/get-started/quickstart/) ·
|
|
8
|
+
[SDK documentation](https://docs.userreason.com/sdk/initialization/) ·
|
|
9
|
+
[Dashboard](https://dash.userreason.com)
|
|
10
|
+
|
|
11
|
+
## Requirements
|
|
12
|
+
|
|
13
|
+
- Node.js **22.12 or later** and npm, pnpm or Yarn.
|
|
14
|
+
- Your application's source directory and permission to install dependencies.
|
|
15
|
+
- A browser to sign in to UserReason and approve the installation.
|
|
16
|
+
|
|
17
|
+
## Install
|
|
18
|
+
|
|
19
|
+
Run this command from your application directory:
|
|
6
20
|
|
|
7
21
|
```sh
|
|
8
|
-
|
|
9
|
-
cd ../ur-wizard && npm ci && npm run typecheck && npm test
|
|
10
|
-
node dist/bin.js --help
|
|
22
|
+
npx -y @userreason/wizard@latest
|
|
11
23
|
```
|
|
12
24
|
|
|
13
|
-
The wizard
|
|
25
|
+
The wizard will:
|
|
14
26
|
|
|
15
|
-
|
|
27
|
+
1. Detect your framework, package manager and any existing UserReason setup.
|
|
28
|
+
2. Open the browser so you can sign in and approve installation access.
|
|
29
|
+
3. Let you choose or create a workspace and site.
|
|
30
|
+
4. Show the proposed application change and optional setup steps for review.
|
|
31
|
+
5. Install `@userreason/js` and the project-local `@userreason/cli`, apply the
|
|
32
|
+
approved integration and check that the site's configuration is available.
|
|
33
|
+
|
|
34
|
+
Start your application afterward and follow the next steps shown in the
|
|
35
|
+
terminal. The [first survey guide](https://docs.userreason.com/get-started/first-prompt/)
|
|
36
|
+
walks through creating and publishing a survey. Installing the SDK does not
|
|
37
|
+
publish a survey.
|
|
38
|
+
|
|
39
|
+
For a different application directory:
|
|
16
40
|
|
|
17
41
|
```sh
|
|
18
|
-
npx -y @userreason/wizard@latest
|
|
42
|
+
npx -y @userreason/wizard@latest --directory ./my-app
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## What changes in your application
|
|
46
|
+
|
|
47
|
+
The SDK is added to `dependencies`, and the CLI to `devDependencies`. For a
|
|
48
|
+
supported entry point, the integration initializes UserReason with your public
|
|
49
|
+
site ID:
|
|
50
|
+
|
|
51
|
+
```js
|
|
52
|
+
import UserReason from '@userreason/js';
|
|
53
|
+
|
|
54
|
+
UserReason.init({ siteId: 'YOUR_SITE_ID' });
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
React, Vue and browser applications initialize before the app mounts. Modern
|
|
58
|
+
Next.js applications use client instrumentation; older supported versions use a
|
|
59
|
+
small client component. If your entry point needs a custom integration, the
|
|
60
|
+
wizard provides manual instructions.
|
|
61
|
+
|
|
62
|
+
Existing initialization is detected on reruns. The wizard previews source edits
|
|
63
|
+
and preserves existing integrations and customized agent guidance. Only public
|
|
64
|
+
SDK configuration belongs in application source; sign-in credentials are stored
|
|
65
|
+
separately.
|
|
66
|
+
|
|
67
|
+
## Optional setup
|
|
68
|
+
|
|
69
|
+
The setup review can also include:
|
|
70
|
+
|
|
71
|
+
- **Project agent guidance:** a short note in an existing `AGENTS.md` or
|
|
72
|
+
`CLAUDE.md`, plus a UserReason feedback skill for compatible agents.
|
|
73
|
+
- **Ongoing CLI access:** a separate account connection for reading feedback and
|
|
74
|
+
managing surveys, subject to the permissions you approve.
|
|
75
|
+
- **Global CLI:** make `userreason` available outside this project through npm's
|
|
76
|
+
configured global installation location.
|
|
77
|
+
|
|
78
|
+
The project-local CLI works without a global installation:
|
|
79
|
+
|
|
80
|
+
```sh
|
|
81
|
+
npx --no-install userreason whoami
|
|
82
|
+
npx --no-install userreason prompt list
|
|
83
|
+
npx --no-install userreason docs search "survey targeting"
|
|
19
84
|
```
|
|
20
85
|
|
|
21
|
-
|
|
86
|
+
Use `pnpm exec userreason` or `yarn exec userreason` in those projects. Teammates
|
|
87
|
+
install the project's dependencies and connect their own account with
|
|
88
|
+
`userreason login --open`; they do not need to create another site.
|
|
89
|
+
|
|
90
|
+
## Update an existing installation
|
|
22
91
|
|
|
23
92
|
```sh
|
|
24
|
-
npx -y @userreason/wizard@latest
|
|
25
|
-
--directory ./app \
|
|
26
|
-
--workspace WORKSPACE_UUID \
|
|
27
|
-
--site SITE_UUID \
|
|
28
|
-
--origin https://app.example.com \
|
|
29
|
-
--install \
|
|
30
|
-
--yes \
|
|
31
|
-
--json
|
|
93
|
+
npx -y @userreason/wizard@latest --refresh
|
|
32
94
|
```
|
|
33
95
|
|
|
34
|
-
|
|
96
|
+
Refresh updates the SDK and project CLI without repeating onboarding or
|
|
97
|
+
rewriting the application's initialization. Restart or reload your application
|
|
98
|
+
to use the updated SDK. Use `--install` to force package installation.
|
|
99
|
+
|
|
100
|
+
## Preview and scripted setup
|
|
35
101
|
|
|
36
|
-
|
|
102
|
+
Inspect a plan without signing in, installing packages or changing files:
|
|
37
103
|
|
|
38
|
-
|
|
104
|
+
```sh
|
|
105
|
+
npx -y @userreason/wizard@latest --dry-run
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
For a scripted installation with an existing workspace and site:
|
|
109
|
+
|
|
110
|
+
```sh
|
|
111
|
+
npx -y @userreason/wizard@latest \
|
|
112
|
+
--workspace WORKSPACE_UUID \
|
|
113
|
+
--site SITE_UUID \
|
|
114
|
+
--yes --integrate --json
|
|
115
|
+
```
|
|
39
116
|
|
|
40
|
-
|
|
41
|
-
|
|
117
|
+
Browser approval is still required. `--yes` accepts the main installation plan;
|
|
118
|
+
optional global installation, ongoing CLI access and agent guidance require
|
|
119
|
+
explicit flags in scripted use. Run `--help` for all options. `--no-open` prints
|
|
120
|
+
the sign-in link for use in another browser.
|
|
42
121
|
|
|
43
|
-
|
|
122
|
+
## Environments and access
|
|
44
123
|
|
|
45
|
-
|
|
124
|
+
The wizard uses the production UserReason API by default. For a customer site
|
|
125
|
+
used in local development or previews, choose `--environment development`.
|
|
126
|
+
This setting describes your site; it does not select a different UserReason API.
|
|
46
127
|
|
|
47
|
-
|
|
128
|
+
New sites allow any origin by default. Add `--origin https://app.example.com` to
|
|
129
|
+
restrict a new site to an exact origin, or manage restrictions in the dashboard.
|
|
130
|
+
Existing site restrictions are preserved.
|
|
48
131
|
|
|
49
|
-
|
|
132
|
+
Installation access is short-lived and cannot publish surveys. Ongoing CLI
|
|
133
|
+
access is a separate approval that you can review or revoke in the dashboard.
|
|
134
|
+
Per-user credentials use file storage by default; `--credential-store keychain`
|
|
135
|
+
selects the available OS credential store. Your application source is parsed
|
|
136
|
+
locally and is not uploaded to an AI service.
|
|
50
137
|
|
|
51
|
-
|
|
138
|
+
See [troubleshooting](https://docs.userreason.com/get-started/troubleshooting/)
|
|
139
|
+
for help with installation, sign-in, permissions and browser verification.
|