Skip to content

fix: update javascript SDK docs to use more up to date getAccessToken method#761

Open
pesickaa wants to merge 4 commits into
mainfrom
fix/update-javascript-docs
Open

fix: update javascript SDK docs to use more up to date getAccessToken method#761
pesickaa wants to merge 4 commits into
mainfrom
fix/update-javascript-docs

Conversation

@pesickaa

@pesickaa pesickaa commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Description (required)

The pkce js SDK was recently updated and users were being shown the deprecation notice for the getToken method which was replaced with a getAccessToken method.

Added a deprecation notice aside to explain why people may be seeing a deprecation notice, but happy to remove.

Related issues & labels (optional)

  • Closes #
  • Suggested label: Content suggestion

Summary by CodeRabbit

  • Documentation
    • Updated JavaScript SDK “Call your API” guidance to recommend getAccessToken() and clarify its interaction with background refresh and cached tokens.
    • Expanded session/restore instructions with on_session_restore_callback and improved page-load handling examples.
    • Refreshed guidance for invitations, logout options (including session selection), and self-serve portal usage.
    • Modernized the JavaScript SDK API reference (typed options, return-shape clarifications, and updated login/register/logout/portal/createOrg examples).
    • Added refresh-token behavior documentation for the JS (PKCE) SDK and aligned React SDK token-refresh wording.
    • Marked getToken() as deprecated with updated expectations.

@pesickaa pesickaa self-assigned this Jul 2, 2026
@pesickaa
pesickaa requested a review from a team as a code owner July 2, 2026 09:42
@github-actions github-actions Bot added the sdk label Jul 2, 2026
@coderabbitai

coderabbitai Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 823d9386-5a17-4c6e-948d-4c94c94fbb40

📥 Commits

Reviewing files that changed from the base of the PR and between b65b8ba and d4c2ed4.

📒 Files selected for processing (1)
  • src/content/docs/developer-tools/sdks/frontend/javascript-sdk.mdx
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/content/docs/developer-tools/sdks/frontend/javascript-sdk.mdx

Walkthrough

The documentation updates JavaScript SDK token retrieval, refresh behavior, session restoration, authentication options, invitations, logout, portal usage, and user-profile API references. Related refresh-token and React SDK guidance now references getAccessToken().

Changes

JavaScript SDK documentation updates

Layer / File(s) Summary
Access token and refresh guidance
src/content/docs/developer-tools/sdks/frontend/javascript-sdk.mdx, src/content/docs/build/tokens/refresh-tokens.mdx, src/content/docs/developer-tools/sdks/frontend/react-sdk.mdx
Documentation now recommends getAccessToken(), describes cached-token and background-refresh behavior, and marks getToken() as deprecated.
Session, invitation, logout, and portal flows
src/content/docs/developer-tools/sdks/frontend/javascript-sdk.mdx
Session restoration callbacks, invitation codes, logout options, and portal navigation options are documented with updated examples.
Updated SDK method references
src/content/docs/developer-tools/sdks/frontend/javascript-sdk.mdx
Method references now cover updated redirect, logout, portal, organization, and user-profile option and return shapes.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Suggested labels: Update doc

Suggested reviewers: tamalchowdhury

Poem

A bunny refreshed the token trail,
With cached JWTs that never fail.
Old getToken rests beneath the moon,
While sessions restore and portals bloom. 🐰

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: updating JavaScript SDK docs to prefer getAccessToken over getToken.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/update-javascript-docs

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot 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.

🧹 Nitpick comments (1)
src/content/docs/developer-tools/sdks/frontend/javascript-sdk.mdx (1)

244-247: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Awkward phrasing in deprecation notice.

"updating to use the latest version of the SDK and using the getAccessToken method" repeats "using" and reads clunky.

✏️ Suggested wording
 <Aside title="Deprecation Notice">
