mirror of
https://github.com/stack-auth/stack.git
synced 2026-06-04 21:04:37 +08:00
<!-- Make sure you've read the CONTRIBUTING.md guidelines: https://github.com/stack-auth/stack-auth/blob/dev/CONTRIBUTING.md --> Adds JWT docs and JWT viewer component to docs <img width="1182" height="668" alt="image" src="https://github.com/user-attachments/assets/f4196dd9-e159-420e-9d78-a3928983f126" /> <!-- RECURSEML_SUMMARY:START --> ## High-level PR Summary This PR adds comprehensive JWT (JSON Web Token) documentation and an interactive JWT viewer component to the Stack Auth documentation. The main additions are a new documentation page explaining JWT concepts, structure, and usage within Stack Auth, along with a React component that allows users to decode and inspect JWT tokens. The JWT viewer can automatically load the current user's session token if they are signed in, or accept manually pasted tokens. The documentation provides examples of both client-side and server-side JWT usage, security considerations, troubleshooting guidance, and best practices. The PR also includes necessary updates to metadata files and component exports to integrate the new content into the documentation platform. ⏱️ Estimated Review Time: 15-30 minutes <details> <summary>💡 Review Order Suggestion</summary> | Order | File Path | |-------|-----------| | 1 | `docs/templates/concepts/jwt.mdx` | | 2 | `docs/src/components/mdx/jwt-viewer.tsx` | | 3 | `docs/docs-platform.yml` | | 4 | `docs/src/components/mdx/index.ts` | | 5 | `docs/src/mdx-components.tsx` | | 6 | `docs/templates/meta.json` | | 7 | `docs/templates-python/meta.json` | </details> <!-- RECURSEML_SUMMARY:END --> <!-- ELLIPSIS_HIDDEN --> ---- > [!IMPORTANT] > Adds a new JWT concepts page and an interactive `JWTViewer` component, integrating it into MDX and navigation, with `jose` added for decoding. > > - **Docs**: > - Add `concepts/jwt.mdx` with JWT structure, claims, examples, verification, security, and best practices. > - Include JWT page in navigation: `docs-platform.yml`, `templates/meta.json`, and Python `templates-python/meta.json`. > - **UI Component**: > - Add `JWTViewer` in `docs/src/components/mdx/jwt-viewer.tsx` to decode JWTs (header, payload, signature), show time-based indicators, and load current user token via `useUser()`. > - Export and register in MDX: `docs/src/components/mdx/index.ts`, `docs/src/mdx-components.tsx`. > - **Dependencies**: > - Add `jose` to `docs/package.json` (lockfile updated). > > <sup>This description was created by </sup>[<img alt="Ellipsis" src="https://img.shields.io/badge/Ellipsis-blue?color=175173">](https://www.ellipsis.dev?ref=stack-auth%2Fstack-auth&utm_source=github&utm_medium=referral)<sup> forf25e369599. You can [customize](https://app.ellipsis.dev/stack-auth/settings/summaries) this summary. It will automatically update as commits are pushed.</sup> ---- <!-- ELLIPSIS_HIDDEN --> <!-- RECURSEML_ANALYSIS:START --> ## Review by RecurseML _🔍 Review performed on [ad34cfe..a135bbd](ad34cfecc2...a135bbdd77)_ ✨ No bugs found, your code is sparkling clean <details> <summary>✅ Files analyzed, no issues (3)</summary> • `docs/src/components/mdx/jwt-viewer.tsx` • `docs/src/mdx-components.tsx` • `docs/src/components/mdx/index.ts` </details> <details> <summary>⏭️ Files skipped (trigger manually) (4)</summary> | Locations | Trigger Analysis | |-----------|:------------------:| `docs/docs-platform.yml` | [ `docs/templates-python/meta.json` | [ `docs/templates/concepts/jwt.mdx` | [ `docs/templates/meta.json` | [ </details> [](https://discord.gg/n3SsVDAW6U) <!-- RECURSEML_ANALYSIS:END --> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Interactive JWT Viewer in the docs: paste or auto-load a token to inspect header, payload, signature with live decoding, validity/time indicators, per-field copy controls, and "load my token". * **Documentation** * New "JWT" concept page covering structure, claims, examples, client/server/manual usage, security, troubleshooting, and best practices. * JWT page added to site navigation and enabled across Next, React, JS, and Python docs. * **Chores** * Added runtime dependency to support JWT decoding in the docs. <!-- end of auto-generated comment: release notes by coderabbit.ai --> <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Adds a new JWT concepts page and an interactive `JWTViewer` component, integrating it into MDX and navigation, with `jose` added for decoding. > > - **Docs**: > - Add `concepts/jwt.mdx` with JWT structure, claims, examples, verification, security, and best practices. > - Include JWT page in navigation: `docs-platform.yml`, `templates/meta.json`, and Python `templates-python/meta.json`. > - **UI Component**: > - Add `JWTViewer` in `docs/src/components/mdx/jwt-viewer.tsx` to decode JWTs (header, payload, signature), show time-based indicators, and load current user token via `useUser()`. > - Export and register in MDX: `docs/src/components/mdx/index.ts`, `docs/src/mdx-components.tsx`. > - **Dependencies**: > - Add `jose` to `docs/package.json` (lockfile updated). > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit837fffb848. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> --------- Co-authored-by: Konsti Wohlwend <n2d4xc@gmail.com>
76 lines
2.3 KiB
JSON
76 lines
2.3 KiB
JSON
{
|
|
"name": "@stackframe/stack-docs",
|
|
"version": "2.8.41",
|
|
"description": "",
|
|
"main": "index.js",
|
|
"private": true,
|
|
"type": "module",
|
|
"scripts": {
|
|
"build": "npm run generate-platform-nav && next build",
|
|
"dev": "npm run generate-platform-nav && next dev --port 8104 --hostname 0.0.0.0",
|
|
"start": "next start --port 8104",
|
|
"lint": "next lint",
|
|
"lint:fix": "next lint --fix",
|
|
"postinstall": "fumadocs-mdx",
|
|
"generate-docs": "node scripts/generate-docs.js",
|
|
"generate-openapi-docs": "node scripts/generate-functional-api-docs.mjs",
|
|
"generate-platform-nav": "node scripts/generate-platform-navigation.js",
|
|
"setup-openapi": "node scripts/setup-openapi.mjs",
|
|
"clear-docs": "node scripts/clear-docs.js"
|
|
},
|
|
"dependencies": {
|
|
"@ai-sdk/google": "^1.2.21",
|
|
"@ai-sdk/openai": "^1.3.22",
|
|
"@ai-sdk/react": "^1.2.12",
|
|
"@modelcontextprotocol/sdk": "^1.17.2",
|
|
"@radix-ui/react-collapsible": "^1.1.11",
|
|
"@radix-ui/react-popover": "^1.1.14",
|
|
"@radix-ui/react-presence": "^1.1.4",
|
|
"@radix-ui/react-scroll-area": "^1.2.9",
|
|
"@radix-ui/react-slot": "^1.2.3",
|
|
"@radix-ui/react-tabs": "^1.1.12",
|
|
"@stackframe/stack": "workspace:^",
|
|
"@stackframe/stack-shared": "workspace:^",
|
|
"@vercel/mcp-adapter": "^1.0.0",
|
|
"@xyflow/react": "^12.6.4",
|
|
"ai": "^4.3.17",
|
|
"class-variance-authority": "^0.7.1",
|
|
"fumadocs-core": "15.3.3",
|
|
"fumadocs-mdx": "11.6.4",
|
|
"fumadocs-openapi": "^8.1.12",
|
|
"fumadocs-typescript": "^4.0.5",
|
|
"fumadocs-ui": "15.3.3",
|
|
"jose": "^6.1.0",
|
|
"js-yaml": "^4.1.0",
|
|
"lucide-react": "^0.511.0",
|
|
"mermaid": "^11.6.0",
|
|
"minimatch": "^10.0.1",
|
|
"next": "15.4.1",
|
|
"next-themes": "^0.4.6",
|
|
"posthog-js": "^1.235.0",
|
|
"posthog-node": "^4.1.0",
|
|
"react": "^18.3.1",
|
|
"react-dom": "^18.3.1",
|
|
"react-remove-scroll": "^2.7.0",
|
|
"remark": "^15.0.1",
|
|
"remark-gfm": "^4.0.1",
|
|
"remark-mdx": "^3.1.0",
|
|
"shiki": "^3.4.2",
|
|
"tailwind-merge": "^3.3.0",
|
|
"zod": "^3.23.8"
|
|
},
|
|
"devDependencies": {
|
|
"@tailwindcss/postcss": "^4.1.7",
|
|
"@types/mdx": "^2.0.13",
|
|
"@types/node": "22.15.18",
|
|
"@types/react": "^18.3.12",
|
|
"@types/react-dom": "^18.3.0",
|
|
"eslint": "^8",
|
|
"eslint-config-next": "15.3.2",
|
|
"glob": "^11.0.0",
|
|
"postcss": "^8.5.3",
|
|
"tailwindcss": "^4.1.7",
|
|
"typescript": "^5.8.3"
|
|
}
|
|
}
|