@sentientui/react 0.24.0 → 0.24.2
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 +8 -2
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -81,10 +81,15 @@ rung to climb next, with a copy-pasteable snippet.
|
|
|
81
81
|
**1a. Persona attributes — zero declaration.** The SDK sets on `<html>`:
|
|
82
82
|
|
|
83
83
|
```
|
|
84
|
-
data-sentient-persona =
|
|
84
|
+
data-sentient-persona = <vocabulary key> | unknown
|
|
85
85
|
data-sentient-confidence = low | medium | high
|
|
86
86
|
```
|
|
87
87
|
|
|
88
|
+
The persona value is a key from the project's persona vocabulary (dashboard → Settings →
|
|
89
|
+
Personas) — declared by your app via the `persona` prop, or inferred from behavior. The
|
|
90
|
+
default vocabulary is `buyer | researcher | deal_seeker | browser`. Renaming a persona in
|
|
91
|
+
the dashboard keeps the old key resolving as an alias, so existing CSS stays intact.
|
|
92
|
+
|
|
88
93
|
Write plain CSS against them (the canonical block — safe defaults for every persona):
|
|
89
94
|
|
|
90
95
|
```css
|
|
@@ -187,6 +192,7 @@ Imported from `@sentientui/react/next`.
|
|
|
187
192
|
| `apiKey` | `string` | `pk_…` key — used by both the browser SDK and server-side SSR requests. |
|
|
188
193
|
| `appOrigin` | `string` *(default `http://localhost:3001`)* | Your app origin (e.g. `https://yourapp.com`). Must be on the project's allowed-origins list. Always set in production. |
|
|
189
194
|
| `context` | `'landing' \| 'ecommerce' \| 'saas' \| 'marketplace'` | Type of product. Used for segment weighting and analytics grouping. |
|
|
195
|
+
| `persona` | `string` *(optional)* | Declared persona — the role your app already knows for this visitor (e.g. from your auth context). Must be a key in the project's persona vocabulary (dashboard → Settings → Personas); unrecognized values are ignored server-side. Served at full confidence, overriding the inferred persona; forwarded through both SSR paths. Stable for the session — remount to apply a new value. Never a user id or email. |
|
|
190
196
|
| `consent` | `boolean` *(default `true`)* | Set `false` to skip SDK init (no cookies, no events). Flip to `true` after the visitor accepts. |
|
|
191
197
|
| `respectDoNotTrack` | `boolean` *(default `true`)* | Honor the browser's Do Not Track signal. When on and DNT is enabled, the SDK sets no cookies and sends no tracking data (overriding `consent: true`), and `grantConsent()` won't re-enable it. Set `false` to make your own consent gate authoritative. |
|
|
192
198
|
| `ssrFallback` | `'first' \| 'none'` *(default `'first'`)* | What to render in SSR HTML for components not in `components`. `'first'` is safe for SEO. |
|
|
@@ -195,7 +201,7 @@ Imported from `@sentientui/react/next`.
|
|
|
195
201
|
|
|
196
202
|
### `<AdaptiveProvider>` (any React app)
|
|
197
203
|
|
|
198
|
-
Accepts the same `apiKey`, `context`, `consent`, `ssrFallback`, `debug` props as `<AdaptiveRoot>`, plus `onAssignment` (not available on `<AdaptiveRoot>` — function props can't cross the RSC boundary) and:
|
|
204
|
+
Accepts the same `apiKey`, `context`, `persona`, `consent`, `ssrFallback`, `debug` props as `<AdaptiveRoot>`, plus `onAssignment` (not available on `<AdaptiveRoot>` — function props can't cross the RSC boundary) and:
|
|
199
205
|
|
|
200
206
|
| Prop | Type | Description |
|
|
201
207
|
|------|------|-------------|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sentientui/react",
|
|
3
|
-
"version": "0.24.
|
|
3
|
+
"version": "0.24.2",
|
|
4
4
|
"private": false,
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -64,8 +64,8 @@
|
|
|
64
64
|
"llms.txt"
|
|
65
65
|
],
|
|
66
66
|
"dependencies": {
|
|
67
|
-
"@sentientui/policy": "0.6.
|
|
68
|
-
"@sentientui/core": "0.
|
|
67
|
+
"@sentientui/policy": "0.6.1",
|
|
68
|
+
"@sentientui/core": "0.21.0"
|
|
69
69
|
},
|
|
70
70
|
"peerDependencies": {
|
|
71
71
|
"@testing-library/react": ">=14.0.0",
|