Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@hestjs/scalar

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@hestjs/scalar

HestJS Scalar API Reference Integration - Beautiful API documentation for HestJS applications

latest
Source
npmnpm
Version
0.1.6
Version published
Maintainers
1
Created
Source

@hestjs/scalar

HestJS Scalar API Reference Integration - Beautiful API documentation for HestJS applications

Installation

npm install @hestjs/scalar

Quick Start

import { HestFactory } from '@hestjs/core';
import { ScalarModule } from '@hestjs/scalar';
import { AppModule } from './app.module';

async function bootstrap() {
  const app = await HestFactory.create(AppModule);
  
  // Configure Scalar API Reference
  app.useScalar({
    path: '/docs',           // Documentation path
    spec: '/openapi.json',   // OpenAPI spec endpoint
    theme: 'hest',          // Custom HestJS theme
    title: 'My API Documentation'
  });

  // Start server
  Bun.serve({
    port: 3000,
    fetch: app.hono().fetch,
  });
}

bootstrap();

Features

  • 🎨 Beautiful API documentation with multiple themes
  • 📱 Responsive design for mobile and desktop
  • 🔍 Interactive API explorer
  • 📋 Copy-paste code examples
  • 🌙 Dark/light mode support
  • 📄 Markdown export for LLMs
  • 🎯 HestJS-specific theme and branding

Configuration Options

OptionTypeDefaultDescription
pathstring'/docs'Path where documentation will be served
specstring | object-OpenAPI specification (URL or object)
themestring'hest'UI theme (hest, default, purple, moon, etc.)
titlestring'API Documentation'Page title
cdnstring-Custom CDN URL for Scalar assets
proxyUrlstring-Proxy URL for CORS issues in development

Usage with OpenAPI Generation

// Coming soon: Integration with OpenAPI generation from decorators
import { ApiProperty, ApiResponse } from '@hestjs/scalar';

@Controller('/users')
export class UserController {
  @Get('/')
  @ApiResponse({ status: 200, description: 'List of users' })
  async getUsers() {
    // ...
  }
}

Themes

HestJS Scalar comes with a custom HestJS theme by default. You can also use:

  • hest - Custom HestJS theme (default)
  • default - Scalar default theme
  • purple - Purple theme
  • moon - Dark theme
  • solarized - Solarized theme
  • none - No theme (custom styling)

Advanced Configuration

app.useScalar({
  path: '/docs',
  spec: {
    openapi: '3.0.0',
    info: {
      title: 'My API',
      version: '1.0.0',
    },
    // ... your OpenAPI spec
  },
  theme: 'hest',
  customCss: `
    .scalar-app {
      --scalar-color-1: #your-brand-color;
    }
  `,
  servers: [
    { url: 'https://api.example.com', description: 'Production' },
    { url: 'http://localhost:3000', description: 'Development' }
  ]
});

License

MIT

Keywords

hestjs

FAQs

Package last updated on 30 Jul 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts