@lukoweb/apitogo 0.2.54 → 0.2.57
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 +2196 -1352
- package/dist/declarations/cli/platform/client/platform-api.d.ts +29 -0
- package/dist/declarations/cli/platform/helpers/platform-plan-catalog.d.ts +6 -0
- package/dist/declarations/config/validators/ZudokuConfig.d.ts +2 -0
- package/dist/declarations/lib/authentication/providers/openid.d.ts +2 -1
- package/dist/declarations/lib/plugins/markdown/index.d.ts +2 -1
- package/dist/flat-config.d.ts +1 -0
- package/docs/cli/commands.md +50 -32
- package/docs/cli/go-live.md +66 -93
- package/docs/cli/overview.md +18 -17
- package/docs/cli/setup.md +130 -141
- package/docs/cli/shape.md +94 -11
- package/docs/cli/walkthrough.md +1 -1
- package/docs/components/slot.mdx +116 -119
- package/docs/configuration/api-reference.md +98 -397
- package/docs/configuration/authentication.md +118 -159
- package/docs/configuration/footer.mdx +89 -118
- package/docs/configuration/make-config.mdx +2 -2
- package/docs/configuration/overview.md +97 -166
- package/docs/configuration/plans.md +100 -110
- package/docs/configuration/portal.md +116 -0
- package/docs/customization/colors-theme.mdx +255 -278
- package/docs/customization/fonts.md +105 -110
- package/docs/customization/landing-page.md +189 -188
- package/docs/deploy/apitogo.md +13 -17
- package/docs/deployment.md +15 -9
- package/docs/guides/stripe-setup.mdx +123 -0
- package/docs/markdown/frontmatter.md +172 -173
- package/docs/mcp/go-live.md +100 -100
- package/docs/mcp/overview.md +76 -76
- package/docs/quickstart.md +88 -72
- package/docs/writing.mdx +68 -72
- package/package.json +1 -1
- package/src/config/v2/docs-navigation.ts +7 -2
- package/src/config/v2/index.ts +1 -0
- package/src/config/v2/resolve.ts +28 -0
- package/src/config/v2/rules.ts +32 -1
- package/src/config/v2/schema.ts +9 -0
- package/src/config/v2/services.ts +90 -15
- package/src/config/v2/starter-landing.ts +41 -0
- package/src/config/v2/wrapper.ts +141 -7
- package/src/config/validators/ZudokuConfig.ts +794 -792
- package/src/lib/authentication/providers/openid.tsx +6 -1
- package/src/lib/plugins/markdown/index.tsx +86 -82
- package/src/vite/dev-server.ts +9 -1
- package/src/vite/dev-ssr-config.ts +32 -0
- package/src/vite/plugin-config.ts +4 -2
- package/src/vite/plugin-docs.ts +213 -205
- package/docs/concepts/auth-provider-api-identities.md +0 -105
- package/docs/configuration/ai-assistants.md +0 -65
- package/docs/configuration/api-catalog.md +0 -109
- package/docs/configuration/authentication-auth0.md +0 -181
- package/docs/configuration/authentication-azure-ad.md +0 -245
- package/docs/configuration/authentication-clerk.md +0 -117
- package/docs/configuration/authentication-firebase.md +0 -69
- package/docs/configuration/authentication-pingfederate.md +0 -143
- package/docs/configuration/authentication-supabase.md +0 -233
- package/docs/configuration/build-configuration.mdx +0 -147
- package/docs/configuration/docs.md +0 -282
- package/docs/configuration/llms.md +0 -90
- package/docs/configuration/manifest.md +0 -129
- package/docs/configuration/navigation.mdx +0 -415
- package/docs/configuration/protected-routes.md +0 -150
- package/docs/configuration/search.md +0 -164
- package/docs/configuration/sentry.mdx +0 -44
- package/docs/configuration/site.md +0 -124
- package/docs/configuration/slots.mdx +0 -125
- package/docs/configuration/vite-config.md +0 -18
- package/docs/custom-plugins.md +0 -285
- package/docs/deploy/apache-nginx.md +0 -41
- package/docs/deploy/cloudflare-pages.md +0 -74
- package/docs/deploy/direct-upload.md +0 -17
- package/docs/deploy/github-pages.md +0 -49
- package/docs/deploy/vercel.md +0 -101
- package/docs/extending/events.md +0 -124
- package/docs/guides/environment-variables.md +0 -94
- package/docs/guides/managing-api-keys-and-identities.md +0 -89
- package/docs/guides/navigation-rules.mdx +0 -203
- package/docs/guides/processors.mdx +0 -234
- package/docs/guides/transforming-examples.md +0 -156
- package/docs/guides/using-multiple-apis.md +0 -87
- package/docs/plugins.md +0 -24
|
@@ -1,166 +1,97 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: Configuration overview
|
|
3
|
-
sidebar_icon: file-json-2
|
|
4
|
-
description:
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
TSX). See [Navigation](./navigation.mdx).
|
|
99
|
-
|
|
100
|
-
### `theme`
|
|
101
|
-
|
|
102
|
-
Light/dark theme tokens and optional `customCss`. See
|
|
103
|
-
[Colors & theme](../customization/colors-theme.mdx).
|
|
104
|
-
|
|
105
|
-
### `metadata`
|
|
106
|
-
|
|
107
|
-
HTML metadata (`title`, `favicon`, `description`, etc.).
|
|
108
|
-
|
|
109
|
-
### `modules.docs`
|
|
110
|
-
|
|
111
|
-
Docs glob and options (publish Markdown, LLMs, default page options). Prefer this over root `docs`.
|
|
112
|
-
See [Docs module](./docs.md).
|
|
113
|
-
|
|
114
|
-
### `sitemap`
|
|
115
|
-
|
|
116
|
-
```json
|
|
117
|
-
{
|
|
118
|
-
"sitemap": {
|
|
119
|
-
"siteUrl": "https://example.com",
|
|
120
|
-
"changefreq": "daily",
|
|
121
|
-
"priority": 0.7,
|
|
122
|
-
"autoLastmod": true,
|
|
123
|
-
"exclude": ["/404"]
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
```
|
|
127
|
-
|
|
128
|
-
### `redirects`
|
|
129
|
-
|
|
130
|
-
```json
|
|
131
|
-
{
|
|
132
|
-
"redirects": [
|
|
133
|
-
{ "from": "/", "to": "/introduction" },
|
|
134
|
-
{ "from": "/docs", "to": "/introduction" }
|
|
135
|
-
]
|
|
136
|
-
}
|
|
137
|
-
```
|
|
138
|
-
|
|
139
|
-
### `port`, `basePath`, `canonicalUrlOrigin`, `cdnUrl`, `https`
|
|
140
|
-
|
|
141
|
-
Dev-server and hosting helpers (often in JSON or still settable from a TS config for advanced
|
|
142
|
-
sites):
|
|
143
|
-
|
|
144
|
-
- `port` — default `3000` (CLI `--port` wins)
|
|
145
|
-
- `basePath` — host under a subpath
|
|
146
|
-
- `canonicalUrlOrigin` — SEO canonical origin
|
|
147
|
-
- `cdnUrl` — string or `{ base, media }`
|
|
148
|
-
- `https` — `{ key, cert, ca? }` for the local HTTPS server
|
|
149
|
-
|
|
150
|
-
### `enableStatusPages`
|
|
151
|
-
|
|
152
|
-
When `true` (default), the build emits static status pages such as `404.html` in `dist`.
|
|
153
|
-
|
|
154
|
-
## Navigation
|
|
155
|
-
|
|
156
|
-
Put navigation in `apitogo.config.json`, or keep large trees in a separate module (for example
|
|
157
|
-
`sidebar.ts`) and wire them into your site config.
|
|
158
|
-
|
|
159
|
-
## Related
|
|
160
|
-
|
|
161
|
-
- [Manifest (`apitogo.config.json`)](./manifest.md)
|
|
162
|
-
- [Make config (CLI)](./make-config.mdx) — interactive wizard (`npx apitogo config`)
|
|
163
|
-
- [Gateway plans](./plans.md)
|
|
164
|
-
- [Authentication](./authentication.md)
|
|
165
|
-
- [MCP overview](../mcp/overview.md)
|
|
166
|
-
- [Shape with CLI](../cli/shape.md)
|
|
1
|
+
---
|
|
2
|
+
title: Configuration overview
|
|
3
|
+
sidebar_icon: file-json-2
|
|
4
|
+
description: >-
|
|
5
|
+
One file, apitogo.config.json, describes your API product: the portal, the gateway, sign-in and
|
|
6
|
+
plans. This page shows its sections and where each one is explained.
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
An APItoGo project is described by **`apitogo.config.json`** at the root of your folder. It has one
|
|
10
|
+
section per service. Leave a section out and that service is not part of the project.
|
|
11
|
+
|
|
12
|
+
```json title=apitogo.config.json
|
|
13
|
+
{
|
|
14
|
+
"version": 2,
|
|
15
|
+
"project": { "name": "Books API" },
|
|
16
|
+
"portal": {
|
|
17
|
+
"landing": "apitogo/portal/landing/LandingPage.tsx",
|
|
18
|
+
"footer": "apitogo/portal/footer/Footer.tsx",
|
|
19
|
+
"docs": { "content": ["apitogo/portal/pages/**/*.{md,mdx}"] }
|
|
20
|
+
},
|
|
21
|
+
"gateway": {
|
|
22
|
+
"origin": { "mode": "managed", "source": "server", "runtime": "nodejs" },
|
|
23
|
+
"specs": ["apitogo/apis/openapi.yaml"]
|
|
24
|
+
},
|
|
25
|
+
"identity": {},
|
|
26
|
+
"plans": {}
|
|
27
|
+
}
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
`apitogo create` and `apitogo add` write this file for you, and `apitogo config` changes it. You can
|
|
31
|
+
also edit it by hand: `apitogo check` tells you what is wrong before anything is deployed.
|
|
32
|
+
|
|
33
|
+
## Sections
|
|
34
|
+
|
|
35
|
+
| Section | What it is | Reference |
|
|
36
|
+
| ---------- | -------------------------------------------------------------------------- | ------------------------------ |
|
|
37
|
+
| `version` | Always `2` | |
|
|
38
|
+
| `project` | The project's name, and its id once `apitogo project create` has linked it | [Below](#project) |
|
|
39
|
+
| `portal` | The developer portal: docs pages, home page, footer, logo, theme, console | [Portal](./portal.md) |
|
|
40
|
+
| `gateway` | Your API behind the gateway: where it runs, its OpenAPI files, the rules | [Gateway](./gateway.md) |
|
|
41
|
+
| `identity` | Sign-in for the people who use your portal | [Sign-in](./authentication.md) |
|
|
42
|
+
| `plans` | The plans people pick, and Stripe for the paid ones | [Plans](./plans.md) |
|
|
43
|
+
|
|
44
|
+
The API page of the portal is made from the gateway's OpenAPI files. See
|
|
45
|
+
[API reference](./api-reference.md).
|
|
46
|
+
|
|
47
|
+
## The folder
|
|
48
|
+
|
|
49
|
+
Everything the services use, besides the config, lives in the `apitogo/` folder:
|
|
50
|
+
|
|
51
|
+
```
|
|
52
|
+
apitogo.config.json
|
|
53
|
+
apitogo/
|
|
54
|
+
├─ plans.json the plans (when the project has plans)
|
|
55
|
+
├─ apis/openapi.yaml your OpenAPI file (or wherever gateway.specs points)
|
|
56
|
+
└─ portal/
|
|
57
|
+
├─ pages/ docs pages: Markdown (.md, .mdx) and React (.tsx)
|
|
58
|
+
├─ landing/LandingPage.tsx the home page
|
|
59
|
+
├─ footer/Footer.tsx the footer
|
|
60
|
+
├─ theme.json colors and fonts
|
|
61
|
+
└─ public/ images and files served as they are (logo.svg, ...)
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
`apitogo/.state/` holds what the CLI generates and what it deployed. It ignores itself in git, and
|
|
65
|
+
you never edit it.
|
|
66
|
+
|
|
67
|
+
## project
|
|
68
|
+
|
|
69
|
+
```json
|
|
70
|
+
"project": { "id": "fe3a12b0-fbaf-4315-b37f-b731d930ee57", "name": "Books API" }
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
- `name`: the project's name, used as the portal's name unless `portal.name` says otherwise.
|
|
74
|
+
- `id`: the platform project this folder deploys to. `apitogo project create` writes it, and
|
|
75
|
+
`apitogo project use <id>` moves the folder to another project. See
|
|
76
|
+
[CLI commands](../cli/commands.md).
|
|
77
|
+
|
|
78
|
+
## Secrets
|
|
79
|
+
|
|
80
|
+
The config never holds a secret. Where a service needs one (a Stripe key, an OIDC client secret), it
|
|
81
|
+
names a project secret:
|
|
82
|
+
|
|
83
|
+
```json
|
|
84
|
+
"plans": { "billing": { "apiKey": "secret:STRIPE_API_KEY" } }
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
Store the value with `npx apitogo secrets set STRIPE_API_KEY`. Deploy asks for the secrets it needs
|
|
88
|
+
and stores them for you. A value written straight into the config is refused.
|
|
89
|
+
|
|
90
|
+
## Check before you deploy
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
npx apitogo check
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
`check` reads the config and the files it names, and says what is missing or wrong, with a hint for
|
|
97
|
+
each problem. `deploy` runs the same checks first.
|
|
@@ -1,154 +1,144 @@
|
|
|
1
1
|
---
|
|
2
|
-
title:
|
|
2
|
+
title: Plans
|
|
3
3
|
sidebar_icon: tags
|
|
4
|
-
description:
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
description: >-
|
|
5
|
+
The plans your API's users pick: limits, prices, features and endpoints in apitogo/plans.json, and
|
|
6
|
+
Stripe for the paid ones.
|
|
7
7
|
---
|
|
8
8
|
|
|
9
|
-
**
|
|
9
|
+
**Plans** are what the people who use your API choose: a free tier, a paid tier, a contact-us tier.
|
|
10
|
+
Each one has its own limits, and the gateway enforces them on every call made with that plan's API
|
|
11
|
+
key.
|
|
10
12
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
- **`/account/plans`** — authenticated billing. Sign-in required. Manage and change subscriptions.
|
|
13
|
+
The portal shows them on **`/pricing`** (public) and **`/account/plans`**, where signed-in people
|
|
14
|
+
subscribe, switch and cancel.
|
|
14
15
|
|
|
15
|
-
|
|
16
|
-
select with `npx apitogo deploy --platform-plan`.
|
|
16
|
+
## Turn plans on
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
```json title=apitogo.config.json
|
|
19
|
+
{
|
|
20
|
+
"plans": {}
|
|
21
|
+
}
|
|
22
|
+
```
|
|
21
23
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
is replaced.
|
|
24
|
+
The plans themselves live in **`apitogo/plans.json`**. `apitogo add plans` creates it, and
|
|
25
|
+
`apitogo config` adds plans interactively or with `--plan` (a plan with the same `sku` is replaced):
|
|
25
26
|
|
|
26
27
|
```bash
|
|
27
|
-
npx apitogo config
|
|
28
|
-
# choose plan → enter title, price, policies → done when finished
|
|
29
28
|
npx apitogo config --plan '{"sku":"free","displayName":"Free"}'
|
|
30
29
|
```
|
|
31
30
|
|
|
32
|
-
##
|
|
31
|
+
## plans.json
|
|
33
32
|
|
|
34
|
-
```json
|
|
33
|
+
```json title=apitogo/plans.json
|
|
35
34
|
{
|
|
36
|
-
"
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
"limits": {
|
|
46
|
-
"rateLimit": { "calls": 100, "renewalPeriodSeconds": 60 },
|
|
47
|
-
"quota": { "calls": 50000, "renewalPeriodDays": 30 }
|
|
48
|
-
}
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
"sku": "pro",
|
|
52
|
-
"displayName": "Pro",
|
|
53
|
-
"priceAmount": 29,
|
|
54
|
-
"priceCurrency": "usd",
|
|
55
|
-
"billingPeriod": "month",
|
|
56
|
-
"limits": {
|
|
57
|
-
"rateLimit": { "calls": 1000, "renewalPeriodSeconds": 60 },
|
|
58
|
-
"quota": { "calls": 500000, "renewalPeriodDays": 30 }
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
]
|
|
35
|
+
"version": 1,
|
|
36
|
+
"plans": [
|
|
37
|
+
{
|
|
38
|
+
"sku": "free",
|
|
39
|
+
"displayName": "Free",
|
|
40
|
+
"default": true,
|
|
41
|
+
"limits": {
|
|
42
|
+
"rateLimit": { "calls": 60, "periodSeconds": 60 },
|
|
43
|
+
"quota": { "calls": 1000, "periodDays": 30 }
|
|
62
44
|
}
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"sku": "pro",
|
|
48
|
+
"displayName": "Pro",
|
|
49
|
+
"priceAmount": 19,
|
|
50
|
+
"priceCurrency": "usd",
|
|
51
|
+
"billingInterval": "month",
|
|
52
|
+
"featured": true,
|
|
53
|
+
"limits": { "rateLimit": { "calls": 600, "periodSeconds": 60 } },
|
|
54
|
+
"features": ["Email support", "Usage history"]
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
"sku": "enterprise",
|
|
58
|
+
"displayName": "Enterprise",
|
|
59
|
+
"pricingModel": "custom",
|
|
60
|
+
"priceLabel": "Let's talk"
|
|
63
61
|
}
|
|
64
|
-
|
|
62
|
+
]
|
|
65
63
|
}
|
|
66
64
|
```
|
|
67
65
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
66
|
+
| Field | What it does |
|
|
67
|
+
| ----------------- | -------------------------------------------------------------------------------- |
|
|
68
|
+
| `sku` | The plan's id, unique in the file |
|
|
69
|
+
| `displayName` | The name on the pricing page |
|
|
70
|
+
| `default` | The plan the portal offers first |
|
|
71
|
+
| `limits` | `rateLimit` (`calls` per `periodSeconds`) and `quota` (`calls` per `periodDays`) |
|
|
72
|
+
| `priceAmount` | The price; `0` or left out is free |
|
|
73
|
+
| `priceCurrency` | A currency code such as `usd` or `eur` |
|
|
74
|
+
| `billingInterval` | `month` or `year` |
|
|
75
|
+
| `pricingModel` | `fixed` (default) or `custom` for a contact-us plan |
|
|
76
|
+
| `priceLabel` | The text shown instead of a price, for a contact-us plan |
|
|
77
|
+
| `featured` | Shown as **Popular** |
|
|
78
|
+
| `features` | Extra lines on the plan's card |
|
|
79
|
+
| `includedActions` | The endpoints the plan includes, such as `get:/orders`; left out, all of them |
|
|
80
|
+
| `sortOrder` | The plan's place on the page; by default the file order |
|
|
77
81
|
|
|
78
|
-
|
|
79
|
-
load.
|
|
82
|
+
An unknown field is refused, so a typo never goes unnoticed.
|
|
80
83
|
|
|
81
|
-
##
|
|
84
|
+
## What a pricing card shows
|
|
82
85
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
86
|
+
Each card lists, in this order:
|
|
87
|
+
|
|
88
|
+
1. The limits: `600 requests per minute`, `1,000 requests / month`
|
|
89
|
+
2. The plan's `features`
|
|
90
|
+
3. The endpoints it includes: the ones in `includedActions`, or every operation of the gateway
|
|
91
|
+
|
|
92
|
+
`npx apitogo run` shows the same cards as the deployed portal.
|
|
89
93
|
|
|
90
|
-
|
|
91
|
-
- **quota** — longer-window cap (per 30 days when `renewalPeriodDays` is 30).
|
|
94
|
+
## Paid plans
|
|
92
95
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
[Manifest](./manifest.md).
|
|
96
|
+
A plan with a price is paid through **your own Stripe account**. When the file has one, deploy asks
|
|
97
|
+
for your Stripe secret key, then for the webhook signing secret, and stores both as project secrets.
|
|
98
|
+
[Set up Stripe for paid plans](../guides/stripe-setup.mdx) shows where to find them.
|
|
97
99
|
|
|
98
|
-
|
|
100
|
+
Free and contact-us plans need no Stripe at all.
|
|
99
101
|
|
|
100
|
-
|
|
101
|
-
`priceAmount` at `0` or omit it.
|
|
102
|
+
The `billing` settings are only needed to change the defaults:
|
|
102
103
|
|
|
103
104
|
```json
|
|
104
|
-
{
|
|
105
|
-
"
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
105
|
+
"plans": {
|
|
106
|
+
"billing": {
|
|
107
|
+
"apiKey": "secret:STRIPE_API_KEY",
|
|
108
|
+
"webhookSecret": "secret:STRIPE_WEBHOOK",
|
|
109
|
+
"successUrl": "https://portal.example.com/account/plans",
|
|
110
|
+
"cancelUrl": "https://portal.example.com/pricing"
|
|
111
|
+
}
|
|
109
112
|
}
|
|
110
113
|
```
|
|
111
114
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
don't need an account.
|
|
115
|
+
Selling paid plans needs the **Starter** or **Professional** hosting plan. On **Free**, deploy stops
|
|
116
|
+
at a paid plan and says so.
|
|
115
117
|
|
|
116
|
-
|
|
117
|
-
when none is set. Custom plans can't be subscribed to through checkout. Custom plans are available
|
|
118
|
-
on every platform plan, including Free.
|
|
118
|
+
## Contact-us plans
|
|
119
119
|
|
|
120
|
-
|
|
120
|
+
`"pricingModel": "custom"` makes a plan you price per customer. Its card shows `priceLabel` (or
|
|
121
|
+
**Custom**) and a **Contact sales** button, which opens a public form instead of a checkout. Each
|
|
122
|
+
request is emailed to the project's sales contact, or to its owner.
|
|
121
123
|
|
|
122
|
-
|
|
124
|
+
## Deploy
|
|
123
125
|
|
|
124
126
|
```bash
|
|
125
|
-
npx apitogo deploy
|
|
127
|
+
npx apitogo deploy --only plans
|
|
126
128
|
```
|
|
127
129
|
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
## Platform hosting vs gateway plans
|
|
132
|
-
|
|
133
|
-
| Kind | What it is | How |
|
|
134
|
-
| ----------------------- | ---------------------------------------------- | ------------------------------------ |
|
|
135
|
-
| **Platform hosting** | APItoGo bill for hosting your portal + API hub | `npx apitogo deploy --platform-plan` |
|
|
136
|
-
| **Gateway / API plans** | What your customers pay for API access | `modules.userPanel.plans.items` |
|
|
137
|
-
|
|
138
|
-
### Free platform limitations
|
|
139
|
-
|
|
140
|
-
The **Free** platform plan cannot:
|
|
130
|
+
deploys the plans, their limits on the gateway and the pricing page. A plain `npx apitogo deploy`
|
|
131
|
+
does it together with everything else.
|
|
141
132
|
|
|
142
|
-
|
|
143
|
-
- Attach a **custom domain** to the dev portal
|
|
133
|
+
## Hosting plans are something else
|
|
144
134
|
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
135
|
+
| Kind | What it is | Where |
|
|
136
|
+
| -------------------- | ------------------------------------------------- | ------------------------------- |
|
|
137
|
+
| Your plans | What your users pay you for using your API | `apitogo/plans.json` |
|
|
138
|
+
| APItoGo hosting plan | What you pay APItoGo: Free, Starter, Professional | `apitogo project create --plan` |
|
|
148
139
|
|
|
149
140
|
## Related
|
|
150
141
|
|
|
151
|
-
- [
|
|
152
|
-
- [
|
|
153
|
-
- [
|
|
154
|
-
- [Go live with CLI](../cli/go-live.md)
|
|
142
|
+
- [Set up Stripe for paid plans](../guides/stripe-setup.mdx)
|
|
143
|
+
- [Your customers' account pages](../guides/customer-account.md)
|
|
144
|
+
- [Gateway](./gateway.md)
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Portal
|
|
3
|
+
sidebar_icon: layout-template
|
|
4
|
+
description: >-
|
|
5
|
+
The portal section of apitogo.config.json: docs pages, home page, footer, logo, theme, console,
|
|
6
|
+
search and who may see the portal.
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
The `portal` section is your developer portal: the docs, the API page, the home page and the console
|
|
10
|
+
where people sign in, pick a plan and get API keys.
|
|
11
|
+
|
|
12
|
+
```json title=apitogo.config.json
|
|
13
|
+
{
|
|
14
|
+
"portal": {
|
|
15
|
+
"name": "Books API",
|
|
16
|
+
"docs": { "content": ["apitogo/portal/pages/**/*.{md,mdx}"] },
|
|
17
|
+
"landing": "apitogo/portal/landing/LandingPage.tsx",
|
|
18
|
+
"footer": "apitogo/portal/footer/Footer.tsx",
|
|
19
|
+
"logo": "apitogo/portal/public/logo.svg",
|
|
20
|
+
"theme": "apitogo/portal/theme.json",
|
|
21
|
+
"search": "pagefind",
|
|
22
|
+
"requireAuth": false
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
`"portal": {}` is enough: every setting has a default. `apitogo add portal` writes the section and
|
|
28
|
+
its starter files.
|
|
29
|
+
|
|
30
|
+
## Settings
|
|
31
|
+
|
|
32
|
+
| Setting | Default | What it does |
|
|
33
|
+
| ------------- | ------------------------------------ | --------------------------------------------------------------------------- |
|
|
34
|
+
| `name` | `project.name` | The name in the header and the page titles |
|
|
35
|
+
| `docs` | `apitogo/portal/pages/**/*.{md,mdx}` | Where the docs pages are, or an external docs site ([below](#docs)) |
|
|
36
|
+
| `landing` | none | A React file shown at `/`, the home page |
|
|
37
|
+
| `footer` | none | A React file shown under every page except the console's |
|
|
38
|
+
| `logo` | none (the header shows `name`) | The header logo ([below](#logo)) |
|
|
39
|
+
| `theme` | `apitogo/portal/theme.json` | Colors and fonts ([Colors & theme](../customization/colors-theme.mdx)) |
|
|
40
|
+
| `console` | `{ "enabled": true }` | The sign-in, plans, keys and usage pages, when identity or plans is on |
|
|
41
|
+
| `search` | `pagefind` | `pagefind`, `inkeep` or `none` |
|
|
42
|
+
| `requireAuth` | `false` | Only signed-in people may see the portal ([below](#who-may-see-the-portal)) |
|
|
43
|
+
| `dir` | `apitogo/portal` | The portal's folder, if you keep it somewhere else |
|
|
44
|
+
| `enabled` | `true` | `false` keeps the section but leaves the portal out of deploys |
|
|
45
|
+
|
|
46
|
+
## docs
|
|
47
|
+
|
|
48
|
+
The docs pages are the Markdown and React files in `apitogo/portal/pages/`. Name other places with
|
|
49
|
+
`content` (globs, relative to the config):
|
|
50
|
+
|
|
51
|
+
```json
|
|
52
|
+
"docs": { "content": ["docs/**/*.{md,mdx}", "guides/**/*.md"] }
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
React pages (`.tsx`) in the same folders are found too. The sidebar is built from the files: a
|
|
56
|
+
folder becomes a section, and `order` in a page's frontmatter sorts it. See
|
|
57
|
+
[Writing](../writing.mdx) and [Custom pages](../guides/custom-pages.md) for React pages.
|
|
58
|
+
|
|
59
|
+
If your docs live on another site, link it instead. The portal then has no docs pages of its own:
|
|
60
|
+
|
|
61
|
+
```json
|
|
62
|
+
"docs": { "provider": "external", "url": "https://docs.example.com" }
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## Home page and footer
|
|
66
|
+
|
|
67
|
+
`landing` and `footer` each name a React file in your folder. `apitogo add portal` writes both,
|
|
68
|
+
built from the sections of `@lukoweb/apitogo-module-landing`, and you change them freely. Remove the
|
|
69
|
+
setting to have none. See [Landing page](../customization/landing-page.md) and
|
|
70
|
+
[Footer](./footer.mdx).
|
|
71
|
+
|
|
72
|
+
When there is a home page, `/` shows it, and an `index` page of the docs opens at `/index`.
|
|
73
|
+
|
|
74
|
+
## logo
|
|
75
|
+
|
|
76
|
+
An image in the portal's `public/` folder, or an `https://` address:
|
|
77
|
+
|
|
78
|
+
```json
|
|
79
|
+
"logo": "apitogo/portal/public/logo.svg"
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
One image per color scheme, with the text read out by screen readers:
|
|
83
|
+
|
|
84
|
+
```json
|
|
85
|
+
"logo": {
|
|
86
|
+
"light": "apitogo/portal/public/logo.svg",
|
|
87
|
+
"dark": "apitogo/portal/public/logo-dark.svg",
|
|
88
|
+
"alt": "Books API"
|
|
89
|
+
}
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
`apitogo check` refuses a file that does not exist or is not in `public/`.
|
|
93
|
+
|
|
94
|
+
## Who may see the portal
|
|
95
|
+
|
|
96
|
+
By default everyone may read the docs and the API page. `requireAuth` asks people to sign in first
|
|
97
|
+
(it needs `identity`):
|
|
98
|
+
|
|
99
|
+
```json
|
|
100
|
+
"requireAuth": true
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
Keep some pages public:
|
|
104
|
+
|
|
105
|
+
```json
|
|
106
|
+
"requireAuth": { "exclude": ["/introduction", "/pricing"] }
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
## Console
|
|
110
|
+
|
|
111
|
+
The console pages appear on their own when the project has `identity` (sign-in) or `plans` (pricing,
|
|
112
|
+
API keys, usage). Turn them off with:
|
|
113
|
+
|
|
114
|
+
```json
|
|
115
|
+
"console": { "enabled": false }
|
|
116
|
+
```
|