@scalar/nextjs-api-reference 0.8.5 → 0.8.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/README.md +6 -96
  3. package/package.json +3 -3
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @scalar/nextjs-api-reference
2
2
 
3
+ ## 0.8.7
4
+
5
+ ### Patch Changes
6
+
7
+ - @scalar/core@0.3.4
8
+
9
+ ## 0.8.6
10
+
11
+ ### Patch Changes
12
+
13
+ - 161733e: docs: new README
14
+
3
15
  ## 0.8.5
4
16
 
5
17
  ### Patch Changes
package/README.md CHANGED
@@ -5,104 +5,14 @@
5
5
  [![License](https://img.shields.io/npm/l/%40scalar%2fnextjs-api-reference)](https://www.npmjs.com/package/@scalar/nextjs-api-reference)
6
6
  [![Discord](https://img.shields.io/discord/1135330207960678410?style=flat&color=5865F2)](https://discord.gg/scalar)
7
7
 
8
- This plugin provides an easy way to render a beautiful API reference based on an OpenAPI/Swagger file with Next.js.
8
+ ## Documentation
9
9
 
10
- <picture>
11
- <source media="(prefers-color-scheme: dark)" srcset="https://github.com/scalar/scalar/assets/2039539/5837adad-a605-4edb-90ec-b929ff2b803b">
12
- <source media="(prefers-color-scheme: light)" srcset="https://github.com/scalar/scalar/assets/2039539/4f58202d-f40f-47b3-aeaa-44681b424a45">
13
- <img alt="Screenshot of an API Reference" src="https://github.com/scalar/scalar/assets/2039539/4f58202d-f40f-47b3-aeaa-44681b424a45">
14
- </picture>
10
+ [Read the documentation here](https://guides.scalar.com/scalar/scalar-api-references/integrations/nextjs)
15
11
 
16
- ## Installation
12
+ ## Community
17
13
 
18
- ```bash
19
- npm install @scalar/nextjs-api-reference
20
- ```
14
+ We are API nerds. You too? Let’s chat on Discord: <https://discord.gg/scalar>
21
15
 
22
- ## Compatibility
16
+ ## License
23
17
 
24
- This package is compatible with Next.js 15 and is untested on Next.js 14. If you want guaranteed Next.js 14 support
25
- please use version `0.4.106` of this package.
26
-
27
- ## Usage
28
-
29
- If you have a OpenAPI/Swagger file already, you can pass a URL to the plugin in an API [Route](https://nextjs.org/docs/app/building-your-application/routing/route-handlers):
30
-
31
- ```ts
32
- // app/reference/route.ts
33
- import { ApiReference } from '@scalar/nextjs-api-reference'
34
-
35
- const config = {
36
- url: '/openapi.json',
37
- }
38
-
39
- export const GET = ApiReference(config)
40
- ```
41
-
42
- Or, if you just have a static OpenAPI spec, you can directly pass it as well:
43
-
44
- ```ts
45
- const config = {
46
- content: '{ "openapi": "3.1.1", … }',
47
- }
48
- ```
49
-
50
- We wrote a [detailed integration guide for Next.js](/documentation/integrations/nextjs.md).
51
-
52
- The Next.js handler takes our universal configuration object, [read more about configuration](https://github.com/scalar/scalar/tree/main/documentation/configuration.md) in the core package README.
53
-
54
- ## Themes
55
-
56
- By default, we’re using a custom Next.js theme and it’s beautiful. But you can choose [one of our other themes](https://github.com/scalar/scalar/tree/main/packages/themes), too:
57
-
58
- ```ts
59
- const config = {
60
- theme: 'purple',
61
- }
62
- ```
63
-
64
- ## Pages router
65
-
66
- If you are using the pages router, you can import the React component
67
-
68
- ```bash
69
- npm install @scalar/api-reference-react
70
- ```
71
-
72
- ```tsx
73
- 'use client'
74
-
75
- import { ApiReferenceReact } from '@scalar/api-reference-react'
76
-
77
- import '@scalar/api-reference-react/style.css'
78
-
79
- export default function References() {
80
- return (
81
- <ApiReferenceReact
82
- configuration={{
83
- url: 'https://cdn.jsdelivr.net/npm/@scalar/galaxy/dist/latest.json',
84
- }}
85
- />
86
- )
87
- }
88
- ```
89
-
90
- ### Specific CDN version
91
-
92
- By default, this integration will use the latest version of the `@scalar/api-reference`.
93
-
94
- 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`
95
-
96
- You can find all available CDN versions [here](https://www.jsdelivr.com/package/npm/@scalar/api-reference?tab=files)
97
-
98
- ```ts
99
- // app/reference/route.ts
100
- import { ApiReference } from '@scalar/nextjs-api-reference'
101
-
102
- const config = {
103
- url: '/openapi.json',
104
- cdn: 'https://cdn.jsdelivr.net/npm/@scalar/api-reference@latest',
105
- }
106
-
107
- export const GET = ApiReference(config)
108
- ```
18
+ The source code in this repository is licensed under [MIT](https://github.com/scalar/scalar/blob/main/LICENSE).
package/package.json CHANGED
@@ -18,7 +18,7 @@
18
18
  "openapi",
19
19
  "swagger"
20
20
  ],
21
- "version": "0.8.5",
21
+ "version": "0.8.7",
22
22
  "engines": {
23
23
  "node": ">=20"
24
24
  },
@@ -35,7 +35,7 @@
35
35
  ],
36
36
  "module": "./dist/index.js",
37
37
  "dependencies": {
38
- "@scalar/core": "0.3.3"
38
+ "@scalar/core": "0.3.4"
39
39
  },
40
40
  "devDependencies": {
41
41
  "@types/node": "^20.17.10",
@@ -47,7 +47,7 @@
47
47
  "react-dom": "^19.0.0",
48
48
  "vite": "5.4.19",
49
49
  "vite-plugin-dts": "^4.3.0",
50
- "@scalar/api-reference": "1.31.9"
50
+ "@scalar/api-reference": "1.31.18"
51
51
  },
52
52
  "peerDependencies": {
53
53
  "next": "^15.2.4",