Skip to main content

JavaScript SDK Development

The JavaScript SDKs live in javascript-sdks, a pnpm workspace managed with Turborepo. Every package publishes under the @thunderid scope.

Packages

PackagePurpose
@thunderid/javascriptFramework-agnostic core: auth flows, token management, i18n, utilities
@thunderid/browserBrowser runtime: storage, session sync, WebAuthn
@thunderid/nodeNode runtime: cookies, server sessions
@thunderid/reactReact SDK
@thunderid/vueVue SDK
@thunderid/nextjsNext.js SDK
@thunderid/nuxtNuxt module
@thunderid/expressExpress SDK
@thunderid/react-routerReact Router integration
@thunderid/tanstack-routerTanStack Router integration

They build on each other rather than standing alone. Each arrow points from a package to the ones built on top of it:

Put a shared helper as close to the root as it can go. A utility used by both React and Vue belongs in browser, or in javascript if it needs nothing from the browser, rather than being duplicated in each.

Commands

Run these from the repository root:

pnpm install
pnpm build
pnpm test
pnpm lint # pnpm lint:fix to apply
pnpm typecheck
pnpm format:check # pnpm format:fix to apply

Scope any of them to one package with a filter:

pnpm --filter @thunderid/react run build

Two other commands are worth knowing: pnpm symlink links packages for local development against another project, and pnpm clean clears build output.

Conventions

  • Dependency versions are centralized. pnpm-workspace.yaml holds a catalog: of pinned versions plus an overrides block of security pins. Add or bump a shared dependency there rather than in an individual package.
  • Every source file carries a copyright header, enforced by the @thunderid/copyright-header ESLint rule. Files under samples/ are exempt.
  • Do not hardcode the vendor name in runtime keys such as storage keys or log tags. Resolve it with getVendorPrefix(vendor) so a consumer's vendor override applies.
  • Formatting comes from @thunderid/prettier-config. Run pnpm format:fix rather than hand-formatting.

Next Steps

Explore with AI

ThunderID LogoThunderID Logo

Product

DocsAPIsSDKs
© Copyright Linux Foundation Europe.For web site terms of use, trademark policy and other project policies please see https://linuxfoundation.eu/en/policies.