Skip to content

feat: explicitly mention auth requirements of preference APIs#1526

Open
andy-knock wants to merge 3 commits into
mainfrom
preference-api-auth
Open

feat: explicitly mention auth requirements of preference APIs#1526
andy-knock wants to merge 3 commits into
mainfrom
preference-api-auth

Conversation

@andy-knock

@andy-knock andy-knock commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Summary

Clarifies which preference and channel-data APIs can be called from client applications with a public API key and signed user token, rather than requiring a secret key. Updates SDK quick-start and React preference docs to show the correct authenticate() pattern and deprecated user.getPreferences() / user.setPreferences() methods. Removes stale typedoc pages for the deprecated preferences client API.

Changes

Preference center auth and client examples

  • in-app-ui/react/preferences.mdx — Adds signed user token to requirements; updates authenticate() to two-argument form; notes dev-mode behavior when enhanced security is off.
  • in-app-ui/react/headless/preferences.mdx — Same auth requirements and KnockProvider updates (userToken prop, dev-mode note); removes duplicate Preferences overview link in Related links (first link remains in the intro callout).
  • in-app-ui/javascript/sdk/quick-start.mdx — Two-argument authenticate() with linked enhanced security note; public-key auth note on the preferences section; switches to knockClient.user.getPreferences() / .setPreferences().

Adjacent public-key clarifications

  • multi-tenancy/per-tenant-preferences.mdx — Notes that examples below use the server-side Node SDK; links to the preference center docs for frontend per-tenant preference management.
  • preferences/preference-conditions.mdx — Rewrites intro to focus on how conditions fit into a PreferenceSet (no public-key auth note; that stays in broader preference center docs).
  • managing-recipients/setting-channel-data.mdx — Adds post-code-block cross-reference to iOS, Android, and Flutter push registration docs.
  • in-app-ui/flutter/sdk/quick-start.mdx — Renames KNOCK_API_KEY to KNOCK_PUBLIC_API_KEY.

Typedoc cleanup

  • typedocs/client/knock.mdx — Removes deprecated preferences section.
  • typedocs/client/preferences.mdx — Deletes unused file (replacement methods documented under user-client.mdx).

Deferred to other PRs

  • preferences/overview.mdx — Auth section and client examples deferred to #1528.

Context

https://knocklabs.slack.com/archives/C0AP38JP4LW/p1783547426112369?thread_ts=1783543879.292789&cid=C0AP38JP4LW

Test plan

  • Verify updated pages render on the Vercel preview
  • Confirm links resolve: enhanced security anchor, preference center anchor, iOS/Android/Flutter push docs
  • Confirm deleted typedocs/client/preferences.mdx is not linked from anywhere in the site

@vercel

vercel Bot commented Jul 8, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
docs Ready Ready Preview, Comment Jul 10, 2026 6:36pm

Request Review

andy-knock commented Jul 8, 2026

Copy link
Copy Markdown
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

Comment thread content/in-app-ui/react/headless/preferences.mdx
Comment thread content/in-app-ui/react/headless/preferences.mdx
Comment thread content/in-app-ui/react/headless/preferences.mdx Outdated
Comment thread content/in-app-ui/react/preferences.mdx Outdated
Comment thread content/in-app-ui/react/preferences.mdx
Comment thread content/in-app-ui/react/preferences.mdx Outdated
Comment thread content/in-app-ui/javascript/sdk/quick-start.mdx
Comment thread content/preferences/overview.mdx Outdated

@rachael-t rachael-t left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a few comments!

Re the typedocs (specifically deleting typedocs/client/preferences.mdx- I think Chris added those in and has some more context if there's hesitiation about fully removing it.

Comment thread content/in-app-ui/javascript/sdk/quick-start.mdx Outdated
Comment thread content/in-app-ui/react/headless/preferences.mdx Outdated
Comment thread content/in-app-ui/react/headless/preferences.mdx
Comment thread content/in-app-ui/react/preferences.mdx Outdated
Comment thread typedocs/client/knock.mdx Outdated
Comment thread typedocs/client/preferences.mdx Outdated
Comment thread content/managing-recipients/setting-channel-data.mdx Outdated
Comment thread content/multi-tenancy/per-tenant-preferences.mdx Outdated
Comment thread content/preferences/overview.mdx
Comment thread content/preferences/preference-conditions.mdx Outdated
@andy-knock andy-knock force-pushed the preference-api-auth branch 4 times, most recently from b8774fa to bee9c58 Compare July 10, 2026 18:06
@andy-knock andy-knock marked this pull request as ready for review July 10, 2026 18:13
@andy-knock

Copy link
Copy Markdown
Contributor Author

@rachael-t fixed

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Risk MEDIUM: Clarifies auth requirements for preference APIs across multiple documentation sections and removes deprecated typedoc pages.

Reasons

  • Changes span 4+ distinct documentation sections (in-app-ui, managing-recipients, multi-tenancy, preferences, and typedocs), triggering the cross-section rule
  • 9 files modified total (7 content MDX files and 2 typedoc files), giving this PR a broad surface area
  • One typedoc file is deleted (typedocs/client/preferences.mdx) and another has a section removed, which could break existing links or references if any remain
  • All changes are limited to .mdx content files with no component, layout, or build config modifications, keeping this out of HIGH risk
  • Individual file diffs are small (largest is the 54-line deletion), and no single file has both 30+ additions and 30+ deletions

Notes

  • Verify that no remaining pages link to typedocs/client/preferences.mdx or to the removed knock.preferences section in typedocs/client/knock.mdx (the PR description mentions this was checked but it is worth confirming on the preview deploy)
  • Confirm the internal anchor links resolve correctly on the Vercel preview: #authentication-with-enhanced-security, #build-your-preference-center, and the iOS/Android/Flutter push doc cross-references added in setting-channel-data.mdx
  • The Related links section in headless/preferences.mdx now has a plain-text "Preferences overview" entry with no link — confirm this is intentional and not a broken link
Open in Web View Automation 

Sent by Cursor Automation: Docs PR classifier

andy-knock and others added 3 commits July 10, 2026 14:31
Co-authored-by: Rachael Thomas <54180641+rachael-t@users.noreply.github.com>
Co-authored-by: Rachael Thomas <54180641+rachael-t@users.noreply.github.com>
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.

2 participants