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/api-clientpackages/api-clientGenerated cloud-API SDK + Zod schemas + runtime helpers
@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/api-client

The typed cloud-API surface every Today web client consumes. Generated from https://api.todayai.dev/doc via @hey-api/openapi-ts (run pnpm api:generate); ships three subpaths so consumers can pull only what they need:

  • @todayai-labs/api-client (root) — generated SDK functions (getV1Tasks, postV1Skills, …), TypeScript types, and the platform identification headers (X-Client-Platform, X-App-Version).
  • @todayai-labs/api-client/schemas — domain Zod schemas (organization, task, user, api-error). No SDK / framework deps.
  • @todayai-labs/api-client/runtime — cross-cutting runtime helpers used by every consumer's data layer: safeFetch (Zod-validated fetch), optimisticMutation, showErrorToast, clearPersistedQueryCache.

The runtime config (packages/api-client/src/client-config.ts) reads resolveApiBaseUrl() from @todayai-labs/auth-client, so the same SDK works in apps/web, apps/tangible, and any future surface without re-wiring. See Architecture → API codegen for the regeneration flow.

@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.

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 product/design-system Storybooks render with the same theme / background / window chrome. See Toolchain → Testing → Storybook 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/opal-ui as a peer it does not belong here.

@todayai-labs/webview-bridge

The web-side SDK for the WebView Bridge contract. Hosts on iOS, macOS, Android, Windows, and Linux implement the matching side; Linux uses the Electron desktop app shell. 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 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):

  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