Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@scalar/fastify-api-reference

Package Overview
Dependencies
Maintainers
8
Versions
333
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@scalar/fastify-api-reference

a fastify plugin to render an API reference from an OpenAPI file

  • 1.25.82
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
54K
increased by0.69%
Maintainers
8
Weekly downloads
 
Created
Source

Scalar for Fastify

Version Downloads License Discord

This plugin provides an easy way to render a beautiful API reference based on a OpenAPI/Swagger file with Fastify.

Screenshot of an API Reference

Installation

npm install @scalar/fastify-api-reference

And then register it with Fastify:

await fastify.register(require('@scalar/fastify-api-reference'), {
  routePrefix: '/reference',
})

Usage

If you have a OpenAPI/Swagger file already, you can pass an URL to the plugin:

// Render an API reference for a given OpenAPI/Swagger spec URL
fastify.register(require('@scalar/fastify-api-reference'), {
  routePrefix: '/reference',
  configuration: {
    title: 'Our API Reference',
    spec: {
      url: '/openapi.json',
    },
  },
})

With [@fastify/swagger], we’re picking it up automatically, so this would be enough:

await fastify.register(require('@scalar/fastify-api-reference'), {
  routePrefix: '/reference',
})

We wrote a detailed integration guide for Fastify.

The fastify plugin takes our universal configuration object, read more about configuration in the core package README.

Themes

By default, we’re using a custom Fastify theme and it’s beautiful. But you can choose one of our other themes, too:

await fastify.register(require('@scalar/fastify-api-reference'), {
  routePrefix: '/reference',
  configuration: {
    theme: 'purple',
  },
})

Community

We are API nerds. You too? Let’s chat on Discord: https://discord.gg/scalar

License

The source code in this repository is licensed under MIT.

Keywords

FAQs

Package last updated on 13 Dec 2024

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc