Product
Socket Now Supports uv.lock Files
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
@scalar/hono-api-reference
Advanced tools
This middleware provides an easy way to render a beautiful API reference based on an OpenAPI/Swagger file with Hono.
npm install @scalar/hono-api-reference
Set up Zod OpenAPI Hono and pass the configured URL to the apiReference
middleware:
import { apiReference } from '@scalar/hono-api-reference'
app.get(
'/reference',
apiReference({
spec: {
url: '/openapi.json',
},
}),
)
The Hono middleware takes our universal configuration object, read more about configuration in the core package README.
The middleware comes with a custom theme for Hono. You can use one of the other predefined themes (alternate
, default
, moon
, purple
, solarized
) or overwrite it with none
. All themes come with a light and dark color scheme.
import { apiReference } from '@scalar/hono-api-reference'
app.get(
'/reference',
apiReference({
theme: 'purple',
spec: {
url: '/openapi.json',
},
}),
)
There’s one additional option to set the page title:
import { apiReference } from '@scalar/hono-api-reference'
app.get(
'/reference',
apiReference({
pageTitle: 'Hono API Reference',
spec: {
url: '/openapi.json',
},
}),
)
You can use a custom CDN ,default is https://cdn.jsdelivr.net/npm/@scalar/api-reference
.
import { apiReference } from '@scalar/nestjs-api-reference'
app.use(
'/reference',
apiReference({
cdn: 'https://cdn.jsdelivr.net/npm/@scalar/api-reference',
spec: {
content: OpenApiSpecification,
},
}),
)
FAQs
A middleware for using the Scalar API reference in Hono
The npm package @scalar/hono-api-reference receives a total of 25,244 weekly downloads. As such, @scalar/hono-api-reference popularity was classified as popular.
We found that @scalar/hono-api-reference demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
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.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.
Security News
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.