feat(*): navigate hooks + spaNavigationHandler for JS SDKs - #14
Merged
Conversation
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.
Alexays
pushed a commit
that referenced
this pull request
Jul 9, 2026
…dler feat(*): navigate hooks + spaNavigationHandler for JS SDKs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
onButtonNavigateStarted/onButtonNavigateCompleted,url_target: "in-page-spa"target (navigate viahistory.pushState+ dispatchedpopstateinstead of a full reload),spaNavigationHandlerinit option for hosts whose custom SPA router doesn't resync onpopstate.Changes
hooks.types.ts: newHookOnButtonNavigateStarted/HookOnButtonNavigateCompletedpayload types (survey-shaped, carryingbutton.{url, url_target}, matching the tag'shookButtonNavigate), wired into bothHooksSurveyStartandHooksMessageStart— so they flow intoHooksInit.types.ts: newSpaNavigationHandlertype.index.ts: trailing optionalspaNavigationHandlerparam oninit(), threaded into the init options (same pattern aslanguage) + updated JSDoc.HooksInit— no hook-typing changes needed.spaNavigationHandlerto each SDK's config/props type +init, threaded through theautoInitcall sites.Out of scope (deliberate)
url_target: "in-page-spa"needs no type change — it's astringin hook payloads; the enum lives in the Go API + editor (in the monorepo).sdk-reactnative/sdk-flutter/sdk-kmp/sdk-maui) are untouched: they're generic string-keyed hook passthroughs to the native iOS/Android SDKs, andin-page-spa/spaNavigationHandlerare web-tag-only concepts. The new hook names already work through them if a native SDK ever fires them.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); builtdist/*.d.tsconfirms the new hooks inHooksInit,SpaNavigationHandler, and the newinitsignature.lerna run lint— 0 errors (only pre-existingsort-keys/max-lenwarnings).