Yarn workspace monorepo:
packages/core—@fusionauth-sdk/core, shared logic for React/Angular/Vue SDKspackages/lexicon—@fusionauth-sdk/lexicon, shared utility types (Path, GUID, etc.)packages/sdk-react—@fusionauth/react-sdkpackages/sdk-angular— Angular SDK (sdk-angular-workspace)packages/sdk-vue—@fusionauth/vue-sdk
- Yarn 1.22.x via Corepack, not npm.
yarnmay not be onPATHdirectly — usecorepack yarn <cmd>if plainyarnisn't found. - Root scripts:
yarn build:core,yarn build:sdk-react, etc. Per-workspace:yarn workspace @fusionauth-sdk/core test.
- Angular SDK requires Node ^22.22.3 / ^24.15.0 / >=26.0.0. If the active
Node is v20.x,
yarn workspace sdk-angular-workspace test(and the rootyarn testwhich runs it) will fail with an engine/CLI version error. This is an environment limitation, not a code issue — don't try to "fix" it by changing the Angular config. - If
yarn installcomplains about the Angular engine mismatch, useyarn install --ignore-engines.
- Vitest,
environment: 'jsdom'(see each package'svite.config.ts). packages/coretests needingindexedDBmust polyfill it withfake-indexeddb'sIDBFactory(jsdom has no native IndexedDB).- Husky's
.husky/pre-commithook runsyarn testacross all workspaces pluslint-staged. In environments without Node 22+, this hook will fail on the Angular workspace even when your actual changes are fine — verify the specific package's tests pass, note that the Angular failure is environmental, and usegit commit --no-verifyif needed (call this out explicitly to the user rather than silently bypassing).
- ESLint config: root
.eslintrc.json(@typescript-eslint, warns on unused vars,prefer-const). - Prettier: root
.prettierrc(single quotes, semi, trailing commas, 80 print width). Runnpx prettier --check <paths>/--writebefore committing.
- Each module lives in its own folder with
X.ts,X.test.ts, and anindex.tsbarrel export (seeUrlHelper/,CookieHelpers/,DPoP/). - Constructors that take more than one argument use a config object (e.g.
DPoPStorageConfig,UrlHelperConfig) rather than positional parameters. - Browser-only APIs (
localStorage,indexedDB, etc.) should degrade gracefully for non-browser/SSR consumers — seeRedirectHelper.ts's try/catch fallback pattern. - Doc comments (
/** ... */) on all publicSDKConfigfields and public class methods, matching existing style. - IndexedDB
dbVersion: IndexedDB versions can only increase. Never pass adbVersionlower than one already persisted in a browser — doing so produces aVersionErrorand the database will not open. Only incrementdbVersionwhen a structural schema change (e.g. new object store) is also being made insideonupgradeneeded.