docs(KNO-14128): document KnockProvider enabled prop and useKnockAuthState - #1536
Merged
kylemcd merged 6 commits intoJul 15, 2026
Conversation
…State Adds documentation for the new enabled prop on KnockProvider (React, React Native, Expo) and the useKnockAuthState hook, adapted from the package READMEs in knocklabs/javascript#1033. - React KnockProvider typedoc: enabled prop + behavior notes (feed remount, Slack/Teams re-check, guides readyToTarget distinction) - useAuthenticatedKnockClient typedoc: enabled option - New useKnockAuthState hook typedoc, content page, and sidebar entry - React Native and Expo references: enabled prop + useKnockAuthState hook - Expo: note that autoRegister defers push registration until authenticated
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 4650cde. Configure here.
Trim filler adverbs (currently, directly) and reword the deferring-activity sentence to drop 'asynchronously'/'conditionally' per the style guide's avoid-adverbs rule.
Addresses comment by @cursor (BugBot): the same KnockProvider reference page was linked twice on one page; later mentions should be plain text.
kylemcd
marked this pull request as ready for review
July 14, 2026 20:46
There was a problem hiding this comment.
Risk MEDIUM: Documents the new KnockProvider enabled prop and useKnockAuthState hook across React, React Native, and Expo SDK reference pages, adding a new content page and sidebar entry.
Reasons
- A new MDX page is added in
/content/(content/in-app-ui/react/sdk/hooks/use-knock-auth-state.mdx), triggering the new-page rule - Sidebar navigation file is modified (
data/sidebars/inAppSidebar.ts) to add the new hook entry - A new typedoc file is added (
typedocs/react-core/hooks/use-knock-auth-state.mdx) with 55 lines of documentation - Changes span 7 files with 235 additions, adding documentation consistently across three SDK reference pages
- No HIGH risk triggers: no code in
components/,layouts/,lib/, orstyles/is modified; no package.json, yarn.lock, or build config changes
Notes
- Verify the new sidebar entry for
useKnockAuthStaterenders correctly and appears in the expected position among the React hooks - Check that the new
use-knock-auth-state.mdxcontent page loads via the<Typedoc>component without errors - Confirm cross-links between the
enabledprop documentation anduseKnockAuthStatehook resolve correctly across all three SDK pages (React, React Native, Expo)
Sent by Cursor Automation: Docs PR classifier
cellomatt
approved these changes
Jul 15, 2026
- Expo push-registration note: reword to avoid the app-login metaphor and drop the parenthetical - Expo autoRegister: drop the 'logged-out' qualifier - KnockAuthState attribute descriptions: 'signed in' -> 'authenticated' (React typedoc, React Native, Expo)
Follow-up to @cellomatt's review: apply the authentication-centric wording consistently. Reword the enabled prop descriptions, deferring-activity prose, and the useAuthenticatedKnockClient option away from 'like a login/logout', harmonize the Expo autoRegister note to 'client authentication completes', and align the useKnockAuthState copy ('authenticated user changes').
Matches the 'unauthenticated/authenticated' terminology used elsewhere in the doc and avoids the login-metaphor ambiguity flagged in review, even though this was example UI copy rather than doc prose.
kylemcd
deleted the
kyle-kno-14128-document-the-knockprovider-enabled-prop-on-the-docs-site
branch
July 15, 2026 16:10
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.



Description
Documents the new
enabledprop onKnockProviderand theuseKnockAuthStatehook, shipped in the stable SDK release (KNO-14095 / knocklabs/javascript#1033, promoted to stable in #1038). The copy is adapted from the package READMEs updated in that work (packages/react,packages/react-native,packages/expo,packages/client).What's documented
enabledprop onKnockProvider. Whenfalse, children still render but the Knock client stays idle — no identify call, no API requests, and no websocket. Flipping totruebehaves like a login; flipping tofalsebehaves like a logout. Defaults totrue. The recommended way to gate the provider on a complete identity (async user token, feature flags, gated workspaces, cookie consent) rather than mounting and unmounting the provider.useKnockAuthState()hook. Subscribable auth state (status,userId,userToken) for reacting to login, logout, and user switches.enabledflips totrue; Slack and Microsoft Teams connection status re-checks when the authenticated user changes; ExpoautoRegisterwaits until the client is authenticated (the OS permission prompt is deferred, not skipped); and for guides,enabledgates the whole client whilereadyToTargetstill gates guide targeting on its own.Files changed
typedocs/react-core/components/knock-provider.mdx—enabledprop + "Deferring activity" section with behavior notes.typedocs/react-core/hooks/use-authenticated-knock-client.mdx—enabledoption for headless clients.typedocs/react-core/hooks/use-knock-auth-state.mdx+content/in-app-ui/react/sdk/hooks/use-knock-auth-state.mdx+data/sidebars/inAppSidebar.ts— newuseKnockAuthStatehook page and sidebar entry.content/in-app-ui/react-native/sdk/reference.mdxandcontent/in-app-ui/expo/sdk/reference.mdx—enabledprop onKnockProviderand auseKnockAuthStatehook section (Expo also notes theautoRegisterdeferral).Todos
@knocklabs/react@0.12.0,@knocklabs/react-core@0.14.0,@knocklabs/client@0.22.0,@knocklabs/react-native@0.10.0,@knocklabs/expo@0.7.0— verified againstmain.All documented API surface (prop, option, hook signature,
KnockAuthStatetypes, package exports, ExpoautoRegisterauth-gating) verified againstknocklabs/javascript@mainpost-stable-release.Tasks
KNO-14128