feat: additional documentation - #209
Conversation
…ion. typedoc@0.25.13 only supports TypeScript up to 5.4, but sdk-angular runs TypeScript ~6.0.0 (bumped in the Angular 22 upgrade). Bump typedoc to ^0.28.20 (explicit TS 6.0.x support) and typedoc-plugin-markdown to ^4.12.0 (required peer range for typedoc 0.28.x). Also fix tsconfig.json's base types declaration: it still listed ["jasmine"] even though the Angular test runner was migrated to Vitest in the 2.0.0 release, causing typedoc's full-program type check to fail on *.spec.ts files referencing vitest globals (expect, it). Changed to ["vitest/globals", "node"], matching tsconfig.spec.json. This only affects tooling that reads the base tsconfig directly (typedoc, IDEs); the actual build/test tsconfigs (tsconfig.lib*.json, tsconfig.spec.json) already declare their own types and are unaffected.
…doc output. ENG-4791: Add a Resource Server Guidance subsection under DPoP Mode in each SDK's README (React, Vue, Angular), covering guidance for backend developers validating FusionAuth-issued DPoP tokens: - The SDK does not implement jti replay prevention; that's the resource server's responsibility (in-memory Map+TTL for single instance, Redis or similar for horizontally scaled deployments). - htu validation and reverse-proxy trust-proxy considerations. - The Authorization header uses the DPoP scheme, not Bearer. Also regenerate the typedoc output (yarn docs) for all three SDKs, which was stale and had no mention of the DPoP API surface (dpopFetch, generateProof, getAccessToken, useDpop, dpopTokenStorage, etc.).
- Add useCodeBlocks: true to sdk-angular's typedocOptions. Without it, typedoc-plugin-markdown@4's default blockquote-style signatures (e.g. `> **forRoot**(...): `ModuleWithProviders`\<`FusionAuthModule`\>`) trigger a prettier@3.9.6 markdown-formatter bug that inserts a stray '>' when reformatting an escaped '\>' immediately after inline code within a blockquote line. Fenced code blocks avoid the pattern entirely and are more readable besides. - Regenerate sdk-react and sdk-vue docs (picks up the latest commit hash in "Defined in" links) and run prettier --write across all three SDKs' generated docs. Verified every non-'***'->'---'-normalization diff (table column alignment, redundant double-backtick removal) is safe by diffing against the pre-write output; no content was altered or corrupted.
…ch packages subdirectory.
There was a problem hiding this comment.
Pull request overview
This PR updates the DPoP documentation across the Vue, React, and Angular SDKs, including adding resource server guidance and refreshing generated TypeDoc outputs (with an Angular TypeDoc/tooling bump) to support ENG-4791.
Changes:
- Added “Resource Server Guidance” under DPoP documentation for Vue/React/Angular.
- Expanded Vue/React docs with a DPoP Mode section and updated TOCs/formatting.
- Updated Angular docs generation config (TypeDoc/plugin upgrade) and regenerated docs; updated
yarn.lockaccordingly.
Reviewed changes
Copilot reviewed 31 out of 32 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| yarn.lock | Locks new/updated dependencies from the doc tooling updates. |
| packages/sdk-vue/README.md | Adds resource-server guidance under DPoP documentation. |
| packages/sdk-vue/docs/README.md | Adds DPoP Mode section + resource server guidance; general doc formatting updates. |
| packages/sdk-vue/docs/modules.md | Regenerated module index links/paths. |
| packages/sdk-vue/docs/interfaces/UserInfo.md | Regenerated interface docs formatting/link targets. |
| packages/sdk-vue/docs/interfaces/FusionAuthConfig.md | Documents new/updated DPoP-related config fields (generated output). |
| packages/sdk-vue/docs/interfaces/FusionAuth.md | Documents DPoP-related API surface (dpopFetch, generateProof, getAccessToken) (generated output). |
| packages/sdk-react/README.md | Adds resource-server guidance under DPoP documentation. |
| packages/sdk-react/docs/README.md | Adds DPoP Mode + resource server guidance; doc formatting updates. |
| packages/sdk-react/docs/modules/ui_Unauthenticated.md | Regenerated TypeDoc link target updates. |
| packages/sdk-react/docs/modules/ui_RequireAuth.md | Regenerated TypeDoc link target updates. |
| packages/sdk-react/docs/modules/ui_FusionAuthRegisterButton.md | Regenerated TypeDoc link target updates. |
| packages/sdk-react/docs/modules/ui_FusionAuthLogoutButton.md | Regenerated TypeDoc link target updates. |
| packages/sdk-react/docs/modules/ui_FusionAuthLoginButton.md | Regenerated TypeDoc link target updates. |
| packages/sdk-react/docs/modules/providers_FusionAuthProvider.md | Regenerated TypeDoc link target updates. |
| packages/sdk-react/docs/interfaces/providers_FusionAuthProviderContext.FusionAuthProviderContext.md | Adds DPoP-related context fields in generated docs. |
| packages/sdk-react/docs/interfaces/providers_FusionAuthProviderConfig.FusionAuthProviderConfig.md | Adds DPoP-related config fields in generated docs. |
| packages/sdk-angular/tsconfig.json | Updates TypeDoc options and compiler types for vitest/node. |
| packages/sdk-angular/README.md | Adds resource-server guidance under DPoP documentation. |
| packages/sdk-angular/package.json | Upgrades TypeDoc + typedoc-plugin-markdown versions. |
| packages/sdk-angular/docs/README.md | Regenerated docs README header/formatting. |
| packages/sdk-angular/docs/interfaces/UserInfo.md | Regenerated interface docs formatting/links. |
| packages/sdk-angular/docs/interfaces/FusionAuthConfig.md | Regenerated config interface docs; includes DPoP-related fields. |
| packages/sdk-angular/docs/globals.md | Regenerated globals index formatting. |
| packages/sdk-angular/docs/classes/FusionAuthService.md | Regenerated class docs; includes DPoP method docs. |
| packages/sdk-angular/docs/classes/FusionAuthRegisterButtonComponent.md | Regenerated class docs formatting/links. |
| packages/sdk-angular/docs/classes/FusionAuthModule.md | Regenerated class docs formatting/links. |
| packages/sdk-angular/docs/classes/FusionAuthLogoutButtonComponent.md | Regenerated class docs formatting/links. |
| packages/sdk-angular/docs/classes/FusionAuthLoginButtonComponent.md | Regenerated class docs formatting/links. |
| packages/sdk-angular/docs/classes/FusionAuthAccountButtonComponent.md | Regenerated class docs formatting/links. |
| packages/sdk-angular/docs/.nojekyll | Removes the .nojekyll file from Angular docs output. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- packages/sdk-vue/README.md: fix reversed welcomeMessage ternary in the usage example (was returning the generic greeting when a name IS present, and interpolating the possibly-undefined name otherwise). - packages/sdk-react/README.md: correct invalid Formatting section commands (npm run install / npm run prettier -- -w) to the actual yarn-based equivalents (yarn install / yarn prettier --write). - getAccessToken() JSDoc: remove the inaccurate "Throws a descriptive error when useDpop: false" line from the optional getAccessToken field in sdk-react's FusionAuthProviderContext, sdk-vue's FusionAuth type, and core's SDKContext interface. These fields are simply undefined when useDpop is false (verified against useDpop.ts / createFusionAuth.ts); they don't throw. Matches the accurate style already used by the sibling dpopFetch/generateProof JSDoc. Angular's FusionAuthService.getAccessToken() is unaffected since it's non-optional there and does genuinely delegate straight to SDKCore, which does throw. - Regenerate sdk-react and sdk-vue docs and re-run prettier to pick up all of the above.
50afc59 to
3cedf88
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 31 out of 32 changed files in this pull request and generated no new comments.
Suppressed comments (5)
packages/sdk-vue/docs/README.md:170
- The
welcomeMessageexample has the conditional reversed: whennameis present it returns a generic "Welcome!", and when it’s absent it interpolatesuserInfo.value.given_name(which may be undefined / throw ifuserInfo.valueis null). This makes the snippet misleading and potentially unsafe.
const welcomeMessage = computed(() => {
const name = userInfo.value?.given_name;
return name ? 'Welcome!' : `Welcome ${userInfo.value.given_name}!`;
});
packages/sdk-react/docs/README.md:304
- These commands aren’t valid for this repo:
npm run installwon’t install dependencies (it runs aninstallscript), and there is noprettiernpm script (root scripts useformat:fix/format:check). Use Yarn (or the repo’s format script) instead.
- npm run install
- npm run prettier -- -w /path/to/file
AGENTS.md:47
- This guidance references an
npm run prettierscript that doesn’t exist in the rootpackage.json(scripts areformat:fix/format:check). This can mislead contributors and cause formatting to be skipped or fail in CI.
width). Run `npm run prettier -- -w /path/to/file <paths>` / `--write` before committing.
packages/sdk-react/docs/interfaces/providers_FusionAuthProviderContext.FusionAuthProviderContext.md:133
- This
getAccessTokendoc says it "throws" whenuseDpop: false, but in the React SDK the property is optional and isundefinedunlessuseDpop: true(seeFusionAuthProvider.test.tsxexpectations). The docs should reflect the actual runtime shape to avoid confusing consumers; also consider fixing the source JSDoc inFusionAuthProviderContext.tsso re-generated docs stay correct.
Returns the stored DPoP access token, or `null` if not logged in.
Throws a descriptive error when `useDpop: false`.
Present only when `useDpop: true`.
packages/sdk-vue/docs/interfaces/FusionAuth.md:110
- This
getAccessTokendoc says it "throws" whenuseDpop: false, but in the Vue SDK the property is optional and isundefinedunlessuseDpop: true(seecreateFusionAuth.tsassigningundefinedwhenuseDpopis falsy, and the corresponding tests). The docs should reflect the actual runtime shape; also consider fixing the source JSDoc inpackages/sdk-vue/src/types.tsso re-generated docs stay correct.
Returns the stored DPoP access token, or `null` if not logged in.
Throws a descriptive error when `useDpop: false`.
Present only when `useDpop: true`.
| @@ -1,61 +1,43 @@ | |||
| [@fusionauth/angular-sdk](../README.md) / [Exports](../modules.md) / FusionAuthAccountButtonComponent | |||
There was a problem hiding this comment.
This PR includes the updated generated SDK documentation for each Framework.
| - [State Parameter](#state-parameter) | ||
| - [SSR](#ssr) | ||
| - [DPoP Mode](#dpop-mode) | ||
| - [Resource Server Guidance](#resource-server-guidance) |
There was a problem hiding this comment.
Each SDK has a README and a Resource Server Guidance section was added.
mrudatsprint
left a comment
There was a problem hiding this comment.
self-review completed
…ion. typedoc@0.25.13 only supports TypeScript up to 5.4, but sdk-angular runs TypeScript ~6.0.0 (bumped in the Angular 22 upgrade). Bump typedoc to ^0.28.20 (explicit TS 6.0.x support) and typedoc-plugin-markdown to ^4.12.0 (required peer range for typedoc 0.28.x). Also fix tsconfig.json's base types declaration: it still listed ["jasmine"] even though the Angular test runner was migrated to Vitest in the 2.0.0 release, causing typedoc's full-program type check to fail on *.spec.ts files referencing vitest globals (expect, it). Changed to ["vitest/globals", "node"], matching tsconfig.spec.json. This only affects tooling that reads the base tsconfig directly (typedoc, IDEs); the actual build/test tsconfigs (tsconfig.lib*.json, tsconfig.spec.json) already declare their own types and are unaffected.
…doc output. ENG-4791: Add a Resource Server Guidance subsection under DPoP Mode in each SDK's README (React, Vue, Angular), covering guidance for backend developers validating FusionAuth-issued DPoP tokens: - The SDK does not implement jti replay prevention; that's the resource server's responsibility (in-memory Map+TTL for single instance, Redis or similar for horizontally scaled deployments). - htu validation and reverse-proxy trust-proxy considerations. - The Authorization header uses the DPoP scheme, not Bearer. Also regenerate the typedoc output (yarn docs) for all three SDKs, which was stale and had no mention of the DPoP API surface (dpopFetch, generateProof, getAccessToken, useDpop, dpopTokenStorage, etc.).
- Add useCodeBlocks: true to sdk-angular's typedocOptions. Without it, typedoc-plugin-markdown@4's default blockquote-style signatures (e.g. `> **forRoot**(...): `ModuleWithProviders`\<`FusionAuthModule`\>`) trigger a prettier@3.9.6 markdown-formatter bug that inserts a stray '>' when reformatting an escaped '\>' immediately after inline code within a blockquote line. Fenced code blocks avoid the pattern entirely and are more readable besides. - Regenerate sdk-react and sdk-vue docs (picks up the latest commit hash in "Defined in" links) and run prettier --write across all three SDKs' generated docs. Verified every non-'***'->'---'-normalization diff (table column alignment, redundant double-backtick removal) is safe by diffing against the pre-write output; no content was altered or corrupted.
…ch packages subdirectory.
3cedf88 to
1d53741
Compare
…fusionauth-javascript-sdk into miker/eng-4791/documentation
Issues:
Description:
Generate the documentation for each SDK.