Official JavaScript/TypeScript SDK monorepo for the Localess headless CMS platform.
Localess is a headless CMS designed for teams that need flexible content management with multi-locale support, a Visual Editor, and a developer-friendly API. This repository houses all official JavaScript and TypeScript integrations as a single npm workspaces monorepo.
Keeping all packages together in one repository ensures that shared types and interfaces remain consistent, changes to the core SDK are immediately reflected in framework-specific packages, and versioning stays synchronized across the entire SDK surface.
| Package | Version | Description |
|---|---|---|
@localess/client |
3.0.0 | Core JavaScript/TypeScript SDK. Fetch content, translations, and assets from the Localess API. Server-side only. |
@localess/react |
3.0.0 | React integration. Dynamic component mapping, rich text rendering, and Visual Editor sync. |
@localess/cli |
3.0.0 | Command-line interface. Manage translations and generate TypeScript types from your content schemas. |
@localess/react ──┐
├──▶ @localess/client (core SDK)
@localess/cli ──┘
@localess/client is the foundational layer. Both @localess/react and @localess/cli depend on it for API communication, caching, and shared type definitions.
Choose the package that fits your use case:
npm install @localess/clientimport { localessClient } from "@localess/client";
const client = localessClient({
origin: 'https://my-localess.web.app',
spaceId: 'YOUR_SPACE_ID',
token: 'YOUR_API_TOKEN', // Keep secret — server-side only
});
const content = await client.getContentBySlug('home');
const translations = await client.getTranslations('en');→ See the full @localess/client documentation
npm install @localess/reactimport { localessInit, getLocalessClient, LocalessComponent } from "@localess/react";
localessInit({
origin: process.env.LOCALESS_ORIGIN,
spaceId: process.env.LOCALESS_SPACE_ID,
token: process.env.LOCALESS_TOKEN,
enableSync: true,
components: { 'hero': HeroBlock, 'footer': Footer },
});→ See the full @localess/react documentation
npm install @localess/cli -D
localess login
localess translations pull en --path ./locales/en.json
localess types generate→ See the full @localess/cli documentation
localess-js/
├── packages/
│ ├── client/ # @localess/client
│ ├── react/ # @localess/react
│ └── cli/ # @localess/cli
├── package.json # Workspace root (npm workspaces)
└── LICENSE
- Node.js >= 20.0.0
- npm >= 10 (for workspaces support)
npm install# Build all packages in dependency order
npm run build
# Build individual packages
npm run build:client
npm run build:react
npm run build:cliTests are currently provided for @localess/cli:
npm test --workspace=@localess/cliContributions are welcome! Please open an issue or pull request on GitHub.