[PR #4824] [MERGED] docs(jwt): add jwtClient plugin method for token retrieval #13844

Closed
opened 2026-04-13 09:10:38 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/4824
Author: @Ducktatorrr
Created: 9/22/2025
Status: Merged
Merged: 9/22/2025
Merged by: @himself65

Base: canaryHead: docs/jwt-client-usage-guide


📝 Commits (1)

  • 73fc3ff docs(jwt): add client usage section with jwtClient plugin guide

📊 Changes

1 file changed (+34 additions, -2 deletions)

View changed files

📝 docs/content/docs/plugins/jwt.mdx (+34 -2)

📄 Description

Summary

Enhanced the JWT plugin documentation by adding the jwtClient plugin as the recommended method for retrieving JWT tokens, reorganising the existing token retrieval methods.

Changes Made

  • Added jwtClient plugin configuration example as method 1 (recommended)
  • Included proper error handling with { data, error } destructuring pattern
  • Reorganized existing token retrieval methods (session token and header methods are now method 2 and 3)
  • Added clear setup instructions and usage examples for the client plugin

Context

The JWT documentation previously only showed server-side and indirect methods for getting tokens. Adding the jwtClient plugin method provides users with the recommended client-side approach for JWT token retrieval with proper error handling.


Summary by cubic

Adds the jwtClient plugin as the recommended way to retrieve JWTs in the docs, with clear client-side examples and error handling. Reorganizes the existing methods to make selection straightforward.

  • New Features
    • Added jwtClient plugin setup and token retrieval example using the { data, error } pattern.
    • Marked jwtClient as the recommended client-side approach; moved session token and header methods to 2 and 3.
    • Included brief setup steps and guidance for using tokens with external APIs.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/better-auth/better-auth/pull/4824 **Author:** [@Ducktatorrr](https://github.com/Ducktatorrr) **Created:** 9/22/2025 **Status:** ✅ Merged **Merged:** 9/22/2025 **Merged by:** [@himself65](https://github.com/himself65) **Base:** `canary` ← **Head:** `docs/jwt-client-usage-guide` --- ### 📝 Commits (1) - [`73fc3ff`](https://github.com/better-auth/better-auth/commit/73fc3ffb72c869873a1f9159e4478d0df2407314) docs(jwt): add client usage section with jwtClient plugin guide ### 📊 Changes **1 file changed** (+34 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `docs/content/docs/plugins/jwt.mdx` (+34 -2) </details> ### 📄 Description ## Summary Enhanced the JWT plugin documentation by adding the `jwtClient` plugin as the recommended method for retrieving JWT tokens, reorganising the existing token retrieval methods. ## Changes Made - Added `jwtClient` plugin configuration example as method 1 (recommended) - Included proper error handling with `{ data, error }` destructuring pattern - Reorganized existing token retrieval methods (session token and header methods are now method 2 and 3) - Added clear setup instructions and usage examples for the client plugin ## Context The JWT documentation previously only showed server-side and indirect methods for getting tokens. Adding the `jwtClient` plugin method provides users with the recommended client-side approach for JWT token retrieval with proper error handling. <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Adds the jwtClient plugin as the recommended way to retrieve JWTs in the docs, with clear client-side examples and error handling. Reorganizes the existing methods to make selection straightforward. - **New Features** - Added jwtClient plugin setup and token retrieval example using the { data, error } pattern. - Marked jwtClient as the recommended client-side approach; moved session token and header methods to 2 and 3. - Included brief setup steps and guidance for using tokens with external APIs. <!-- End of auto-generated description by cubic. --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-13 09:10:38 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#13844