Skip to content

feat(*): navigate hooks + spaNavigationHandler for JS SDKs - #14

Merged
MD4 merged 1 commit into
masterfrom
feat/navigate-hooks-spa-nav-handler
Jul 2, 2026
Merged

feat(*): navigate hooks + spaNavigationHandler for JS SDKs#14
MD4 merged 1 commit into
masterfrom
feat/navigate-hooks-spa-nav-handler

Conversation

@MD4

@MD4 MD4 commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Context

Propagates the SDK-facing surface of screeb monorepo PR #2007 (JS tag: feat(tag): navigate hooks + SPA in-page mode for message/tour buttons) to the public TypeScript SDKs.

The tag PR added, for message/tour buttons running the "Navigate to URL" contextual action:

  • two new hooks onButtonNavigateStarted / onButtonNavigateCompleted,
  • a new url_target: "in-page-spa" target (navigate via history.pushState + dispatched popstate instead of a full reload),
  • a spaNavigationHandler init option for hosts whose custom SPA router doesn't resync on popstate.

Changes

  • sdk-browser (source of truth):
    • hooks.types.ts: new HookOnButtonNavigateStarted / HookOnButtonNavigateCompleted payload types (survey-shaped, carrying button.{url, url_target}, matching the tag's hookButtonNavigate), wired into both HooksSurveyStart and HooksMessageStart — so they flow into HooksInit.
    • types.ts: new SpaNavigationHandler type.
    • index.ts: trailing optional spaNavigationHandler param on init(), threaded into the init options (same pattern as language) + updated JSDoc.
  • sdk-react / sdk-vue / sdk-angular:
    • The two hooks are picked up automatically via HooksInit — no hook-typing changes needed.
    • Added spaNavigationHandler to each SDK's config/props type + init, threaded through the autoInit call sites.

Out of scope (deliberate)

  • url_target: "in-page-spa" needs no type change — it's a string in hook payloads; the enum lives in the Go API + editor (in the monorepo).
  • Native SDKs (sdk-reactnative / sdk-flutter / sdk-kmp / sdk-maui) are untouched: they're generic string-keyed hook passthroughs to the native iOS/Android SDKs, and in-page-spa / spaNavigationHandler are web-tag-only concepts. The new hook names already work through them if a native SDK ever fires them.
  • Public docs live in the screeb monorepo (docs/public/docs/sdk-*, updated in PR #2007). The regenerated typedoc output in this repo is included.

Verification

  • lerna run build — clean for all 4 (browser → react/vue/angular, topological); built dist/*.d.ts confirms the new hooks in HooksInit, SpaNavigationHandler, and the new init signature.
  • lerna run lint — 0 errors (only pre-existing sort-keys/max-len warnings).
  • Test scripts are stubs in these packages, so build/typecheck is the effective gate.

Propagates the SDK-facing surface of screeb PR #2007 (JS tag) to the
TypeScript SDKs.

- sdk-browser: add onButtonNavigateStarted/onButtonNavigateCompleted hook
  types (wired into HooksSurveyStart + HooksMessageStart, so they flow into
  HooksInit), a SpaNavigationHandler type, and a trailing spaNavigationHandler
  param on init().
- sdk-react/sdk-vue/sdk-angular: pick up the new hooks automatically via
  HooksInit; add spaNavigationHandler to their config/props + init and thread
  it through the autoInit call sites.

The url_target "in-page-spa" value needs no type change (it's a string in
payloads). Native SDKs (reactnative/flutter/kmp/maui) are untouched: they are
generic string-keyed passthroughs and this is a web-tag-only feature.
@MD4
MD4 merged commit 8177802 into master Jul 2, 2026
6 checks passed
@Alexays
Alexays deleted the feat/navigate-hooks-spa-nav-handler branch July 9, 2026 06:19
Alexays pushed a commit that referenced this pull request Jul 9, 2026
…dler

feat(*): navigate hooks + spaNavigationHandler for JS SDKs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant