picked 0.0.1-dev.1793923852884 → 0.0.1-dev.1793933802654

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.
@@ -0,0 +1,107 @@
1
+ ---
2
+ type: how-to
3
+ layout: docs
4
+ ---
5
+
6
+ # How to send issue reports to your tracker
7
+
8
+ This guide shows you how to send the issue reports from the devtools panel to your issue tracker.
9
+ Before you start, add `svelteDevtoolsPlugin` to your client.
10
+
11
+ Users make issue reports in the **Report an issue** tab. To open the tab, click the icon at the
12
+ bottom of the devtools menu. If you do not set up the tab, it shows a link to this guide.
13
+
14
+ ## 1. Add an endpoint to your server
15
+
16
+ Add an endpoint that receives a report and makes an issue in your tracker. Keep the credentials
17
+ of your tracker on your server, not in the page.
18
+
19
+ The endpoint receives an `IssueReport` as JSON. Send the `title` and the `body` to your tracker.
20
+ The `body` is Markdown. It holds the description, then the context of the report as lines and as
21
+ JSON.
22
+
23
+ ```typescript
24
+ import type { IssueReport } from '@picked/svelte/plugins/devtools'
25
+
26
+ export async function POST(request: Request): Promise<Response> {
27
+ const report: IssueReport = await request.json()
28
+ const issue = await createIssueInYourTracker({
29
+ title: report.title,
30
+ body: report.body,
31
+ labels: report.labels,
32
+ })
33
+ return Response.json({ reference: issue.key, url: issue.url })
34
+ }
35
+ ```
36
+
37
+ The endpoint must return the reference of the issue and its URL. The devtools show both to the
38
+ user. If the endpoint returns an error status, the devtools tell the user that the report
39
+ was not sent, and keep the form.
40
+
41
+ | Field | What it holds |
42
+ | --- | --- |
43
+ | `title` | The title of the issue. |
44
+ | `description` | The text that the user wrote. |
45
+ | `kind` | `'bug'`, `'improvement'` or `'feature'`. |
46
+ | `priority` | `'none'`, `'low'`, `'medium'`, `'high'` or `'urgent'`. |
47
+ | `labels` | The labels that the user kept. |
48
+ | `attachments` | The attached images and files. Each has a `filename`, a `contentType` and its `data` as `base64` text. |
49
+ | `context` | The experience, the step, the page, the route, the responses and the persona, as JSON. |
50
+ | `body` | The description and the context, as Markdown. |
51
+
52
+ ## 2. Send the reports to your endpoint
53
+
54
+ Set the `issues` option of the devtools plugin. `siteEndpoint` sends each report to your
55
+ endpoint.
56
+
57
+ ```typescript
58
+ import { siteEndpoint, svelteDevtoolsPlugin } from '@picked/svelte/plugins/devtools'
59
+
60
+ svelteDevtoolsPlugin({
61
+ issues: {
62
+ sink: siteEndpoint('/api/report-issue'),
63
+ },
64
+ })
65
+ ```
66
+
67
+ To send a header with each report, add `headers`:
68
+ `siteEndpoint('/api/report-issue', { headers: { 'x-site': 'staging' } })`.
69
+
70
+ ## 3. Add labels and facts about your site
71
+
72
+ Each report can start with labels. The user can remove a label before they send the report.
73
+ To add facts about your site to each report, set `context`. Each fact must be a JSON value.
74
+
75
+ ```typescript
76
+ svelteDevtoolsPlugin({
77
+ issues: {
78
+ sink: siteEndpoint('/api/report-issue'),
79
+ labels: (context) => (context.experience ? [`exp/${context.experience.key}`] : []),
80
+ context: () => ({ release: '2026.11' }),
81
+ },
82
+ })
83
+ ```
84
+
85
+ ## 4. Hide personal data
86
+
87
+ By default, a report hides each response that looks like an email address, a phone number or a
88
+ date. It also hides each response that is an object. Fields in `codeOwnedFields` are not sent.
89
+ Before the user sends the report, they can remove each part of the context.
90
+
91
+ To decide the value of each response, set `redact`. Return the value to send. Return `undefined`
92
+ to remove the response from the report.
93
+
94
+ ```typescript
95
+ svelteDevtoolsPlugin({
96
+ issues: {
97
+ sink: siteEndpoint('/api/report-issue'),
98
+ redact: (key, value) => (key === 'medicare_number' ? undefined : value),
99
+ },
100
+ })
101
+ ```
102
+
103
+ ## Related
104
+
105
+ - [Svelte SDK](/reference/sdk/svelte#devtools-plugin) — the options of the devtools plugin.
106
+ - [How to add a tool to the devtools](/how-to/add-a-tool-to-the-devtools)
107
+ - [How to debug with the Chrome extension](/how-to/debug-with-the-chrome-extension)
@@ -55,6 +55,7 @@ const client = createClient({
55
55
  | --- | --- | --- | --- |
56
56
  | `enabled` | `boolean` | `false` | When `true`, the devtools open on page load. When `false`, the Chrome extension opens them. |
57
57
  | `customTools` | `CustomTool[]` | `[]` | Your own tools. See [How to add a tool to the devtools](/how-to/add-a-tool-to-the-devtools). |
58
+ | `issues` | `IssueReportingOptions` | none | Where the **Report an issue** tab sends reports. See [How to send issue reports to your tracker](/how-to/send-issue-reports-to-your-tracker). |
58
59
 
59
60
  When a preview token is there, the devtools launcher shows, even if `enabled` is `false`.
60
61
  See [How to debug with the Chrome extension](/how-to/debug-with-the-chrome-extension).
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "picked",
3
3
  "description": "The Picked SDK front door: the client, the picked.config helpers, and the picked CLI in one install",
4
- "version": "0.0.1-dev.1793923852884",
4
+ "version": "0.0.1-dev.1793933802654",
5
5
  "bin": {
6
6
  "picked": "dist/esm/bin.js"
7
7
  },
8
8
  "dependencies": {
9
- "@picked/cli": "0.0.1-dev.1793923852884",
10
- "@picked/config": "0.0.1-dev.1793923852884"
9
+ "@picked/cli": "0.0.1-dev.1793933802654",
10
+ "@picked/config": "0.0.1-dev.1793933802654"
11
11
  },
12
12
  "devDependencies": {
13
13
  "@picked/client": "workspace:*",
@@ -64,7 +64,7 @@
64
64
  "main": "./dist/cjs/index.js",
65
65
  "module": "./dist/esm/index.js",
66
66
  "peerDependencies": {
67
- "@picked/client": "0.0.1-dev.1793923852884"
67
+ "@picked/client": "0.0.1-dev.1793933802654"
68
68
  },
69
69
  "private": false,
70
70
  "publishConfig": {