by codecrumbs

Scalar renders OpenAPI/Swagger documents into beautiful, interactive API references with a built-in API testing client. Integrates with Express, FastAPI, NestJS, Next.js, Fastify, Hono, Nuxt, Astro, .NET, and 30+ more frameworks.
This block delivers the full Scalar monorepo: an interactive OpenAPI/Swagger API reference UI and an offline-first API client. It targets backend teams who want to embed a polished, framework-agnostic API reference into Node.js, NestJS, Fastify, Express, React, Vue, or SvelteKit projects. The monorepo ships integrations, examples, and tooling ready to drop into an existing TypeScript project.
.agents/ - AI agent skill definitions for code generation assistance.changeset/ - Changesets for versioned package releases.claude/ - Claude AI settings for the repo.devcontainer/ - VS Code devcontainer configuration.github/ - CI workflows, Renovate config, PR templates, and GitHub Actions.vscode/ - Editor settings.zed/ - Zed editor configurationdocumentation/ - Scalar documentation sourceexamples/ - Runnable integration examples (NestJS, React, SvelteKit, SSG, and more)integrations/ - Framework-specific integration packagespackages/ - Core Scalar npm packages (API reference, client, themes, etc.)projects/ - Internal Scalar projectstooling/ - Shared build and lint toolingbiome.json - Biome linter/formatter configeslint.config.mjs - ESLint configurationpackage.json - Monorepo root packagepnpm-workspace.yaml - pnpm workspace definitiontsconfig.json - Root TypeScript configurationturbo.json - Turborepo pipeline configurationvitest.config.ts - Vitest test runner configuration# Core NestJS integration
npm install @scalar/nestjs-api-reference @nestjs/common @nestjs/core @nestjs/swagger
# For Fastify-based NestJS
npm install @nestjs/platform-fastify
# For Express-based NestJS
npm install @nestjs/platform-express
# For React integration
npm install react react-dom
# For Vue/SvelteKit integrations, install per your framework
npm install @scalar/api-reference
No native build steps (no pod install, no Android linking, no Expo prebuild) are required. All packages are pure JavaScript/TypeScript.
Spin up an isolated sandbox and run it server-side — no local setup.
Tetrees AI Review of this version
This TypeScript cli / script completed archive review with strong static results. Structure, dependency manifests, documentation, functional source, and common risk patterns were checked by the Tetrees verification pipeline; runtime phases are stated separately.
Deterministic AVCP artifact review
Pipeline avcp-2026-08-04.1 · SHA-256 6e17d1450b200cf0…
This version-scoped review deterministically inspects the submitted archive for structure, dependencies, documentation, functional source, and common malicious or high-risk signals. Build and test phases are reported as passed only after an isolated sandbox audition. It is not a guarantee of perfect security.
Reviewed Aug 4, 2026
Push this product straight into your AI IDE, web builder or cloud IDE.
Connect Tetrees to a compatible AI IDE, list products you own, and request the verified ZIP without exposing seller upload controls.
No reviews yet.
Sign in to join the discussion
Loading discussion…
Copy the source/ directory into your project root, or reference specific subdirectories (packages/, integrations/, examples/) as needed.
If using the monorepo tooling directly, ensure pnpm is installed and run:
pnpm install
Add the relevant tsconfig.json path aliases if you reference internal packages by workspace name:
{
"compilerOptions": {
"paths": {
"@scalar/*": ["./source/packages/*/src"]
}
}
}
For a standalone Node/Express or NestJS project, install only the specific integration package (e.g., @scalar/nestjs-api-reference) from npm rather than the full monorepo.
Set environment variables if needed:
PORT=5056
HOST=0.0.0.0
For Turborepo builds across the monorepo, run:
pnpm turbo build
import { apiReference } from '@scalar/nestjs-api-reference'
function apiReference(options: {
content?: object | string
withFastify?: boolean
[key: string]: unknown
}): RequestHandler
The primary integration function for NestJS. Pass your OpenAPI document object via content to render the interactive Scalar API reference UI as Express middleware. Set withFastify: true when using the Fastify adapter instead of Express.
import { DocumentBuilder } from '@nestjs/swagger'
const config = new DocumentBuilder()
.setTitle(string)
.setDescription(string)
.setVersion(string)
.addTag(string)
.build()
Used to construct the OpenAPI document metadata before passing it to SwaggerModule.createDocument. This is a NestJS peer dependency, not a Scalar export, but every Scalar NestJS example depends on it.
import { SwaggerModule } from '@nestjs/swagger'
const document = SwaggerModule.createDocument(app: INestApplication, config: OpenAPIObject): OpenAPIObject
Generates the full OpenAPI document from your NestJS application and the config built with DocumentBuilder. The resulting document object is passed directly to apiReference({ content: document }).
import { ViteSSG } from 'vite-ssg/single-page'
import App from './App.vue'
export const createApp = ViteSSG(App)
Used in the static site generation example. Replace the standard createApp(App).mount('#app') pattern with the exported createApp constant when targeting SSG output.
Mount the Scalar API reference at the root path of a standard NestJS/Express application. The document is generated from NestJS Swagger decorators and passed directly to the middleware.
import { NestFactory } from '@nestjs/core'
import { DocumentBuilder, SwaggerModule } from '@nestjs/swagger'
import { apiReference } from '@scalar/nestjs-api-reference'
import { AppModule } from './app.module'
const PORT = Number(process.env.PORT || 5056)
const HOST = process.env.HOST || '0.0.0.0'
async function bootstrap() {
const app = await NestFactory.create(AppModule)
const config = new DocumentBuilder()
.setTitle('My API')
.setDescription('API description')
.setVersion('1.0')
.addTag('users')
.build()
const document = SwaggerModule.createDocument(app, config)
app.use(
'/',
apiReference({
content: document,
}),
)
await app.listen(PORT, HOST, () => {
console.log(`Listening at http://${HOST}:${PORT}`)
})
}
void bootstrap()
Use the Fastify-compatible variant by passing withFastify: true. This adjusts the middleware signature to match Fastify's request/reply model.
import { NestFactory } from '@nestjs/core'
import { FastifyAdapter, type NestFastifyApplication } from '@nestjs/platform-fastify'
import { DocumentBuilder, SwaggerModule } from '@nestjs/swagger'
import { apiReference } from '@scalar/nestjs-api-reference'
import { AppModule } from './app.module'
const PORT = Number(process.env.PORT) || 5057
const HOST = process.env.HOST || '0.0.0.0'
async function bootstrap() {
const app = await NestFactory.create<NestFastifyApplication>(AppModule, new FastifyAdapter())
const config = new DocumentBuilder()
.setTitle('My Fastify API')
.setDescription('Fastify-backed API')
.setVersion('2.0')
.addTag('items')
.build()
const document = SwaggerModule.createDocument(app, config)
app.use(
'/',
apiReference({
withFastify: true,
content: document,
}),
)
await app.listen(PORT, HOST, () => {
console.log(`Fastify listening at http://${HOST}:${PORT}`)
})
}
void bootstrap()
Wire Scalar's API reference component into a React app using the standard React 18 root API. Swap App with whichever component renders @scalar/api-reference.
import React from 'react'
import ReactDOM from 'react-dom/client'
import App from './App'
ReactDOM.createRoot(document.getElementById('root')!).render(
<React.StrictMode>
<App />
</React.StrictMode>,
)
// App.tsx
import { ApiReference } from '@scalar/api-reference'
export default function App() {
return (
<ApiReference
configuration={{
url: 'https://cdn.jsdelivr.net/npm/@scalar/galaxy/dist/latest.yaml',
}}
/>
)
}
.agents/ - Skill definitions (OpenAPI glossary, TypeScript, Vue components) used by AI coding agents interacting with the repo..changeset/ - Individual changeset markdown files tracking unreleased changes per package; consumed by changeset CLI on release..claude/ - Project-level Claude AI settings (settings.json) for agentic coding sessions..devcontainer/ - Devcontainer spec so the repo opens consistently in VS Code or GitHub Codespaces..github/ - All CI/CD: GitHub Actions workflows for testing and release, Renovate dependency update config, PR templates..vscode/ - Recommended extensions and workspace settings..zed/ - Zed editor project settings.documentation/ - Markdown and config for Scalar's public documentation site.examples/ - Self-contained runnable apps demonstrating every major integration (NestJS/Express, NestJS/Fastify, React Webpack, SvelteKit, SSG).integrations/ - Per-framework adapter packages (Hono, Elysia, Fastify, etc.).packages/ - Published npm packages: @scalar/api-reference, @scalar/nestjs-api-reference, @scalar/themes, and others.projects/ - Internal apps (the Scalar cloud dashboard, etc.) not published to npm.tooling/ - Shared ESLint configs, TypeScript base configs, and build scripts.biome.json - Biome linter and formatter rules applied monorepo-wide.eslint.config.mjs - ESLint flat config for packages that use ESLint instead of Biome.knip.jsonc - Knip unused-export detection config.lefthook.yml - Git hook runner configuration.package.json - Root workspace manifest; declares pnpm and Turbo scripts.pnpm-workspace.yaml - Lists all workspace globs so pnpm links internal packages.scalar.config.json - Scalar-specific project metadata.tsconfig.json - Root TypeScript config extended by all packages.turbo.json - Turborepo task graph: build, test, lint pipelines with caching.vitest.config.ts - Shared Vitest configuration for unit tests across packages.withFastify: true when using NestFastifyApplication causes request handler signature mismatches. Always set the flag when using FastifyAdapter.npm install at the root will not resolve workspace packages correctly. Use pnpm install..nvmrc or package.json engines field to avoid subtle build failures.@scalar/api-reference publishes ESM. If your bundler targets CJS, configure moduleResolution: bundler or node16 in tsconfig.json and ensure your bundler handles .mjs extensions.@scalar/nestjs-api-reference has @nestjs/common and @nestjs/swagger as peers. Omitting them produces runtime errors, not install-time errors.pnpm turbo build --force to bypass stale Turbo cache.I have dropped the Scalar monorepo source into `source/` in my project root.
Read `source/USAGE.md` for the full integration guide.
The upstream package is `user@example.com` (scalar/scalar monorepo).
The key integration package is `@scalar/nestjs-api-reference`.
My project is: [describe your stack, e.g. "NestJS 10 with Express, TypeScript 5, deployed on Railway"].
Please do the following step by step:
1. Install the required dependencies listed in USAGE.md for my stack.
2. Update my `src/main.ts` to import `apiReference` from `@scalar/nestjs-api-reference`
and mount it at `/reference` using my existing NestJS app and Swagger document.
3. If I use Fastify, add `withFastify: true` to the `apiReference` options.
4. Confirm the `tsconfig.json` settings needed for ESM compatibility.
5. Show me the final `src/main.ts` in full with all imports resolved.
Only use exports and patterns visible in `source/examples/` and `source/USAGE.md`.
Do not invent new APIs.
Scalar is released under the MIT License. See source/LICENSE for the full text. Upstream repository: https://github.com/scalar/scalar. The npm packages are published under the @scalar scope.
This product’s unique contribution is clean room implementation of valuable code block into AVCP compatible standard.
The full install guide and integration prompts unlock after purchase.
Automation, Utilities & Developer Tools
Free