Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@scalar/types

scalar1.7mMIT0.3.0TypeScript support: included

Types to work with Scalar packages

typescript, types, scalar, references

readme

CI Contributors GitHub License Twitter Discord Scalar App

Scalar

<picture> <source media="(prefers-color-scheme: light)" srcset="https://github.com/user-attachments/assets/b391b82f-d993-4e97-8a17-1c3c7ccbb19b"> <source media="(prefers-color-scheme: dark)" srcset="https://github.com/user-attachments/assets/579d0853-b2a5-4ea8-b2bd-a98753faeaf3"> Scalar API client </picture> <picture> <source media="(prefers-color-scheme: light)" srcset="https://github.com/user-attachments/assets/9b639f2d-0204-4b15-b918-158072a9afa5"> <source media="(prefers-color-scheme: dark)" srcset="https://github.com/user-attachments/assets/be723d07-ec9c-4edb-b657-05a8bc05c7d6"> Scalar API Reference </picture>

An offline first API Client built for OpenAPI

└ Minimal, powerful & open-source
└ Integrates with dozens of API Frameworks (Elysia, Hono, FastAPI, etc)
└ Syncs directly with your server frameworks with our Watch Mode
└ First class OpenAPI (formerly Swagger) support
└ Environment variables and dynamic parameters
└ Save and organize requests into collections
Download (Windows, MacOS, Linux)
Try Online Demo

Interactive API Reference from OpenAPI/Swagger

└ Uses OpenAPI/Swagger documents
└ Request examples for many favorite languages and frameworks
└ Comes with an integrated API playground
└ Integrates with your favorite framework
└ Doesn't look like 2011
Try Demo

Trusted by:


<picture> <source media="(prefers-color-scheme: light)" srcset="https://github.com/user-attachments/assets/73dcef95-fc4f-4111-bb09-f3ce37453a81#gh-light-mode-only"> <source media="(prefers-color-scheme: dark)" srcset="https://github.com/user-attachments/assets/c792c977-8551-432c-9417-3ea05e408151#gh-dark-mode-only"> Scalar API client </picture> <picture> <source media="(prefers-color-scheme: light)" srcset="https://github.com/user-attachments/assets/1da6b904-34be-4760-b535-0dd2160e6d12#gh-light-mode-only"> <source media="(prefers-color-scheme: dark)" srcset="https://github.com/user-attachments/assets/54a9ea69-c50a-4f49-8c3e-ddd6f8fbe1f3#gh-dark-mode-only"> Scalar API client </picture>

Quickstart

You're just one HTML file away from having an awesome API reference:

<!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>
    <div id="app"></div>

    <!-- Load the Script -->
    <script src="https://cdn.jsdelivr.net/npm/@scalar/api-reference"></script>

    <!-- Initialize the Scalar API Reference -->
    <script>
      Scalar.createApiReference('#app', {
        // The URL of the OpenAPI/Swagger document
        url: 'https://registry.scalar.com/@scalar/apis/galaxy/latest?format=json',
        // Avoid CORS issues
        proxyUrl: 'https://proxy.scalar.com',
      })
    </script>
  </body>
</html>

Need a Custom Header? Check out this example: https://codepen.io/scalarorg/pen/VwOXqam

And there's an ever-growing list of plugins and integrations:

Integrations

Built-in Support

The following frameworks have chosen Scalar API Reference as their default OpenAPI documentation UI, recognizing its developer-friendly features and modern design:


Managed Hosting

We're offering a free and paid managed hosting on the edge, too:

  • Write your API documentation and publish your API references (free)
  • Get SSL and a super cool *.apidocumentation.com subdomain (free)
  • Write free text documentation (paid)
  • Collaborate with your whole team (paid)
  • Use any domain (paid)

Ready? Create your account on scalar.com.


Projects

Project Description
Scalar API Client API client
Scalar CLI Command-line interface
Scalar Galaxy OpenAPI Example
Scalar Mock Server OpenAPI Mock Server
Scalar Void Server HTTP Request Mirror
Scalar Open API Parser OpenAPI SDK
Scalar Sandbox Online OpenAPI Editor

Documentation

Topic Description
Themes Predefined themes, layouts & styling
Configuration The universal configuration object
Plugins Extend the functionality
OpenAPI OpenAPI and our extensions to it
Markdown The supported Markdown syntax

Community

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


Contributions

Contributions are welcome! Read the CONTRIBUTING guide.

Top 10 Contributors (April 2025)



Top Contributors (All Time)

hanspagel
hanspagel
amritk
amritk
xC0dex
xC0dex
antlio
antlio
marclave
marclave
hwkr
hwkr
cameronrohani
cameronrohani
geoffgscott
geoffgscott
tmastrom
tmastrom
DemonHa
DemonHa
inyourtime
inyourtime
bgrcs
bgrcs
federicobond
federicobond
ahmedrangel
ahmedrangel
matthyk
matthyk
Amorim33
Amorim33
liamdscalar
liamdscalar
ivanagas
ivanagas
Mason-Little
Mason-Little
RemcoGoy
RemcoGoy
adjsky
adjsky
ATREAY
ATREAY
Edgaraszs
Edgaraszs
fuma-nama
fuma-nama
gevann
gevann
lc-soft
lc-soft
Mohib834
Mohib834
nsychev
nsychev
mcollina
mcollina
mpminardi
mpminardi
SebastianBienert
SebastianBienert
ledgersteve
ledgersteve
timheuer
timheuer
ykdojo
ykdojo
x-delfino
x-delfino
hex0id
hex0id
yshrsmz
yshrsmz
soulchild
soulchild
mouhannad-sh
mouhannad-sh
mason-at-pieces
mason-at-pieces
luc122c
luc122c
handrews
handrews
WDaan
WDaan
Duncanma
Duncanma
gsmcdonald
gsmcdonald
rpmccarter
rpmccarter
roryschadler
roryschadler
rmp135
rmp135
mirismaili
mirismaili
STP5940
STP5940
captainsafia
captainsafia
realsama
realsama
ventocis
ventocis
dotfortun
dotfortun
smoores-dev
smoores-dev
soGit
soGit
sinh117801
sinh117801
Huliiiiii
Huliiiiii
hrynevychroman
hrynevychroman
rbange
rbange
rickihastings
rickihastings
rhuanbarreto
rhuanbarreto
petercinibulk
petercinibulk
Olexandr88
Olexandr88
malinbranduse
malinbranduse
mvt147
mvt147
MaxBreida
MaxBreida
tinchoz49
tinchoz49
not-my-profile
not-my-profile
MarioGK
MarioGK
ShadiestGoat
ShadiestGoat
mrlubos
mrlubos
sanscontext
sanscontext
unnoq
unnoq
tsiwek-piwik
tsiwek-piwik
dunklesToast
dunklesToast
omerp-explorium
omerp-explorium
o-az
o-az
kwaichanz
kwaichanz
horpto
horpto
g-airey
g-airey
ga1az
ga1az
FotieMConstant
FotieMConstant
danwithabox
danwithabox
WilliamBonvini
WilliamBonvini
bsdayo
bsdayo
Chinlinlee
Chinlinlee
bingbeann
bingbeann
zakaria-shahen
zakaria-shahen
rolldeep-stepmerrily
rolldeep-stepmerrily
Wolf-Syndrome
Wolf-Syndrome
wilcoschoneveld
wilcoschoneveld
rotciw
rotciw
Ma-ve
Ma-ve
Mai0313
Mai0313
Courtcircuits
Courtcircuits
rektdeckard
rektdeckard
thibaultleouay
thibaultleouay
yokeTH
yokeTH
stratosblue
stratosblue
diegolopes
diegolopes
untiny
untiny
lundibundi
lundibundi
DavidNiessen
DavidNiessen
darekaze
darekaze
danp
danp
danjohnson95
danjohnson95
yungwarlock
yungwarlock
ClanEver
ClanEver
chrislearn
chrislearn
chadwhitacre
chadwhitacre
carstenlebek
carstenlebek
cactysman
cactysman
brunogrcsada
brunogrcsada
brianheineman
brianheineman
Borisich
Borisich
bdpiprava
bdpiprava
BenJeau
BenJeau
saithis
saithis
zsilbi
zsilbi
arthurfiorette
arthurfiorette
arashsheyda
arashsheyda
sigpwned
sigpwned
gizero
gizero
alewin
alewin
slash686
slash686
ahmadi-akbar
ahmadi-akbar
MathurAditya724
MathurAditya724
abdulamite
abdulamite
kyllian
kyllian
seaglade
seaglade
jlnslv
jlnslv
IHIutch
IHIutch
jonataw
jonataw
Jannchie
Jannchie
jwangnz
jwangnz
Jefwillems
Jefwillems
TheVaan
TheVaan
Tholdrim
Tholdrim
JacobCoffee
JacobCoffee
kevinand11
kevinand11
tltsutltsu
tltsutltsu
eltociear
eltociear
IceyWu
IceyWu
iagobalmeida
iagobalmeida
hpmouton
hpmouton
CJHwong
CJHwong
HelgeSverre
HelgeSverre
Hamidrzash
Hamidrzash
255kb
255kb
GreyXor
GreyXor
Fdawgs
Fdawgs
filiabel
filiabel
facus26
facus26
emmanuel-ferdman
emmanuel-ferdman
elliott-with-the-longest-name-on-github
elliott-with-the-longest-name-on-github
elliotnash
elliotnash
DmitriiKhudiakov
DmitriiKhudiakov

