Today Platform Web — Dev Docs
Workspace

Packages

The shared workspace packages under packages/ — auth-client, storybook preset, utils, webview-bridge SDK, and the TypeScript base config.

packages/* holds the small, sharply-scoped libraries that apps and the design system consume. None of them deploy on their own.

PackagePathRole
@todayai-labs/auth-clientpackages/auth-clientDomain + environment + OIDC URL resolution
@todayai-labs/storybookpackages/storybookShared Storybook preview / theme / window primitives
@todayai-labs/utilspackages/utilsSmall utility functions used across apps
@todayai-labs/webview-bridgepackages/webview-bridgeWeb-side client SDK for the WebView Bridge contract
@todayai-labs/tsconfigpackages/tsconfigShared TypeScript base config (extended by every project)

@todayai-labs/auth-client

The single source of truth for which auth and API origin every environment talks to. Apps consume resolveAuthBaseUrl() and resolveApiBaseUrl() rather than hard-coding URLs.

Resolution rules walk three sources in order: explicit NEXT_PUBLIC_* overrides, then per-environment computed defaults, then production fallbacks. The exact rules live in packages/auth-client/src/urls.ts and are covered in Architecture → Three-tier domains (PR-CB).

Unlike the other @todayai-labs/* workspace packages, this one is published to GitHub Packages under the @todayai-labs scope so future sibling repos (today-admin, etc.) can consume it cross-repo. Inside this monorepo it is still linked via workspace:*; the version-resolution rewrite only happens at pnpm publish time.

@todayai-labs/storybook

Shared Storybook preview and decorator code so the three Storybooks (web, design-system/ui, design-system/opal) render with the same theme / background / window chrome. See Toolchain → Testing → Storybook (PR-CB) for the full topology.

@todayai-labs/utils

Small, type-safe utility functions. No theme, no Radix, no React. If a function needs react or @todayai-labs/tdx-ui as a peer it does not belong here.

@todayai-labs/webview-bridge

The web-side SDK for the WebView Bridge contract. Native hosts (iOS, macOS, Android, Windows) implement the matching native side. Documented in detail at apps/webview-bridge-docs — this site does not duplicate that reference.

When you want to call the bridge from web code, import @todayai-labs/webview-bridge and read the Web SDK section of the dedicated docs site.

@todayai-labs/tsconfig

Just one file: base.json. Every project (apps/*, design-system/*, packages/*) extends it. The base sets ES target, module resolution, strict mode, and incremental build behavior — see Toolchain → tsconfig references (PR-CB) for the full layout and why every project ships its own tsconfig.app.json + tsconfig.node.json on top.

Adding a new package

Short version (full checklist in workspace/adding-package, PR-CC):

  1. Create packages/<name>/ with package.json (@todayai-labs/<name>), tsconfig.json, and a minimal moon.yml (typecheck + test tasks).
  2. Pull versioned deps from pnpm-workspace.yaml's catalog: (strict mode rejects ad-hoc versions).
  3. Add the project to the root tsconfig.json's references if it participates in tsgo --build (almost always yes).
  4. Run pnpm install — Moon picks up the new project from .moon/workspace.yml's glob.

On this page