Skip to main content
All Figentra packages are published under the @figentra scope on the npm registry. They are designed to be installed together inside a monorepo workspace — each package is independently versioned but built to work as a cohesive suite. This guide covers system requirements, workspace configuration, installing the core packages, and verifying that everything compiles correctly.

System Requirements

Make sure your environment satisfies the following before installing any @figentra/* packages:
Figentra packages are authored in TypeScript and ship both CommonJS and ESM builds. You do not need any extra bundler plugins to consume them — import them directly in .ts source files.

Workspace Setup

Figentra expects a monorepo structure where packages share a single node_modules hoist at the workspace root. The examples below use pnpm workspaces, but the same principle applies to Yarn workspaces and Turborepo. Create a pnpm-workspace.yaml file at the root of your repository:
pnpm-workspace.yaml
Then initialise the root package.json if you have not done so already:
Your repository layout should look similar to this after setup:

Installing Packages

Install one or more @figentra/* packages using your preferred package manager. Add the -w flag (pnpm) or -W flag (npm/Yarn) to hoist the packages to the workspace root so every app and service can import them without repeating the install.
Each package serves a distinct purpose:
Keep all @figentra/* packages on the same version across your workspace. Running mismatched versions causes subtle type incompatibilities that are difficult to diagnose. Use a tool like syncpack or a Turborepo generator to enforce version consistency in CI.

TypeScript Configuration

Figentra packages require TypeScript 5+ with strict mode enabled. The recommended approach is to define a shared base config at the repository root and extend it in each package. Create tsconfig.base.json at the workspace root:
tsconfig.base.json
Each package in your monorepo should extend this base config:
packages/core/tsconfig.json
If you are using Turborepo, add a build task to turbo.json so TypeScript compilation is cached and only re-runs when source files change:
turbo.json
Do not set "skipLibCheck": true in your base config. Figentra packages ship full declaration files, and skipping lib checks hides real type errors at package boundaries that would otherwise surface immediately.

Verifying the Install

After installing the packages and configuring TypeScript, create a small smoke-test file to confirm that imports resolve and the compiler is satisfied:
src/verify.ts
Run the TypeScript compiler in check-only mode:
If the command exits with code 0 and no output, the installation is complete and your workspace is ready.
Add pnpm tsc --noEmit as a step in your CI pipeline so type errors are caught on every pull request, before any code reaches your main branch.

Your workspace is now fully configured to use @figentra/* packages. Continue with the guides below:

Quickstart

Follow a step-by-step walkthrough to define your first contract and handle typed errors in under five minutes.

Packages Overview

Explore every @figentra/* package in depth, including full API references and usage patterns.