@neuphlo/widget-react 0.3.0 → 0.3.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  # @neuphlo/widget-react
2
2
 
3
- React bindings for the [Neuphlo](https://neuphlo.com) support chat widget. Renders a floating launcher; conversations land in your Neuphlo inbox with the same draft-and-approve flow as email.
3
+ React bindings for the [Neuphlo](https://neuphlo.com) Messenger. Renders a floating launcher; conversations land in your Neuphlo inbox with the same draft-and-approve flow as email.
4
4
 
5
5
  ## Install
6
6
 
@@ -45,10 +45,36 @@ import { openNeuphloWidget } from "@neuphlo/widget-react"
45
45
 
46
46
  | Option | Default | Description |
47
47
  | --- | --- | --- |
48
- | `widgetKey` | — | Workspace widget key from Inbox settings → Chat widget |
48
+ | `widgetKey` | — | Workspace widget key from Inbox settings → Messenger |
49
+ | `user` | — | Signed-in user: `{ id, name, email, hash }` |
49
50
  | `position` | `"right"` | Launcher corner, `"left"` or `"right"` |
50
51
  | `color` | `"#171717"` | Launcher accent color |
51
52
  | `appUrl` | Neuphlo cloud | Your app origin for self-hosted installs |
52
53
  | `scriptUrl` | `https://get.neuphlo.com/widget.js` | Loader script URL |
53
54
 
54
55
  The widget unmounts cleanly — the launcher and panel are removed when the component unmounts.
56
+
57
+ ## Identifying users
58
+
59
+ Pass the signed-in user so conversations are recognized in your inbox:
60
+
61
+ ```tsx
62
+ <NeuphloWidget
63
+ widgetKey="your-widget-key"
64
+ user={{ id: user.id, name: user.name, email: user.email, hash: user.neuphloHash }}
65
+ />
66
+ ```
67
+
68
+ `hash` enables identity verification — compute it **server-side** with the
69
+ widget identity secret from Inbox settings → Messenger:
70
+
71
+ ```ts
72
+ import { createHmac } from "node:crypto"
73
+
74
+ const neuphloHash = createHmac("sha256", process.env.NEUPHLO_IDENTITY_SECRET)
75
+ .update(user.id)
76
+ .digest("hex")
77
+ ```
78
+
79
+ Workspaces with "Require verified identities" enabled reject identified
80
+ conversations without a valid hash; anonymous visitors are unaffected.
package/dist/index.d.ts CHANGED
@@ -22,7 +22,7 @@ export interface NeuphloWidgetUser {
22
22
  hash?: string;
23
23
  }
24
24
  export interface NeuphloWidgetOptions {
25
- /** Workspace widget key from Inbox settings → Chat widget. */
25
+ /** Workspace widget key from Inbox settings → Messenger. */
26
26
  widgetKey: string;
27
27
  /** Identify the signed-in user so conversations are recognized. */
28
28
  user?: NeuphloWidgetUser;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@neuphlo/widget-react",
3
- "version": "0.3.0",
4
- "description": "React component for the Neuphlo support chat widget",
3
+ "version": "0.3.1",
4
+ "description": "React bindings for the Neuphlo Messenger",
5
5
  "license": "MIT",
6
6
  "repository": {
7
7
  "type": "git",