@lukoweb/apitogo 0.1.67 → 0.1.69
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.
- package/dist/cli/cli.js +552 -380
- package/dist/declarations/lib/plugins/openapi/processors/injectApitogoGatewayServer.d.ts +6 -0
- package/docs/components/playground.mdx +6 -8
- package/docs/components/slot.mdx +2 -2
- package/docs/concepts/auth-provider-api-identities.md +8 -12
- package/docs/configuration/ai-assistants.md +3 -3
- package/docs/configuration/api-catalog.md +4 -4
- package/docs/configuration/api-reference.md +11 -11
- package/docs/configuration/authentication-auth0.md +8 -1
- package/docs/configuration/authentication-azure-ad.md +8 -1
- package/docs/configuration/authentication-clerk.md +8 -1
- package/docs/configuration/authentication-firebase.md +8 -1
- package/docs/configuration/authentication-pingfederate.md +8 -1
- package/docs/configuration/authentication-supabase.md +10 -3
- package/docs/configuration/authentication.md +96 -195
- package/docs/configuration/build-configuration.mdx +2 -2
- package/docs/configuration/docs.md +10 -10
- package/docs/configuration/footer.mdx +84 -180
- package/docs/configuration/llms.md +1 -1
- package/docs/configuration/make-config.mdx +12 -5
- package/docs/configuration/manifest.md +4 -14
- package/docs/configuration/navigation.mdx +2 -2
- package/docs/configuration/overview.md +95 -310
- package/docs/configuration/protected-routes.md +3 -3
- package/docs/configuration/search.md +4 -3
- package/docs/configuration/site.md +5 -5
- package/docs/configuration/slots.mdx +1 -1
- package/docs/custom-plugins.md +1 -1
- package/docs/customization/colors-theme.mdx +8 -8
- package/docs/customization/fonts.md +4 -4
- package/docs/deploy/apitogo.md +18 -12
- package/docs/deploy/cloudflare-pages.md +0 -1
- package/docs/deploy/direct-upload.md +0 -1
- package/docs/deploy/github-pages.md +1 -2
- package/docs/deploy/vercel.md +2 -3
- package/docs/deployment.md +11 -10
- package/docs/extending/events.md +1 -1
- package/docs/guides/custom-pages.md +4 -8
- package/docs/guides/environment-variables.md +41 -49
- package/docs/guides/managing-api-keys-and-identities.md +40 -115
- package/docs/guides/navigation-rules.mdx +1 -1
- package/docs/guides/processors.mdx +2 -2
- package/docs/guides/transforming-examples.md +1 -1
- package/docs/markdown/code-blocks.md +2 -2
- package/docs/markdown/mdx.md +1 -1
- package/docs/mcp/go-live.md +100 -0
- package/docs/mcp/overview.md +76 -0
- package/docs/mcp/setup.md +173 -0
- package/docs/mcp/shape.md +76 -0
- package/docs/mcp/tools.md +102 -0
- package/docs/plugins.md +20 -1
- package/docs/quickstart.md +49 -54
- package/docs/writing.mdx +1 -1
- package/package.json +1 -1
- package/src/lib/authentication/components/ProductionUnlockPage.tsx +4 -5
- package/src/lib/plugins/openapi/processors/injectApitogoGatewayServer.ts +30 -0
- package/src/vite/plugin-api.ts +6 -1
- package/src/vite/plugin-config.ts +3 -0
- package/docs/guides/navigation-migration.md +0 -87
|
@@ -1,380 +1,165 @@
|
|
|
1
1
|
---
|
|
2
|
-
title: Configuration
|
|
2
|
+
title: Configuration overview
|
|
3
3
|
sidebar_icon: file-json-2
|
|
4
4
|
description:
|
|
5
|
-
|
|
6
|
-
formats, options, examples, and best practices.
|
|
5
|
+
How APIToGo sites are configured — apitogo.config.json and .env overrides.
|
|
7
6
|
---
|
|
8
7
|
|
|
9
|
-
APIToGo
|
|
10
|
-
and routing for your documentation.
|
|
8
|
+
APIToGo sites are configured primarily with JSON and environment variables:
|
|
11
9
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
| File | Role |
|
|
11
|
+
| --------------------- | --------------------------------------------------------------------- |
|
|
12
|
+
| `apitogo.config.json` | Committed site defaults: site, modules, auth, apis, navigation, theme |
|
|
13
|
+
| `.env` | Client URLs and publish secrets (`APITOGO_CONFIG_*`, `VITE_*`) |
|
|
15
14
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
- `apitogo.config.js`
|
|
19
|
-
- `apitogo.config.jsx`
|
|
20
|
-
- `apitogo.config.mjs`
|
|
15
|
+
For portal fields (plans, auth, backend metadata), see
|
|
16
|
+
**[Site configuration (manifest)](./manifest.md)**.
|
|
21
17
|
|
|
22
|
-
|
|
23
|
-
starting point and can be customized to suit your needs.
|
|
18
|
+
:::note{title="Security"}
|
|
24
19
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
The APIToGo configuration file runs on both client and server at runtime. Avoid including secrets
|
|
28
|
-
directly in your config as they may be exposed to the client.
|
|
20
|
+
Do not put OIDC client secrets, Stripe keys, or other secrets in JSON. Use `.env` with
|
|
21
|
+
`APITOGO_CONFIG_AUTHENTICATION__*` (never commit those values).
|
|
29
22
|
|
|
30
23
|
:::
|
|
31
24
|
|
|
32
|
-
##
|
|
33
|
-
|
|
34
|
-
Below is an example of the default APIToGo configuration. You can edit this configuration to suit
|
|
35
|
-
your own needs.
|
|
36
|
-
|
|
37
|
-
```ts title=apitogo.config.ts
|
|
38
|
-
import type { ApitogoConfig } from "@lukoweb/apitogo";
|
|
39
|
-
|
|
40
|
-
const config: ApitogoConfig = {
|
|
41
|
-
navigation: [
|
|
42
|
-
{
|
|
43
|
-
type: "category",
|
|
44
|
-
label: "Documentation",
|
|
45
|
-
items: ["introduction", "example"],
|
|
46
|
-
},
|
|
47
|
-
{ type: "link", to: "api", label: "API Reference" },
|
|
48
|
-
],
|
|
49
|
-
redirects: [{ from: "/", to: "/docs/introduction" }],
|
|
50
|
-
apis: {
|
|
51
|
-
type: "file",
|
|
52
|
-
input: "./apis/openapi.yaml",
|
|
53
|
-
path: "/api",
|
|
54
|
-
},
|
|
55
|
-
docs: {
|
|
56
|
-
files: "/pages/**/*.{md,mdx}",
|
|
57
|
-
},
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
export default config;
|
|
61
|
-
```
|
|
62
|
-
|
|
63
|
-
## Configuration options
|
|
64
|
-
|
|
65
|
-
### `apis`
|
|
66
|
-
|
|
67
|
-
There are multiple options for referencing your OpenAPI document. The example below uses a URL to an
|
|
68
|
-
OpenAPI document, but you can also use a local file path. For full details on the options available,
|
|
69
|
-
see the [API Reference](./api-reference.md).
|
|
25
|
+
## Minimal example
|
|
70
26
|
|
|
71
|
-
```
|
|
27
|
+
```json title=config.json
|
|
72
28
|
{
|
|
73
|
-
// ...
|
|
74
|
-
"apis": {
|
|
75
|
-
"type": "url",
|
|
76
|
-
"input": "https://petstore3.swagger.io/api/v3/openapi.json",
|
|
77
|
-
"path": "/api"
|
|
78
|
-
}
|
|
79
|
-
// ...
|
|
80
|
-
}
|
|
81
|
-
```
|
|
82
|
-
|
|
83
|
-
### `site`
|
|
84
|
-
|
|
85
|
-
Controls global page attributes across the site, including logos and the site title.
|
|
86
|
-
|
|
87
|
-
**Example:**
|
|
88
|
-
|
|
89
|
-
```ts
|
|
90
|
-
{
|
|
91
|
-
// ...
|
|
92
29
|
"site": {
|
|
93
|
-
"title": "
|
|
30
|
+
"title": "My API",
|
|
94
31
|
"logo": {
|
|
95
|
-
"src": {
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
},
|
|
99
|
-
"width": "99px"
|
|
32
|
+
"src": { "light": "/logo-light.png", "dark": "/logo-dark.png" },
|
|
33
|
+
"alt": "My API",
|
|
34
|
+
"width": "130px"
|
|
100
35
|
}
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
{
|
|
113
|
-
|
|
36
|
+
},
|
|
37
|
+
"authentication": {
|
|
38
|
+
"enabled": true,
|
|
39
|
+
"type": "dev-portal"
|
|
40
|
+
},
|
|
41
|
+
"modules": {
|
|
42
|
+
"docs": { "files": "/pages/**/*.{md,mdx}" },
|
|
43
|
+
"landing": { "enabled": true, "path": "/", "layout": "landing" },
|
|
44
|
+
"userPanel": {
|
|
45
|
+
"enabled": true,
|
|
46
|
+
"dashboard": { "enabled": true },
|
|
47
|
+
"userManagement": { "enabled": true }
|
|
48
|
+
}
|
|
49
|
+
},
|
|
114
50
|
"navigation": [
|
|
115
51
|
{ "type": "category", "label": "Docs", "items": ["introduction"] },
|
|
116
52
|
{ "type": "link", "to": "api", "label": "API Reference" }
|
|
117
|
-
]
|
|
118
|
-
|
|
53
|
+
],
|
|
54
|
+
"redirects": [{ "from": "/", "to": "/introduction" }],
|
|
55
|
+
"apis": [{ "type": "file", "input": "./apis/openapi.yaml", "path": "api" }]
|
|
119
56
|
}
|
|
120
57
|
```
|
|
121
58
|
|
|
122
|
-
|
|
59
|
+
Scaffolded projects and MCP (`create_dev_portal` / `apply_product_intent`) produce this layout. You
|
|
60
|
+
can change the site via MCP tools or by editing files — see [MCP overview](../mcp/overview.md).
|
|
61
|
+
|
|
62
|
+
## Modules vs legacy root keys
|
|
123
63
|
|
|
124
|
-
|
|
125
|
-
reference.
|
|
64
|
+
Prefer `modules.*`:
|
|
126
65
|
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
66
|
+
| Prefer | Legacy (still migrated on load) |
|
|
67
|
+
| ------------------------------ | ------------------------------- |
|
|
68
|
+
| `modules.docs` | root `docs` |
|
|
69
|
+
| `modules.userPanel.apiKeys` | root `apiKeys` |
|
|
70
|
+
| `modules.userPanel.plans.*` | root `plans` / `pricing.enabled` |
|
|
131
71
|
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
72
|
+
## Common options
|
|
73
|
+
|
|
74
|
+
These fields usually live in `apitogo.config.json`.
|
|
75
|
+
|
|
76
|
+
### `apis`
|
|
135
77
|
|
|
136
|
-
|
|
78
|
+
OpenAPI input as a local file or URL. See [API Reference](./api-reference.md).
|
|
137
79
|
|
|
138
|
-
```
|
|
80
|
+
```json
|
|
139
81
|
{
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
"
|
|
144
|
-
"
|
|
145
|
-
},
|
|
146
|
-
"dark": {
|
|
147
|
-
"primary": "316 100% 50%",
|
|
148
|
-
"primaryForeground": "360 100% 100%"
|
|
82
|
+
"apis": [
|
|
83
|
+
{
|
|
84
|
+
"type": "file",
|
|
85
|
+
"input": "./apis/openapi.yaml",
|
|
86
|
+
"path": "api"
|
|
149
87
|
}
|
|
150
|
-
|
|
151
|
-
// ...
|
|
88
|
+
]
|
|
152
89
|
}
|
|
153
90
|
```
|
|
154
91
|
|
|
155
|
-
### `
|
|
92
|
+
### `site`
|
|
156
93
|
|
|
157
|
-
|
|
158
|
-
below.
|
|
94
|
+
Site title and logo (`site.title`, `site.logo`).
|
|
159
95
|
|
|
160
|
-
|
|
96
|
+
### `navigation`
|
|
161
97
|
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
// ...
|
|
165
|
-
"metadata": {
|
|
166
|
-
"title": "Example Website Title",
|
|
167
|
-
"description": "This is an example description for the website.",
|
|
168
|
-
"logo": "https://example.com/logo.png",
|
|
169
|
-
"favicon": "https://example.com/favicon.ico",
|
|
170
|
-
"generator": "Website Generator 1.0",
|
|
171
|
-
"applicationName": "Example App",
|
|
172
|
-
"referrer": "no-referrer",
|
|
173
|
-
"keywords": ["example", "website", "metadata", "SEO"],
|
|
174
|
-
"authors": ["John Doe", "Jane Smith"],
|
|
175
|
-
"creator": "John Doe",
|
|
176
|
-
"publisher": "Example Publisher Inc."
|
|
177
|
-
}
|
|
178
|
-
// ...
|
|
179
|
-
}
|
|
180
|
-
```
|
|
98
|
+
Top bar and sidebar: categories, links, custom pages (custom pages with React elements belong in
|
|
99
|
+
TSX). See [Navigation](./navigation.mdx).
|
|
181
100
|
|
|
182
|
-
### `
|
|
101
|
+
### `theme`
|
|
183
102
|
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
structure in place, or to have it match an existing structure that you already have.
|
|
103
|
+
Light/dark theme tokens and optional `customCss`. See
|
|
104
|
+
[Colors & theme](../customization/colors-theme.mdx).
|
|
187
105
|
|
|
188
|
-
|
|
106
|
+
### `metadata`
|
|
189
107
|
|
|
190
|
-
|
|
191
|
-
{
|
|
192
|
-
// ...
|
|
193
|
-
"docs": {
|
|
194
|
-
"files": "/pages/**/*.{md,mdx}"
|
|
195
|
-
}
|
|
196
|
-
// ...
|
|
197
|
-
}
|
|
198
|
-
```
|
|
108
|
+
HTML metadata (`title`, `favicon`, `description`, etc.).
|
|
199
109
|
|
|
200
|
-
### `
|
|
110
|
+
### `modules.docs`
|
|
201
111
|
|
|
202
|
-
|
|
112
|
+
Docs glob and options (publish Markdown, LLMs, default page options). Prefer this over root `docs`.
|
|
113
|
+
See [Docs module](./docs.md).
|
|
203
114
|
|
|
204
|
-
|
|
115
|
+
### `sitemap`
|
|
116
|
+
|
|
117
|
+
```json
|
|
205
118
|
{
|
|
206
|
-
// ...
|
|
207
119
|
"sitemap": {
|
|
208
|
-
// The base url for your site
|
|
209
|
-
// Required
|
|
210
120
|
"siteUrl": "https://example.com",
|
|
211
|
-
// The change frequency for the pages
|
|
212
|
-
// Defaults to daily
|
|
213
121
|
"changefreq": "daily",
|
|
214
|
-
// The priority for the pages
|
|
215
|
-
// Defaults to 0.7
|
|
216
122
|
"priority": 0.7,
|
|
217
|
-
// The output directory for the sitemap
|
|
218
|
-
// Defaults to undefined
|
|
219
|
-
"outDir": "sitemaps/",
|
|
220
|
-
// Whether to include the last modified date
|
|
221
|
-
// Defaults to true
|
|
222
123
|
"autoLastmod": true,
|
|
223
|
-
|
|
224
|
-
// Can also be a function that returns an array of paths
|
|
225
|
-
// () => Promise<string[]>
|
|
226
|
-
"exclude": ["/404", "/private/page"]
|
|
124
|
+
"exclude": ["/404"]
|
|
227
125
|
}
|
|
228
|
-
// ...
|
|
229
126
|
}
|
|
230
127
|
```
|
|
231
128
|
|
|
232
129
|
### `redirects`
|
|
233
130
|
|
|
234
|
-
|
|
235
|
-
URL.
|
|
236
|
-
|
|
237
|
-
**Example:**
|
|
238
|
-
|
|
239
|
-
```ts
|
|
131
|
+
```json
|
|
240
132
|
{
|
|
241
|
-
// ...
|
|
242
133
|
"redirects": [
|
|
243
|
-
{ "from": "/", "to": "/
|
|
244
|
-
{ "from": "/
|
|
134
|
+
{ "from": "/", "to": "/introduction" },
|
|
135
|
+
{ "from": "/docs", "to": "/introduction" }
|
|
245
136
|
]
|
|
246
|
-
// ...
|
|
247
|
-
}
|
|
248
|
-
```
|
|
249
|
-
|
|
250
|
-
### `port`
|
|
251
|
-
|
|
252
|
-
The port on which the development server will run. Defaults to `3000`. This option can also be
|
|
253
|
-
passed to the CLI as `--port' (which takes precedence).
|
|
254
|
-
|
|
255
|
-
```ts
|
|
256
|
-
{
|
|
257
|
-
"port": 9001
|
|
258
|
-
}
|
|
259
|
-
```
|
|
260
|
-
|
|
261
|
-
If the port is already in use, the next available port will be used.
|
|
262
|
-
|
|
263
|
-
### `basePath`
|
|
264
|
-
|
|
265
|
-
Sets the base path for your documentation site. This is useful when you want to host your
|
|
266
|
-
documentation under a specific path.
|
|
267
|
-
|
|
268
|
-
```ts
|
|
269
|
-
{
|
|
270
|
-
basePath: "/docs",
|
|
271
|
-
// A page defined as `/intro` would result in: https://example.com/docs/intro
|
|
272
|
-
}
|
|
273
|
-
```
|
|
274
|
-
|
|
275
|
-
### `canonicalUrlOrigin`
|
|
276
|
-
|
|
277
|
-
Sets the canonical [origin URL](https://developer.mozilla.org/en-US/docs/Web/API/URL/origin) for
|
|
278
|
-
your documentation site. This is used for SEO purposes and helps search engines understand the
|
|
279
|
-
preferred version of a page.
|
|
280
|
-
|
|
281
|
-
```ts
|
|
282
|
-
{
|
|
283
|
-
basePath: '/docs',
|
|
284
|
-
canonicalUrlOrigin: "https://example.com",
|
|
285
|
-
// visiting the page `/intro` would result in:
|
|
286
|
-
// https://example.com/docs/intro
|
|
287
|
-
}
|
|
288
|
-
```
|
|
289
|
-
|
|
290
|
-
This is the resulting HTML that will be added to the `<head>` of your pages:
|
|
291
|
-
|
|
292
|
-
```html
|
|
293
|
-
<link rel="canonical" href="https://example.com/docs/intro" />
|
|
294
|
-
```
|
|
295
|
-
|
|
296
|
-
### `cdnUrl`
|
|
297
|
-
|
|
298
|
-
Configures the CDN URL for your documentation site's assets. You can provide either a string for a
|
|
299
|
-
single CDN URL or an object to specify different URLs for base and media assets.
|
|
300
|
-
|
|
301
|
-
```ts
|
|
302
|
-
// Single CDN URL
|
|
303
|
-
{
|
|
304
|
-
cdnUrl: "https://cdn.example.com"
|
|
305
|
-
}
|
|
306
|
-
|
|
307
|
-
// Separate URLs for base and media assets
|
|
308
|
-
{
|
|
309
|
-
cdnUrl: {
|
|
310
|
-
base: "https://cdn.example.com",
|
|
311
|
-
media: "https://media.example.com"
|
|
312
|
-
}
|
|
313
137
|
}
|
|
314
138
|
```
|
|
315
139
|
|
|
316
|
-
### `https`
|
|
140
|
+
### `port`, `basePath`, `canonicalUrlOrigin`, `cdnUrl`, `https`
|
|
317
141
|
|
|
318
|
-
|
|
142
|
+
Dev-server and hosting helpers (often in JSON or still settable from a TS config for advanced
|
|
143
|
+
sites):
|
|
319
144
|
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
"ca": "/path/to/ca.pem"
|
|
326
|
-
}
|
|
327
|
-
}
|
|
328
|
-
```
|
|
145
|
+
- `port` — default `3000` (CLI `--port` wins)
|
|
146
|
+
- `basePath` — host under a subpath
|
|
147
|
+
- `canonicalUrlOrigin` — SEO canonical origin
|
|
148
|
+
- `cdnUrl` — string or `{ base, media }`
|
|
149
|
+
- `https` — `{ key, cert, ca? }` for the local HTTPS server
|
|
329
150
|
|
|
330
151
|
### `enableStatusPages`
|
|
331
152
|
|
|
332
|
-
|
|
333
|
-
500.html, etc.) being generated in the `dist` directory. This is useful as many hosting providers
|
|
334
|
-
will serve these files automatically when a user visits a non-existent page or encounters an error.
|
|
335
|
-
|
|
336
|
-
This option is enabled by default, but you can disable it if you don't need these pages.
|
|
337
|
-
|
|
338
|
-
```ts
|
|
339
|
-
{
|
|
340
|
-
enableStatusPages: false;
|
|
341
|
-
}
|
|
342
|
-
```
|
|
343
|
-
|
|
344
|
-
## Multiple Files
|
|
153
|
+
When `true` (default), the build emits static status pages such as `404.html` in `dist`.
|
|
345
154
|
|
|
346
|
-
|
|
347
|
-
multiple files if you prefer. This can be useful if you have a large configuration or want to keep
|
|
348
|
-
your code organized.
|
|
155
|
+
## Navigation
|
|
349
156
|
|
|
350
|
-
|
|
351
|
-
|
|
157
|
+
Put navigation in `apitogo.config.json`, or keep large trees in a separate module (for example
|
|
158
|
+
`sidebar.ts`) and wire them into your site config.
|
|
352
159
|
|
|
353
|
-
|
|
354
|
-
// navigation.ts
|
|
355
|
-
import type { Navigation } from "@lukoweb/apitogo";
|
|
160
|
+
## Related
|
|
356
161
|
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
items: ["example", "other-example"],
|
|
362
|
-
},
|
|
363
|
-
];
|
|
364
|
-
```
|
|
365
|
-
|
|
366
|
-
Then you can import the navigation configuration into your main configuration file.
|
|
367
|
-
|
|
368
|
-
```ts title=apitogo.config.ts
|
|
369
|
-
// apitogo.config.ts
|
|
370
|
-
import type { ApitogoConfig } from "@lukoweb/apitogo";
|
|
371
|
-
import { navigation } from "./navigation";
|
|
372
|
-
|
|
373
|
-
const config = {
|
|
374
|
-
// ...
|
|
375
|
-
navigation,
|
|
376
|
-
// ...
|
|
377
|
-
};
|
|
378
|
-
|
|
379
|
-
export default config;
|
|
380
|
-
```
|
|
162
|
+
- [Manifest (`apitogo.config.json`)](./manifest.md)
|
|
163
|
+
- [Make config (CLI)](./make-config.mdx)
|
|
164
|
+
- [Authentication](./authentication.md)
|
|
165
|
+
- [MCP overview](../mcp/overview.md)
|
|
@@ -25,7 +25,7 @@ We are working on an additional offering that secures this data server-side.
|
|
|
25
25
|
The simplest way to protect routes is to provide an array of path patterns. Users must be
|
|
26
26
|
authenticated to access these routes.
|
|
27
27
|
|
|
28
|
-
```typescript title="
|
|
28
|
+
```typescript title="config"
|
|
29
29
|
{
|
|
30
30
|
// ...
|
|
31
31
|
protectedRoutes: [
|
|
@@ -47,7 +47,7 @@ to access.
|
|
|
47
47
|
For more complex authorization logic, you can provide a record mapping route patterns to custom
|
|
48
48
|
callback functions:
|
|
49
49
|
|
|
50
|
-
```typescript title="
|
|
50
|
+
```typescript title="config"
|
|
51
51
|
{
|
|
52
52
|
// ...
|
|
53
53
|
protectedRoutes: {
|
|
@@ -98,7 +98,7 @@ but lack permission. This is useful for building role-based or attribute-based a
|
|
|
98
98
|
- **`FORBIDDEN`** - The user is authenticated but does not have permission. A 403 "Access Denied"
|
|
99
99
|
page is displayed instead of the route content.
|
|
100
100
|
|
|
101
|
-
```typescript title="
|
|
101
|
+
```typescript title="config"
|
|
102
102
|
{
|
|
103
103
|
// ...
|
|
104
104
|
protectedRoutes: {
|
|
@@ -87,14 +87,15 @@ documentation sites. You can apply for the free DocSearch program or use your ow
|
|
|
87
87
|
npm install @zudoku/plugin-search-algolia
|
|
88
88
|
```
|
|
89
89
|
|
|
90
|
-
|
|
90
|
+
The published package name is still `@zudoku/plugin-search-algolia` (APIToGo Algolia search plugin).
|
|
91
|
+
Add it via the `plugins` array in your site config.
|
|
91
92
|
|
|
92
|
-
|
|
93
|
+
### Configuration
|
|
93
94
|
|
|
94
95
|
```typescript
|
|
95
96
|
import { algoliaSearchPlugin } from "@zudoku/plugin-search-algolia";
|
|
96
97
|
|
|
97
|
-
|
|
98
|
+
export default {
|
|
98
99
|
plugins: [
|
|
99
100
|
algoliaSearchPlugin({
|
|
100
101
|
appId: "YOUR_APP_ID",
|
|
@@ -14,7 +14,7 @@ We offer you to customize the main aspects of your APIToGo site's appearance and
|
|
|
14
14
|
|
|
15
15
|
**Title**, **logo** can be configured in under the `site` property:
|
|
16
16
|
|
|
17
|
-
```tsx title=
|
|
17
|
+
```tsx title=config
|
|
18
18
|
const config = {
|
|
19
19
|
site: {
|
|
20
20
|
title: "My API Documentation",
|
|
@@ -37,7 +37,7 @@ const config = {
|
|
|
37
37
|
|
|
38
38
|
Set the title of your site next to the logo in the header:
|
|
39
39
|
|
|
40
|
-
```tsx title=
|
|
40
|
+
```tsx title=config
|
|
41
41
|
{
|
|
42
42
|
site: {
|
|
43
43
|
title: "My API Documentation",
|
|
@@ -49,7 +49,7 @@ Set the title of your site next to the logo in the header:
|
|
|
49
49
|
|
|
50
50
|
Configure the site's logo with different versions for light and dark themes:
|
|
51
51
|
|
|
52
|
-
```tsx title=
|
|
52
|
+
```tsx title=config
|
|
53
53
|
{
|
|
54
54
|
site: {
|
|
55
55
|
logo: {
|
|
@@ -81,7 +81,7 @@ We allow you to fully customize all colors, borders, etc - read more about it in
|
|
|
81
81
|
|
|
82
82
|
Add a banner message to the top of the page:
|
|
83
83
|
|
|
84
|
-
```tsx title=
|
|
84
|
+
```tsx title=config
|
|
85
85
|
{
|
|
86
86
|
site: {
|
|
87
87
|
banner: {
|
|
@@ -102,7 +102,7 @@ details.
|
|
|
102
102
|
|
|
103
103
|
Here's a comprehensive example showing all available page configuration options:
|
|
104
104
|
|
|
105
|
-
```tsx title=
|
|
105
|
+
```tsx title=config
|
|
106
106
|
{
|
|
107
107
|
site: {
|
|
108
108
|
title: "My API Documentation",
|
|
@@ -11,7 +11,7 @@ They allow you to extend the default layout and functionality without modifying
|
|
|
11
11
|
|
|
12
12
|
## Configuration
|
|
13
13
|
|
|
14
|
-
You can define slots in your `apitogo.config.
|
|
14
|
+
You can define slots in your `apitogo.config.json` file using the `slots` property:
|
|
15
15
|
|
|
16
16
|
```tsx
|
|
17
17
|
import type { ApitogoConfig } from "@lukoweb/apitogo";
|
package/docs/custom-plugins.md
CHANGED
|
@@ -34,7 +34,7 @@ You can manually define colors for both light and dark modes, either by extendin
|
|
|
34
34
|
hex values, RGB, HSL, OKLCH, etc. - basically anything that is supported by
|
|
35
35
|
[Tailwind CSS](https://tailwindcss.com):
|
|
36
36
|
|
|
37
|
-
```ts title=
|
|
37
|
+
```ts title=config
|
|
38
38
|
const config = {
|
|
39
39
|
theme: {
|
|
40
40
|
light: {
|
|
@@ -136,7 +136,7 @@ the great [tweakcn](https://tweakcn.com/) visual theme editor.
|
|
|
136
136
|
<Framed align="start"></Framed>
|
|
137
137
|
|
|
138
138
|
1. Add it to your configuration:
|
|
139
|
-
```ts title=
|
|
139
|
+
```ts title=config
|
|
140
140
|
const config = {
|
|
141
141
|
theme: {
|
|
142
142
|
registryUrl: "https://tweakcn.com/r/themes/northern-lights.json",
|
|
@@ -152,7 +152,7 @@ the great [tweakcn](https://tweakcn.com/) visual theme editor.
|
|
|
152
152
|
|
|
153
153
|
You can still override specific values if needed:
|
|
154
154
|
|
|
155
|
-
```ts title=
|
|
155
|
+
```ts title=config
|
|
156
156
|
const config = {
|
|
157
157
|
theme: {
|
|
158
158
|
registryUrl: "https://tweakcn.com/api/registry/theme/xyz123",
|
|
@@ -169,7 +169,7 @@ const config = {
|
|
|
169
169
|
|
|
170
170
|
Alternatively, you can copy the CSS code and paste it into your `customCss` configuration:
|
|
171
171
|
|
|
172
|
-
```ts title=
|
|
172
|
+
```ts title=config
|
|
173
173
|
const config = {
|
|
174
174
|
theme: {
|
|
175
175
|
customCss: `
|
|
@@ -191,7 +191,7 @@ Changes to `customCss` require restarting the development server to take effect.
|
|
|
191
191
|
|
|
192
192
|
### CSS String
|
|
193
193
|
|
|
194
|
-
```ts title=
|
|
194
|
+
```ts title=config
|
|
195
195
|
const config = {
|
|
196
196
|
theme: {
|
|
197
197
|
customCss: `
|
|
@@ -205,7 +205,7 @@ const config = {
|
|
|
205
205
|
|
|
206
206
|
### CSS Object
|
|
207
207
|
|
|
208
|
-
```ts title=
|
|
208
|
+
```ts title=config
|
|
209
209
|
const config = {
|
|
210
210
|
theme: {
|
|
211
211
|
customCss: {
|
|
@@ -223,7 +223,7 @@ APIToGo comes with a built-in default theme based on
|
|
|
223
223
|
[shadcn/ui zinc base colors](https://ui.shadcn.com/docs/theming#zinc). If you want to start
|
|
224
224
|
completely from scratch without any default styling, you can disable the default theme:
|
|
225
225
|
|
|
226
|
-
```ts title=
|
|
226
|
+
```ts title=config
|
|
227
227
|
const config = {
|
|
228
228
|
theme: {
|
|
229
229
|
noDefaultTheme: true,
|
|
@@ -239,7 +239,7 @@ complete control over your theme. Changing this requires to restart the developm
|
|
|
239
239
|
|
|
240
240
|
Here's a comprehensive example combining multiple theming approaches:
|
|
241
241
|
|
|
242
|
-
```ts title=
|
|
242
|
+
```ts title=config
|
|
243
243
|
const config = {
|
|
244
244
|
theme: {
|
|
245
245
|
// Import base theme from registry
|