changelog

@scalar/types

0.3.0

Minor Changes

  • 008a0f3: feat: migrate to Zod 4

Patch Changes

0.2.16

Patch Changes

  • 005fba9: feat: documentDownloadType: 'direct'

0.2.15

Patch Changes

  • abe3842: Add analytic events to api-client + add telemetry option

0.2.14

Patch Changes

  • 792c937: Configurable option for sidebar to show method path instead of method summary.

0.2.13

Patch Changes

  • 50032be: feat: added config options for sorting schema properties

0.2.12

Patch Changes

0.2.11

Patch Changes

  • ccf875a: feat: support x-scalar-credentials-location extension
  • 94d6d0c: fix: remove old ssr state and update nuxt for workspace store
  • Updated dependencies [ccf875a]

0.2.10

Patch Changes

  • fb62e1b: feat: add externalDocs

0.2.9

Patch Changes

0.2.8

Patch Changes

  • c10e191: feat(oauth2): add support for x-tokenName extension

0.2.7

Patch Changes

  • ad2e3e6: feat: new onBeforeRequest hook to modify the request

0.2.6

Patch Changes

  • 2d7f995: refactor: use more common straight apostrophe ' instead of the real apostrophe ’
  • Updated dependencies [2d7f995]

0.2.5

Patch Changes

0.2.4

Patch Changes

  • 1468280: feat: allow fine gained download button file type control

0.2.3

Patch Changes

0.2.2

Patch Changes

0.2.1

Patch Changes

0.2.0

Minor Changes

  • 483ca93: chore: require Node 20 (or above)

Patch Changes

0.1.16

Patch Changes

  • be8a6ec: chore: remove unused HarRequestWithPath

0.1.15

Patch Changes

  • f711ab5: feat: add auth persistance to references
  • 0222ad4: feat: render specification extensions with React
  • cb9428c: Support additional query parameters for the OAuth authorization request (prompt, audience, anything), and handle OAuth authorization denials
  • 67aa0f4: fix: render correct queries with form data
  • Updated dependencies [cb9428c]

0.1.14

Patch Changes

0.1.13

Patch Changes

  • e8457cb: Unify themes across scalar. Cleanup interface and remove CJS build.

0.1.12

Patch Changes

0.1.11

Patch Changes

  • eb4854d: fix: types of authentication config

0.1.10

Patch Changes

0.1.9

Patch Changes

  • 17e7d02: chore: export more types from the base types package for commonjs apps

0.1.8

Patch Changes

  • feaa314: feat(themes): add laserwave theme

0.1.7

Patch Changes

  • 9def02e: feat: added new callback for execution request
  • 3745d77: feat: new plugin system

0.1.6

Patch Changes

  • 3783345: feat: add some callbacks to sidebar items

0.1.5

Patch Changes

  • e09dab3: feat: multiple configurations with multiple sources
  • 04e27a1: feat: support x-default-scopes
  • Updated dependencies [e62e677]
  • Updated dependencies [82f16a5]

0.1.4

Patch Changes

  • 8efedf3: fix: allow async functions in onDocumentSelect
  • 82a4ba8: chore: move security schemes into types package for future reference
  • 57feba6: feat: added new auth config (v2)

