
Security News
Next.js Patches Critical Middleware Vulnerability (CVE-2025-29927)
Next.js has patched a critical vulnerability (CVE-2025-29927) that allowed attackers to bypass middleware-based authorization checks in self-hosted apps.
@scalar/api-reference
Advanced tools
Generate interactive API documentations from Swagger files. Try our Demo
npm install @scalar/api-reference
<script setup>
import { ApiReference } from '@scalar/api-reference'
import '@scalar/api-reference/style.css'
</script>
<template>
<ApiReference />
</template>
<!doctype html>
<html>
<head>
<title>Scalar API Reference</title>
<meta charset="utf-8" />
<meta
name="viewport"
content="width=device-width, initial-scale=1" />
</head>
<body>
<!-- Need a Custom Header? Check out this example: https://codepen.io/scalarorg/pen/VwOXqam -->
<!-- Note: We’re using our public proxy to avoid CORS issues. You can remove the `data-proxy-url` attribute if you don’t need it. -->
<script
id="api-reference"
data-url="https://cdn.jsdelivr.net/npm/@scalar/galaxy/dist/latest.yaml"
data-proxy-url="https://proxy.scalar.com"></script>
<!-- Optional: You can set a full configuration object like this: -->
<script>
var configuration = {
theme: 'purple',
}
document.getElementById('api-reference').dataset.configuration =
JSON.stringify(configuration)
</script>
<script src="https://cdn.jsdelivr.net/npm/@scalar/api-reference"></script>
</body>
</html>
You can also use the following syntax to directly pass an OpenAPI specification:
<script
id="api-reference"
type="application/json">
{ … }
</script>
If you’d like to add a request proxy for the API client (to avoid CORS issues):
<script
id="api-reference"
type="application/json"
data-proxy-url="https://proxy.scalar.com">
{ … }
</script>
We have recently added two events to the standalone CDN build only.
Reload the references, this will re-mount the app in case you have switched pages or the dom elements have been removed.
document.dispatchEvent(new Event('scalar:reload-references'))
If you have updated the config or spec, you can trigger this event with the new payload to update the app. It should update reactively so you do not need to trigger the reload event above after.
import { type ReferenceProps } from './types'
const ev = new CustomEvent('scalar:update-references-config', {
detail: {
configuration: {
url: 'https://cdn.jsdelivr.net/npm/@scalar/galaxy/dist/latest.yaml',
},
} satisfies ReferenceProps,
})
document.dispatchEvent(ev)
The API Reference is built in Vue.js. If you’re working in Vue.js, too, you can directly use our Vue components.
Install them via npm
:
npm install @scalar/api-reference
And import the ApiReference
component and style to your app:
<script setup lang="ts">
import { ApiReference } from '@scalar/api-reference'
import '@scalar/api-reference/style.css'
</script>
<template>
<ApiReference
:configuration="{
url: 'https://cdn.jsdelivr.net/npm/@scalar/galaxy/dist/latest.yaml',
}" />
</template>
You can pass props to customize the API reference.
We are API nerds. You too? Let’s chat on Discord: https://discord.gg/scalar
The source code in this repository is licensed under MIT.
FAQs
generate beautiful API references from OpenAPI specs
The npm package @scalar/api-reference receives a total of 30,938 weekly downloads. As such, @scalar/api-reference popularity was classified as popular.
We found that @scalar/api-reference demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 8 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.
Security News
Next.js has patched a critical vulnerability (CVE-2025-29927) that allowed attackers to bypass middleware-based authorization checks in self-hosted apps.
Security News
A survey of 500 cybersecurity pros reveals high pay isn't enough—lack of growth and flexibility is driving attrition and risking organizational security.
Product
Socket, the leader in open source security, is now available on Google Cloud Marketplace for simplified procurement and enhanced protection against supply chain attacks.