
Research
/Security News
Malicious npm Packages Target WhatsApp Developers with Remote Kill Switch
Two npm packages masquerading as WhatsApp developer libraries include a kill switch that deletes all files if the phone number isn’t whitelisted.
@scalar/nextjs-api-reference
Advanced tools
a Next.js component to render API references from an OpenAPI file
This plugin provides an easy way to render a beautiful API reference based on an OpenAPI/Swagger file with Next.js.
npm install @scalar/nextjs-api-reference
This package is compatible with Next.js 15 and is untested on Next.js 14. If you want guaranteed Next.js 14 support
please use version 0.4.106
of this package.
If you have a OpenAPI/Swagger file already, you can pass a URL to the plugin in an API Route:
// app/reference/route.ts
import { ApiReference } from '@scalar/nextjs-api-reference'
const config = {
url: '/openapi.json',
}
export const GET = ApiReference(config)
Or, if you just have a static OpenAPI spec, you can directly pass it as well:
const config = {
content: '{ "openapi": "3.1.1", … }',
}
We wrote a detailed integration guide for Next.js.
The Next.js handler takes our universal configuration object, read more about configuration in the core package README.
By default, we’re using a custom Next.js theme and it’s beautiful. But you can choose one of our other themes, too:
const config = {
theme: 'purple',
}
If you are using the pages router, you can import the React component
npm install @scalar/api-reference-react
'use client'
import { ApiReferenceReact } from '@scalar/api-reference-react'
import '@scalar/api-reference-react/style.css'
export default function References() {
return (
<ApiReferenceReact
configuration={{
url: 'https://cdn.jsdelivr.net/npm/@scalar/galaxy/dist/latest.json',
}}
/>
)
}
By default, this integration will use the latest version of the @scalar/api-reference
.
You can also pin the CDN to a specific version by specifying it in the CDN string like https://cdn.jsdelivr.net/npm/@scalar/api-reference@1.25.28
You can find all available CDN versions here
// app/reference/route.ts
import { ApiReference } from '@scalar/nextjs-api-reference'
const config = {
url: '/openapi.json',
cdn: 'https://cdn.jsdelivr.net/npm/@scalar/api-reference@latest',
}
export const GET = ApiReference(config)
FAQs
a Next.js component to render API references from an OpenAPI file
The npm package @scalar/nextjs-api-reference receives a total of 37,135 weekly downloads. As such, @scalar/nextjs-api-reference popularity was classified as popular.
We found that @scalar/nextjs-api-reference demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 10 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.
Research
/Security News
Two npm packages masquerading as WhatsApp developer libraries include a kill switch that deletes all files if the phone number isn’t whitelisted.
Research
/Security News
Socket uncovered 11 malicious Go packages using obfuscated loaders to fetch and execute second-stage payloads via C2 domains.
Security News
TC39 advances 11 JavaScript proposals, with two moving to Stage 4, bringing better math, binary APIs, and more features one step closer to the ECMAScript spec.