docs: fix onSessionTokenChange documentation in web-component and webjs#1359
docs: fix onSessionTokenChange documentation in web-component and webjs#1359
Conversation
…-js-sdk READMEs Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
🐕 Review complete — View session on Shuni Portal 🐾 |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
View your CI Pipeline Execution ↗ for commit a393310
☁️ Nx Cloud last updated this comment at |
There was a problem hiding this comment.
🐕 Shuni's Review
Documents the workaround for onSessionTokenChange not firing when <descope-wc> completes a flow, by sharing afterRequest hooks via DescopeWc.sdkConfigOverrides.
Sniffed out 1 issue:
- 1 🟡 MEDIUM: missing comma creates a run-on sentence
Code examples are accurate — verified sdk.httpClient.hooks.afterRequest, DescopeWc.sdkConfigOverrides, and the hooks/addHooks chain all the way through. Good bones! Woof!
Co-authored-by: shuni-bot-dev[bot] <254528481+shuni-bot-dev[bot]@users.noreply.github.com> Signed-off-by: Reuven Zabirov <123939006+ruvenzx@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Updates SDK documentation to clarify why onSessionTokenChange doesn’t fire when auth flows complete inside <descope-wc> and how to configure the web component to reuse the web-js-sdk afterRequest hook chain so the callback triggers.
Changes:
- Added a note + dedicated section in
@descope/web-js-sdkREADME explaining the required<descope-wc>setup. - Added a new section in
@descope/web-componentREADME showing how to passafterRequesthooks from acreateSdkinstance viaDescopeWc.sdkConfigOverrides.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| packages/sdks/web-js-sdk/README.md | Documents the <descope-wc> integration requirement for onSessionTokenChange and provides a setup example. |
| packages/sdks/web-component/README.md | Documents how to wire @descope/web-js-sdk hooks into <descope-wc> so session token notifications fire on the SDK instance. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Reuven Zabirov <123939006+ruvenzx@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Reuven Zabirov <123939006+ruvenzx@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Reuven Zabirov <123939006+ruvenzx@users.noreply.github.com>
fixes https://github.com/descope/etc/issues/14854
Description
onSessionTokenChange silently does nothing when completes a flow — the two SDKs have separate HTTP client instances, so the hook is never called by the web component.
This PR documents the fix in both READMEs: use DescopeWc.sdkConfigOverrides to share your SDK's afterRequest hook chain with the web component before mounting it.
Must