@sphoro/bugcatch-web-sdk 0.16.0 → 0.17.0

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 CHANGED
@@ -55,7 +55,7 @@ BugCatch.init({
55
55
  ```html
56
56
  <!-- Pin the version. Without one the CDN serves whatever is latest, so a
57
57
  future release changes behaviour on a site nobody redeployed. -->
58
- <script src="https://unpkg.com/@sphoro/bugcatch-web-sdk@0.16.0/dist/bugcatch.umd.js"></script>
58
+ <script src="https://unpkg.com/@sphoro/bugcatch-web-sdk@0.17.0/dist/bugcatch.umd.js"></script>
59
59
  <script>
60
60
  BugCatch.init({ apiBase: '…', apiKey: 'bc_live_…', projectId: '…' });
61
61
  </script>
@@ -287,6 +287,26 @@ seconds while its thread is open, and `BugCatch.myReport(bugId)` does it for you
287
287
  own view (it also returns `report.assistant`). Each change fires
288
288
  `onAssistantPhase` / `'assistant'` once.
289
289
 
290
+ ### Questions it answers and closes by itself
291
+
292
+ When the project has the Sphoro Agent answering questions, the widget opens
293
+ with one-tap questions: *Where is my application?*, *When is my next EMI due?*,
294
+ *Is my KYC complete?*, *My application was rejected — please review it again*,
295
+ and others. It only shows the ones your connected data source can answer. The
296
+ assistant looks the customer up, answers from their own record, and asks
297
+ *"Did this answer your question?"*. **Yes** resolves the report, **No** hands it
298
+ to your team, and no reply in two days closes it (any later reply reopens it).
299
+ A rejected-application request is explained and passed to your team, who move
300
+ the customer in your system and mark it done.
301
+
302
+ Building your own form (`widget: false`)? Offer the same list:
303
+
304
+ ```js
305
+ const issues = await BugCatch.agentIssues();
306
+ // [{ key: 'emi', title: 'When is my next EMI due?', hint: 'The date and the amount' }, …]
307
+ await BugCatch.report({ title: issues[0].title, issue: issues[0].key });
308
+ ```
309
+
290
310
  **Passing IDs is the biggest thing you can do for it.** Without them, the first
291
311
  thing the assistant usually has to do is ask the customer which account or loan
292
312
  they mean — the `needs_info` step — and wait for an answer.
@@ -344,6 +364,7 @@ On top of that:
344
364
  | `attachments` | `true` | Offer screenshot, recording and file attach. |
345
365
  | `maxAttachments` / `maxAttachmentBytes` / `maxRecordingMs` | `5` / `25 MB` / `120000` | Attachment limits. |
346
366
  | `drafts` | `true` | Recover an unfinished report on this device for seven days. |
367
+ | `agentIssues` | `true` | Show the one-tap questions the assistant answers by itself. Draws nothing until the project turns the agent on. |
347
368
  | `knownIssues` | `true` | Show what this project already knows is broken, with "me too". Draws nothing until the project turns it on. |
348
369
  | `beforeSend` | — | Mutate the payload, or return `false` to cancel. |
349
370
  | `updates` | `true` | Tell the reporter live when a report they filed moves. |
@@ -366,7 +387,7 @@ BugCatch.setContext(null); // clear
366
387
  BugCatch.getContext();
367
388
 
368
389
  BugCatch.open(); BugCatch.close(); BugCatch.isOpen();
369
- await BugCatch.report({ title, description, priority, context, references, metadata, attachments });
390
+ await BugCatch.report({ title, description, priority, context, references, metadata, attachments, issue });
370
391
  await BugCatch.uploadAttachment(blob, mime, onProgress);
371
392
 
372
393
  const off = BugCatch.on('report' | 'assistant' | 'error' | 'update' | 'unread' | 'call'
@@ -382,6 +403,7 @@ BugCatch.hasReports(); BugCatch.forgetReports();
382
403
  await BugCatch.loginState(); BugCatch.signedInAs();
383
404
  await BugCatch.signIn(email); await BugCatch.confirmSignIn(email, code); await BugCatch.signOut();
384
405
  await BugCatch.referenceFields(); // the identifier question this project asks
406
+ await BugCatch.agentIssues(); // one-tap questions the assistant answers and closes
385
407
 
386
408
  await BugCatch.knownIssues(); await BugCatch.matchKnownIssues(q, { signal }); await BugCatch.meToo(bugId);
387
409