@sensiblestats/widget-react 0.159.0 → 0.161.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/CHANGELOG.md CHANGED
@@ -1,5 +1,30 @@
1
1
  # @sensiblestats/widget-react
2
2
 
3
+ ## 0.161.0
4
+
5
+ ### Minor Changes
6
+
7
+ - `baseUrl` is now required. The SDK no longer falls back to a default gateway host, because every operator box has its own gateway. `new StatsWidgetClient` throws when `baseUrl` is missing or blank, and `StatsWidgetConfig.baseUrl` is a required string. The embed script still infers it from its own `src`.
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies
12
+ - @sensiblestats/widget-sdk@0.118.0
13
+
14
+ ## 0.160.0
15
+
16
+ ### Minor Changes
17
+
18
+ - d46ece9: Client events for load, availability, launcher, open and close: widget_loaded, strings_state, widget_unavailable, slip_unavailable, storage_blocked, identity_change, language_change, request_failed, widget_error, widget_open source and first, widget_close method, tab and openMs, bubble_suppressed, bubble_intro_played, visibility_change and widget_init_failed. The sdk client now reports response statuses to listeners.
19
+ - 26cf4e0: Client events for panel navigation, the greeting, asking, answers and chat impressions (tab_redirect, tab_view, tab_dot_shown, sheet_open/close, greeting_loaded/failed, greeting_section_view, market_rechoose, question_asked fields, firstByteMs, input_start/blocked, draft_abandoned, answer_link_click, card_view, chips_shown, card_scope_change, cards_expand, fact_history_expand, monitor_section_toggle, conversation_restored/reset).
20
+ - 0c61e95: Odds cards, the slip, pins and the sentence builder record their client events: slip origin (surface and turn id) on slip and pin events, refusals, add-all results, stale and closed card states, market load failures, price updates, toasts and every builder choice.
21
+ - f560423: Client events for tabs, match and player sheets, games, favourites, settings, failures, limits and empty states.
22
+
23
+ ### Patch Changes
24
+
25
+ - Updated dependencies [d46ece9]
26
+ - @sensiblestats/widget-sdk@0.117.0
27
+
3
28
  ## 0.159.0
4
29
 
5
30
  ### Minor Changes
package/README.md CHANGED
@@ -20,7 +20,7 @@ export function App() {
20
20
  config={{
21
21
  operatorId: 'sandbox1',
22
22
  publicKey: 'wgk_…',
23
- baseUrl: 'https://widget.sensiblestats.com',
23
+ baseUrl: 'https://<your-box-gateway-host>',
24
24
  locale: 'en-GB',
25
25
  }}
26
26
  />
@@ -32,7 +32,7 @@ Common `config` fields:
32
32
 
33
33
  - `operatorId`, `publicKey` — your gateway credentials (both browser-safe; the
34
34
  public key is origin-gated at the gateway).
35
- - `baseUrl` — the widget gateway URL.
35
+ - `baseUrl` — required. The widget gateway URL of your operator box; there is no default host, and omitting it is a type error.
36
36
  - `locale` — any language tag in the server's registry (`'en-GB'`, `'en-US'`, `'tr-TR'`, `'de'`, ...). It is
37
37
  sent whole to the server as the language (`defaultLanguage`) and picks the widget's own chrome text. A host
38
38
  with no `locale` sends no language and gets the operator's default (en-GB when the operator has none).
@@ -63,7 +63,7 @@ Common `config` fields:
63
63
  SensibleStats look.
64
64
  - `page` — the page the widget sits on, `{ sport, kind?, matchId?, competitionId? }`, so the
65
65
  first greeting can lead with it. Football ids are bare (`'4820113'`); NBA ids are
66
- `'nba:game:{id}'` or digits. `sport` is `'football'` or `'nba'`; the server answers any other
66
+ `'nba:game:{id}'` or digits. `sport` is `'football'`, `'basketball'`, `'americanfootball'` or `'tennis'`; the server answers any other
67
67
  value with `unsupported_sport` and the visitor sees today's greeting, so check your spelling
68
68
  rather than expecting a client-side error. The page rides on greeting requests only, never on a
69
69
  typed or tapped turn. Omit it and the request is unchanged.
@@ -245,7 +245,6 @@ Rules:
245
245
  | `dashboard_tile_click` | `entityType`, `entityId` | A dashboard tile is tapped |
246
246
  | `sport_switch` | `sport` | The visitor switches sport on the dashboard |
247
247
  | `new_conversation` | | The visitor starts a new conversation |
248
- | `league_star` | `competitionId`, `starred` | A league star changes and the request succeeds. A failed star is silent |
249
248
  | `favourite_change` | `kind`, `id`, `outcome` | A favourite is added or removed. Failures show in `outcome` |
250
249
 
251
250
  `add_to_slip_result.outcome` is `added`, `duplicate`, `price_changed`, `timeout`, or the
@@ -254,14 +253,14 @@ covers any failure of the add, not only a real timeout.
254
253
 
255
254
  ## Integration: persisting the conversation across SPA navigation
256
255
 
257
- The conversation (messages, conversation id, open/closed state) lives in the
258
- component's in-memory React state. It survives for exactly as long as the
259
- `<StatsWidget>` instance stays mounted:
256
+ The conversation (the last 30 messages and the conversation id) is saved in
257
+ `localStorage` per operator, visitor and language, and is restored for one hour
258
+ after the visitor's last activity:
260
259
 
261
- - **In-app (client-side) navigation** keeps it — as long as the component is not
260
+ - **In-app (client-side) navigation** keeps it, as long as the component is not
262
261
  unmounted.
263
- - **A hard page refresh** tears down the React tree and remounts the widget, so
264
- the conversation starts fresh. This is intentional.
262
+ - **A hard page refresh** remounts the widget, which restores the saved
263
+ conversation if it is less than an hour old; after that it starts fresh.
265
264
 
266
265
  To keep the active conversation across route changes in a single-page app,
267
266
  **mount `<StatsWidget>` once in a component that stays mounted across
@@ -281,7 +280,7 @@ import { StatsWidget } from '@sensiblestats/widget-react'
281
280
  const widgetConfig = {
282
281
  operatorId: 'sandbox1',
283
282
  publicKey: 'wgk_…',
284
- baseUrl: 'https://widget.sensiblestats.com',
283
+ baseUrl: 'https://<your-box-gateway-host>',
285
284
  }
286
285
 
287
286
  export function AppLayout() {