0.1.3

Patch Changes

  • 543a16c: feat: allow to explicitly set the default source
  • 57e96a0: feat: add onDocumentSelect callback when switching multi configs

0.1.2

Patch Changes

  • 7a8965c: chore: remove spec prefix
  • 49dffff: feat: expose the isLoading prop to control loading of references

0.1.1

Patch Changes

  • 39c0f47: chore: export multi doc types

0.1.0

Minor Changes

  • 5f9a8a2: feat!: remove the spec prefix, make content and url top-level attributes

0.0.41

Patch Changes

  • fc6a45e: refactor: use import aliases

0.0.40

Patch Changes

  • 4d03e0f: feat: multiple documents

0.0.39

Patch Changes

  • bab7990: refactor: move HtmlRenderingConfiguration type to types package
  • 2c621d4: refactor: move snippetz types to @scalar/types

0.0.38

Patch Changes

  • 7f1a40e: fix: hiddenClients can be a boolean

0.0.37

Patch Changes

  • 89d8b75: feat: new ApiReferenceConfiguration type
  • 8a04b8d: fix: adds vendor specific mime type support

0.0.36

Patch Changes

  • 4db5161: feat: allow multiple tokens for bearer auth

0.0.35

Patch Changes

  • 946a5df: feat: add front-end redirect
  • cf14cbb: fix: show / mimetype in example response
  • Updated dependencies [c10bbf5]

0.0.34

Patch Changes

0.0.33

Patch Changes

0.0.32

Patch Changes

  • f500435: chore: stricter TypeScript configuration
  • b5727ef: feat: allow pre-selecting multiple and complex auth
  • 34e6f52: feat: upgrade to stricter tsconfig
  • f2b082a: feat: add onLoaded event

0.0.31

Patch Changes

  • a30e7cc: fix: package doesn’t work with moduleResolution: NodeNext

0.0.30

Patch Changes

0.0.29

Patch Changes

  • be34e7d: feat: adds value to server variables schema

0.0.28

Patch Changes

  • 702c386: feat: add support for stability
  • f1f39b0: feat: rewmove custom Server type

0.0.27

Patch Changes

  • b552db5: feat: add url customization functions for references

0.0.26

Patch Changes

  • 60cd6f1: feat: render the operation description from the new store
  • 60cd6f1: chore: deprecated the TransformedOperation type
  • Updated dependencies [13333e6]

0.0.25

Patch Changes

  • c263aaf: chore: improve the comment for UnknownObject

0.0.24

Patch Changes

  • fbef0c3: chore: remove httpsnippet-lite

0.0.23

Patch Changes

  • c2f5f08: feat: adds hideClientButton option configuration

0.0.22

Patch Changes

  • baaad1c: refactor: deprecated the proxy configuration attribute, and use proxyUrl everywhere
  • c984ac8: feat: adds servers to information reference config

0.0.21

Patch Changes

  • 9d23f95: chore: deprecate Parameters, use Parameter instead

0.0.20

Patch Changes

  • f67c3bc: feat: add framework themes

0.0.19

Patch Changes

0.0.18

Patch Changes

  • fb798c8: chore: make OpenAPI document URLs the default, deprecated content

0.0.17

Patch Changes

0.0.16

Patch Changes

  • dbbe38f: feat: add framework identifier for debugging purposes

0.0.15

Patch Changes

0.0.14

Patch Changes

0.0.13

Patch Changes

  • 9dc2ab7: feat: new operationsSorter option

0.0.12

Patch Changes

  • 8f12149: chore: add point to declaration file

0.0.11

Patch Changes

  • f961940: feat: remove @scalar/themes from the dependencies of @scalar/types

0.0.10

Patch Changes

0.0.9

Patch Changes

0.0.8

Patch Changes

0.0.7

Patch Changes

  • a07cfc8: feat: allow to hide the Test Request button
  • 023ca15: feat: adds favicon configuration
  • 85872b6: feat: allow to hide search sidebar

0.0.6

Patch Changes

0.0.5

Patch Changes

0.0.4

Patch Changes

0.0.3

Patch Changes

0.0.2

Patch Changes

  • 910b1c2: Add build step for path resolution

0.0.1

Patch Changes