-  The original getToken method is deprecated, and we recommend updating to use the latest version of
-  the SDK and using the getAccessToken method
+  The original getToken method is deprecated. We recommend updating to the latest version of
+  the SDK and using the getAccessToken method instead.
 </Aside>
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/content/docs/developer-tools/sdks/frontend/javascript-sdk.mdx` around
lines 244 - 247, The deprecation notice in the JavaScript SDK docs reads
awkwardly because it repeats “using” and is clunky. Update the wording in the
Aside titled “Deprecation Notice” to clearly say that the original getToken
method is deprecated and users should upgrade to the latest SDK version and use
getAccessToken instead, keeping the message concise and natural.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@src/content/docs/developer-tools/sdks/frontend/javascript-sdk.mdx`:
- Around line 244-247: The deprecation notice in the JavaScript SDK docs reads
awkwardly because it repeats “using” and is clunky. Update the wording in the
Aside titled “Deprecation Notice” to clearly say that the original getToken
method is deprecated and users should upgrade to the latest SDK version and use
getAccessToken instead, keeping the message concise and natural.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 3b55f093-cf20-4891-9e6b-5cd780b882d1

📥 Commits

Reviewing files that changed from the base of the PR and between a919491 and 0da41bc.

📒 Files selected for processing (1)
  • src/content/docs/developer-tools/sdks/frontend/javascript-sdk.mdx

@tamalchowdhury tamalchowdhury left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

@dtoxvanilla1991 dtoxvanilla1991 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.

Good work. 2 comments.

Comment thread src/content/docs/developer-tools/sdks/frontend/javascript-sdk.mdx
Comment thread src/content/docs/developer-tools/sdks/frontend/javascript-sdk.mdx
@gitguardian

gitguardian Bot commented Jul 14, 2026

Copy link
Copy Markdown

⚠️ GitGuardian has uncovered 1 secret following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

🔎 Detected hardcoded secret in your pull request
GitGuardian id GitGuardian status Secret Commit Filename
17253219 Triggered JSON Web Token 5549e63 src/content/docs/developer-tools/sdks/frontend/javascript-sdk.mdx View secret
🛠 Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secret safely. Learn here the best practices.
  3. Revoke and rotate this secret.
  4. If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.

To avoid such incidents in the future consider


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 14, 2026

Copy link
Copy Markdown

Deploying kinde-docs-preview with  Cloudflare Pages  Cloudflare Pages

Latest commit: d4c2ed4
Status: ✅  Deploy successful!
Preview URL: https://c8279d75.kinde-docs-preview.pages.dev
Branch Preview URL: https://fix-update-javascript-docs.kinde-docs-preview.pages.dev

View logs

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/content/docs/developer-tools/sdks/frontend/javascript-sdk.mdx`:
- Around line 181-206: Update the Invitations documentation to state that
invitation_code must be explicitly passed to login or register, and remove or
revise the claim that merely landing on a URL containing invitation_code
automatically starts sign-in.
- Around line 825-846: Update the options documentation in the RedirectOptions
section to show the actual RedirectOptions shape used by login, register, and
createOrg, including org_name alongside the supported organization and
invitation fields. Ensure the examples and type declaration consistently
reference RedirectOptions while preserving legacy AuthOptions compatibility
where applicable.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: de09642d-6cec-43d5-8ba2-69cbdeb17ed4

📥 Commits

Reviewing files that changed from the base of the PR and between 0da41bc and b65b8ba.

📒 Files selected for processing (3)
  • src/content/docs/build/tokens/refresh-tokens.mdx
  • src/content/docs/developer-tools/sdks/frontend/javascript-sdk.mdx
  • src/content/docs/developer-tools/sdks/frontend/react-sdk.mdx

Comment thread src/content/docs/developer-tools/sdks/frontend/javascript-sdk.mdx
Comment thread src/content/docs/developer-tools/sdks/frontend/javascript-sdk.mdx

@dtoxvanilla1991 dtoxvanilla1991 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.

💯

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants