@lukoweb/apitogo 0.1.121 → 0.1.127
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 +659 -402
- package/dist/declarations/cli/platform/client/platform-api.d.ts +6 -0
- package/dist/declarations/cli/platform/helpers/dev-portal-manifest.d.ts +2 -0
- package/dist/declarations/cli/platform/helpers/publish-preflight.d.ts +2 -0
- package/dist/declarations/cli/platform/tools/gateway.d.ts +6 -0
- package/dist/declarations/config/local-manifest.d.ts +21 -1
- package/dist/declarations/config/validators/ModulesSchema.d.ts +20 -0
- package/dist/declarations/config/validators/ZudokuConfig.d.ts +5 -0
- package/dist/declarations/lib/authentication/auth-header-nav.d.ts +5 -1
- package/dist/declarations/lib/authentication/hook.d.ts +25 -3
- package/dist/declarations/lib/authentication/state.d.ts +39 -3
- package/dist/declarations/lib/plugins/openapi/processors/injectApitogoGatewayServer.d.ts +1 -1
- package/dist/flat-config.d.ts +32 -24
- package/docs/cli/go-live.md +21 -20
- package/docs/components/slot.mdx +2 -2
- package/docs/components.mdx +34 -34
- package/docs/concepts/auth-provider-api-identities.md +2 -2
- package/docs/configuration/authentication.md +16 -14
- package/docs/configuration/build-configuration.mdx +2 -2
- package/docs/configuration/make-config.mdx +5 -5
- package/docs/configuration/manifest.md +8 -14
- package/docs/configuration/navigation.mdx +4 -4
- package/docs/configuration/overview.md +6 -7
- package/docs/configuration/plans.md +45 -16
- package/docs/deploy/vercel.md +3 -4
- package/docs/deployment.md +5 -4
- package/docs/guides/custom-pages.md +2 -2
- package/docs/guides/environment-variables.md +19 -17
- package/docs/guides/managing-api-keys-and-identities.md +10 -18
- package/docs/mcp/go-live.md +12 -12
- package/docs/mcp/overview.md +10 -10
- package/docs/mcp/setup.md +9 -9
- package/docs/mcp/shape.md +4 -3
- package/docs/mcp/tools.md +61 -61
- package/docs/plugins.md +2 -2
- package/docs/quickstart.md +5 -6
- package/package.json +1 -1
- package/src/config/apitogo-config-core.ts +7 -1
- package/src/config/gateway-limits.ts +7 -2
- package/src/config/loader.ts +5 -7
- package/src/config/local-manifest.ts +24 -7
- package/src/config/resolve-modules.ts +5 -7
- package/src/config/validators/ModulesSchema.ts +11 -0
- package/src/lib/authentication/auth-header-nav.ts +3 -3
- package/src/lib/authentication/providers/dev-portal-auth-pages.tsx +2 -5
- package/src/lib/authentication/state.ts +1 -1
- package/src/lib/components/Layout.tsx +1 -4
- package/src/lib/components/SiteTitle.tsx +3 -1
- package/src/lib/plugins/openapi/processors/injectApitogoGatewayServer.ts +9 -3
- package/src/vite/config.ts +0 -21
- package/src/vite/plugin-api.ts +1 -1
- package/src/vite/plugin-modules.ts +1 -2
- package/src/vite/plugin-offroot-resolve.ts +2 -6
|
@@ -3,8 +3,8 @@ title: Authentication
|
|
|
3
3
|
sidebar_icon: shield-check
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
API products on APItoGo use **`dev-portal`** authentication: the static site delegates sign-in to
|
|
7
|
-
provisioned portal API; OIDC client secrets stay on the backend.
|
|
6
|
+
API products on APItoGo use **`dev-portal`** authentication: the static site delegates sign-in to
|
|
7
|
+
the provisioned portal API; OIDC client secrets stay on the backend.
|
|
8
8
|
|
|
9
9
|
For docs-only sites that embed a SPA identity provider directly in the browser, see
|
|
10
10
|
[SPA providers (advanced)](#spa-providers-advanced).
|
|
@@ -24,19 +24,20 @@ Set authentication in `apitogo.config.json` (enabled by default on new scaffolds
|
|
|
24
24
|
}
|
|
25
25
|
```
|
|
26
26
|
|
|
27
|
-
Backend API URL (`npx apitogo deploy` writes this to `.env` after the portal backend is
|
|
27
|
+
Backend API URL (`npx apitogo deploy` writes this to `.env` after the portal backend is
|
|
28
|
+
provisioned):
|
|
28
29
|
|
|
29
30
|
```bash
|
|
30
31
|
VITE_APITOGO_AUTHENTICATION_API_BASE_URL=https://your-dev-portal-api.example.com
|
|
31
32
|
```
|
|
32
33
|
|
|
33
|
-
You do not need to enter this URL in `npx apitogo config`. Or set `authentication.apiBaseUrl` in
|
|
34
|
-
`APITOGO_CONFIG_AUTHENTICATION__API_BASE_URL` in `.env` manually.
|
|
34
|
+
You do not need to enter this URL in `npx apitogo config`. Or set `authentication.apiBaseUrl` in
|
|
35
|
+
JSON / `APITOGO_CONFIG_AUTHENTICATION__API_BASE_URL` in `.env` manually.
|
|
35
36
|
|
|
36
37
|
### Local demo mode
|
|
37
38
|
|
|
38
|
-
In development (`npx apitogo run`), `demoMode` is on by default when the user panel is enabled. You
|
|
39
|
-
not need a backend URL or OIDC to explore account pages. Sign in at `/login` with:
|
|
39
|
+
In development (`npx apitogo run`), `demoMode` is on by default when the user panel is enabled. You
|
|
40
|
+
do not need a backend URL or OIDC to explore account pages. Sign in at `/login` with:
|
|
40
41
|
|
|
41
42
|
```text
|
|
42
43
|
demo@apitogo.local / password
|
|
@@ -51,10 +52,10 @@ unlocks after publish. Docs and API reference stay public. Plans on `/pricing` c
|
|
|
51
52
|
|
|
52
53
|
### Config files
|
|
53
54
|
|
|
54
|
-
| Concern
|
|
55
|
-
|
|
|
56
|
-
| Site, plans, modules, branding, backend
|
|
57
|
-
| OIDC and Stripe for publish
|
|
55
|
+
| Concern | File |
|
|
56
|
+
| --------------------------------------- | ------------------------------------------------------------ |
|
|
57
|
+
| Site, plans, modules, branding, backend | `apitogo.config.json` (+ `.env` — [Manifest](./manifest.md)) |
|
|
58
|
+
| OIDC and Stripe for publish | `.env` via `APITOGO_CONFIG_AUTHENTICATION__*` |
|
|
58
59
|
|
|
59
60
|
### Production OIDC
|
|
60
61
|
|
|
@@ -72,7 +73,8 @@ APITOGO_CONFIG_AUTHENTICATION__STRIPE__SECRET_KEY=sk_test_...
|
|
|
72
73
|
APITOGO_CONFIG_AUTHENTICATION__STRIPE__WEBHOOK_SECRET=whsec_...
|
|
73
74
|
```
|
|
74
75
|
|
|
75
|
-
Stripe is required only when you have **paid** gateway plans. Full flow:
|
|
76
|
+
Stripe is required only when you have **paid** gateway plans. Full flow:
|
|
77
|
+
[MCP go-live](../mcp/go-live.md).
|
|
76
78
|
|
|
77
79
|
Auth mode for end users (`native` | `oidc` | `nativeAndOidc`) is shaped via MCP /
|
|
78
80
|
`update_dev_portal_manifest`.
|
|
@@ -94,8 +96,8 @@ Or in TSX for custom authorization — see [Protected routes](./protected-routes
|
|
|
94
96
|
:::caution{title="Portal products use dev-portal"}
|
|
95
97
|
|
|
96
98
|
SPA providers (Auth0, Clerk, OpenID, Supabase, Azure B2C, Firebase, PingFederate) run the OAuth
|
|
97
|
-
callback in the browser (`/oauth/callback`). Prefer **`dev-portal`** for APItoGo-hosted API
|
|
98
|
-
Use SPA providers only for standalone docs sites that talk to the IdP directly.
|
|
99
|
+
callback in the browser (`/oauth/callback`). Prefer **`dev-portal`** for APItoGo-hosted API
|
|
100
|
+
products. Use SPA providers only for standalone docs sites that talk to the IdP directly.
|
|
99
101
|
|
|
100
102
|
:::
|
|
101
103
|
|
|
@@ -10,8 +10,8 @@ API schemas before they are used in the documentation.
|
|
|
10
10
|
|
|
11
11
|
:::tip{title="Security Note"}
|
|
12
12
|
|
|
13
|
-
Unlike your site config which runs in both client and server environments, `apitogo.build.ts`
|
|
14
|
-
|
|
13
|
+
Unlike your site config which runs in both client and server environments, `apitogo.build.ts` runs
|
|
14
|
+
exclusively in Node.js during build time. This means:
|
|
15
15
|
|
|
16
16
|
- Sensitive operations (like API calls, file system access) can safely be performed
|
|
17
17
|
- No build-time code or data is included in the final client bundle
|
|
@@ -7,11 +7,11 @@ description:
|
|
|
7
7
|
site settings.
|
|
8
8
|
---
|
|
9
9
|
|
|
10
|
-
The **`npx apitogo config`** command writes **`apitogo.config.json`**. It can
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
The **`npx apitogo config`** command writes **`apitogo.config.json`**. It can scaffold a portal
|
|
11
|
+
project (package.json, tsconfig, landing and user-panel stubs, thin `apitogo.config.tsx`) when those
|
|
12
|
+
files are missing, merge **site / theme / authentication** from flags, run an **interactive wizard**
|
|
13
|
+
on a TTY (apply each change immediately), scan `pages/` for navigation, and wire OpenAPI plus an
|
|
14
|
+
**API Reference** link.
|
|
15
15
|
|
|
16
16
|
Landing and user panel are **always enabled** on new configs. **Authentication is enabled by
|
|
17
17
|
default** on new scaffolds. The command does **not** change `redirects`.
|
|
@@ -32,10 +32,7 @@ metadata, with optional `.env` overrides for secrets and local tweaks.
|
|
|
32
32
|
"oidcMetadataUrl": "https://login.example.com/.well-known/openid-configuration",
|
|
33
33
|
"publicRoutes": ["/health"],
|
|
34
34
|
"cors": {
|
|
35
|
-
"allowedOrigins": [
|
|
36
|
-
"https://myapp.example.com",
|
|
37
|
-
"http://localhost:5173"
|
|
38
|
-
]
|
|
35
|
+
"allowedOrigins": ["https://myapp.example.com", "http://localhost:5173"]
|
|
39
36
|
}
|
|
40
37
|
},
|
|
41
38
|
"modules": {
|
|
@@ -80,21 +77,18 @@ when tenant apps or local frontends call the gateway:
|
|
|
80
77
|
{
|
|
81
78
|
"gateway": {
|
|
82
79
|
"cors": {
|
|
83
|
-
"allowedOrigins": [
|
|
84
|
-
"https://myapp.example.com",
|
|
85
|
-
"http://localhost:5173"
|
|
86
|
-
]
|
|
80
|
+
"allowedOrigins": ["https://myapp.example.com", "http://localhost:5173"]
|
|
87
81
|
}
|
|
88
82
|
}
|
|
89
83
|
}
|
|
90
84
|
```
|
|
91
85
|
|
|
92
|
-
| Rule
|
|
93
|
-
|
|
|
94
|
-
| Portal origin
|
|
95
|
-
| Extra origins
|
|
96
|
-
| Wildcard
|
|
97
|
-
| Empty / omitted | Portal playground still works; only extras are missing.
|
|
86
|
+
| Rule | Detail |
|
|
87
|
+
| --------------- | ----------------------------------------------------------------------------------- |
|
|
88
|
+
| Portal origin | Always allowed by the platform (`https://{your-portal-host}`). Do not list it here. |
|
|
89
|
+
| Extra origins | Absolute `http://` or `https://` origins only — no path, query, or fragment. |
|
|
90
|
+
| Wildcard | `"*"` is allowed (replaces the list; credentials stay off). |
|
|
91
|
+
| Empty / omitted | Portal playground still works; only extras are missing. |
|
|
98
92
|
|
|
99
93
|
Apply with `npx apitogo deploy` / `publish_dev_portal` so APIM policies pick up the change.
|
|
100
94
|
|
|
@@ -59,13 +59,13 @@ one of several types. At the simplest level you may only have links and categori
|
|
|
59
59
|
## Generate navigation automatically
|
|
60
60
|
|
|
61
61
|
Use the CLI command **`npx apitogo config`** to merge **`navigation`** from your pages folder into
|
|
62
|
-
`apitogo.config.json`. See **[Make config (CLI)](./make-config.md)** for usage. The command does
|
|
63
|
-
change **`redirects`**.
|
|
62
|
+
`apitogo.config.json`. See **[Make config (CLI)](./make-config.md)** for usage. The command does
|
|
63
|
+
**not** change **`redirects`**.
|
|
64
64
|
|
|
65
65
|
::::caution
|
|
66
66
|
|
|
67
|
-
Without `--force`, `npx apitogo config` only **adds missing** Documentation items. `--force`
|
|
68
|
-
Documentation items from disk but still keeps other nav entries such as API Reference.
|
|
67
|
+
Without `--force`, `npx apitogo config` only **adds missing** Documentation items. `--force`
|
|
68
|
+
rebuilds Documentation items from disk but still keeps other nav entries such as API Reference.
|
|
69
69
|
|
|
70
70
|
::::
|
|
71
71
|
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: Configuration overview
|
|
3
3
|
sidebar_icon: file-json-2
|
|
4
|
-
description:
|
|
5
|
-
How APIToGo sites are configured — apitogo.config.json and .env overrides.
|
|
4
|
+
description: How APIToGo sites are configured — apitogo.config.json and .env overrides.
|
|
6
5
|
---
|
|
7
6
|
|
|
8
7
|
APIToGo sites are configured primarily with JSON and environment variables:
|
|
@@ -63,11 +62,11 @@ can change the site via MCP tools or by editing files — see [MCP overview](../
|
|
|
63
62
|
|
|
64
63
|
Prefer `modules.*`:
|
|
65
64
|
|
|
66
|
-
| Prefer
|
|
67
|
-
|
|
|
68
|
-
| `modules.docs`
|
|
69
|
-
| `modules.userPanel.apiKeys`
|
|
70
|
-
| `modules.userPanel.plans.*`
|
|
65
|
+
| Prefer | Legacy (still migrated on load) |
|
|
66
|
+
| --------------------------- | -------------------------------- |
|
|
67
|
+
| `modules.docs` | root `docs` |
|
|
68
|
+
| `modules.userPanel.apiKeys` | root `apiKeys` |
|
|
69
|
+
| `modules.userPanel.plans.*` | root `plans` / `pricing.enabled` |
|
|
71
70
|
|
|
72
71
|
## Common options
|
|
73
72
|
|
|
@@ -8,7 +8,8 @@ description:
|
|
|
8
8
|
|
|
9
9
|
**Gateway plans** (also called API plans) are what your **end users** subscribe to.
|
|
10
10
|
|
|
11
|
-
- **`/pricing`** — public catalog. Visitors choose a plan before signup. Signed-in users still see
|
|
11
|
+
- **`/pricing`** — public catalog. Visitors choose a plan before signup. Signed-in users still see
|
|
12
|
+
this page; it must not redirect to `/account/plans`.
|
|
12
13
|
- **`/account/plans`** — authenticated billing. Sign-in required. Manage and change subscriptions.
|
|
13
14
|
|
|
14
15
|
They are separate from **platform hosting** (Free / Starter / Professional on APItoGo), which you
|
|
@@ -18,8 +19,9 @@ Store the catalog under `modules.userPanel.plans.items` in `apitogo.config.json`
|
|
|
18
19
|
|
|
19
20
|
## Shape with the CLI
|
|
20
21
|
|
|
21
|
-
`npx apitogo config` can add plans interactively (title, price, rate limit, monthly quota). Each
|
|
22
|
-
written immediately. You can also edit the manifest by hand or use MCP
|
|
22
|
+
`npx apitogo config` can add plans interactively (title, price, rate limit, monthly quota). Each
|
|
23
|
+
plan is written immediately. You can also edit the manifest by hand or use MCP
|
|
24
|
+
`update_dev_portal_manifest`.
|
|
23
25
|
|
|
24
26
|
```bash
|
|
25
27
|
npx apitogo config
|
|
@@ -65,7 +67,12 @@ npx apitogo config
|
|
|
65
67
|
- **`sku`** — stable identifier (used in checkout URLs and gateway sync).
|
|
66
68
|
- **`displayName`** — label on `/pricing`.
|
|
67
69
|
- **`priceAmount`** — `0` for free tiers; greater than zero for paid plans (USD by default).
|
|
68
|
-
- **`
|
|
70
|
+
- **`pricingModel`** — `fixed` (default) or `custom`. See
|
|
71
|
+
[Custom pricing](#custom-pricing-contact-sales).
|
|
72
|
+
- **`priceLabel`** — optional text shown instead of the price, such as `"Let's talk"` (max 64
|
|
73
|
+
characters).
|
|
74
|
+
- **`limits`** — rate limit and quota policies (see below). Encoded `limitsJson` strings are still
|
|
75
|
+
accepted on load.
|
|
69
76
|
|
|
70
77
|
Enable the catalog with `modules.userPanel.plans.enabled: true`. Legacy root `plans` is migrated on
|
|
71
78
|
load.
|
|
@@ -82,10 +89,32 @@ load.
|
|
|
82
89
|
- **rateLimit** — maximum calls per renewal window (per minute when `renewalPeriodSeconds` is 60).
|
|
83
90
|
- **quota** — longer-window cap (per 30 days when `renewalPeriodDays` is 30).
|
|
84
91
|
|
|
85
|
-
New plans include **all** discovered OpenAPI operations unless you set `includedActionKeys`.
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
92
|
+
New plans include **all** discovered OpenAPI operations unless you set `includedActionKeys`. After
|
|
93
|
+
OpenAPI is deployed, you can scope a plan to specific operations with `includedActionKeys` (for
|
|
94
|
+
example `get:/orders/{id}`). Edit those fields in `apitogo.config.json` — see
|
|
95
|
+
[Manifest](./manifest.md).
|
|
96
|
+
|
|
97
|
+
## Custom pricing (contact sales)
|
|
98
|
+
|
|
99
|
+
Set `pricingModel: "custom"` for plans with negotiated prices, such as an Enterprise tier. Leave
|
|
100
|
+
`priceAmount` at `0` or omit it.
|
|
101
|
+
|
|
102
|
+
```json
|
|
103
|
+
{
|
|
104
|
+
"sku": "enterprise",
|
|
105
|
+
"displayName": "Enterprise",
|
|
106
|
+
"pricingModel": "custom",
|
|
107
|
+
"priceLabel": "Let's talk"
|
|
108
|
+
}
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
On `/pricing`, custom plans show `priceLabel` (or **Custom**) and a **Contact sales** button. The
|
|
112
|
+
button opens a public `/contact-sales` form instead of Stripe checkout or registration. Visitors
|
|
113
|
+
don't need an account.
|
|
114
|
+
|
|
115
|
+
Each submission is emailed to the project's **sales contact email**, or to the project owner's email
|
|
116
|
+
when none is set. Custom plans can't be subscribed to through checkout. Custom plans are available
|
|
117
|
+
on every platform plan, including Free.
|
|
89
118
|
|
|
90
119
|
## Publish
|
|
91
120
|
|
|
@@ -95,15 +124,15 @@ Gateway plans are applied when you run:
|
|
|
95
124
|
npx apitogo deploy
|
|
96
125
|
```
|
|
97
126
|
|
|
98
|
-
`npx apitogo deploy` syncs plans from the manifest to the platform gateway. Paid plans require
|
|
99
|
-
secrets in `.env` before publish — see [Go live with CLI](../cli/go-live.md).
|
|
127
|
+
`npx apitogo deploy` syncs plans from the manifest to the platform gateway. Paid plans require
|
|
128
|
+
Stripe secrets in `.env` before publish — see [Go live with CLI](../cli/go-live.md).
|
|
100
129
|
|
|
101
130
|
## Platform hosting vs gateway plans
|
|
102
131
|
|
|
103
|
-
| Kind
|
|
104
|
-
|
|
|
105
|
-
| **Platform hosting**
|
|
106
|
-
| **Gateway / API plans** | What your customers pay for API access
|
|
132
|
+
| Kind | What it is | How |
|
|
133
|
+
| ----------------------- | ---------------------------------------------- | ------------------------------------ |
|
|
134
|
+
| **Platform hosting** | APItoGo bill for hosting your portal + API hub | `npx apitogo deploy --platform-plan` |
|
|
135
|
+
| **Gateway / API plans** | What your customers pay for API access | `modules.userPanel.plans.items` |
|
|
107
136
|
|
|
108
137
|
### Free platform limitations
|
|
109
138
|
|
|
@@ -113,8 +142,8 @@ The **Free** platform plan cannot:
|
|
|
113
142
|
- Attach a **custom domain** to the dev portal
|
|
114
143
|
|
|
115
144
|
Use **Starter** or **Professional** for paid API tiers, Stripe checkout, and custom domains. If your
|
|
116
|
-
manifest has paid plans and you try `npx apitogo deploy --platform-plan free`, deploy is blocked
|
|
117
|
-
upgrade or zero/remove those paid plans.
|
|
145
|
+
manifest has paid plans and you try `npx apitogo deploy --platform-plan free`, deploy is blocked
|
|
146
|
+
until you upgrade or zero/remove those paid plans.
|
|
118
147
|
|
|
119
148
|
## Related
|
|
120
149
|
|
package/docs/deploy/vercel.md
CHANGED
|
@@ -73,10 +73,9 @@ information.
|
|
|
73
73
|
|
|
74
74
|
:::caution{title="Redirects"}
|
|
75
75
|
|
|
76
|
-
If you have redirects in `apitogo.config.json`, you may also need matching entries in
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
information.
|
|
76
|
+
If you have redirects in `apitogo.config.json`, you may also need matching entries in `vercel.json`.
|
|
77
|
+
See the [Vercel Configuration](https://vercel.com/docs/projects/project-configuration#redirects) for
|
|
78
|
+
more information.
|
|
80
79
|
|
|
81
80
|
This is a current limitation. See [#115](https://github.com/lukoweb/apitogo-doc-tool/issues/151).
|
|
82
81
|
|
package/docs/deployment.md
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
# Deployment
|
|
2
2
|
|
|
3
|
-
| Path
|
|
4
|
-
|
|
|
3
|
+
| Path | Docs |
|
|
4
|
+
| ------------------------------ | ------------------------------------ |
|
|
5
5
|
| **CLI** (`npx apitogo deploy`) | [Go live with CLI](./cli/go-live.md) |
|
|
6
|
-
| **MCP / agents**
|
|
6
|
+
| **MCP / agents** | [Go live](./mcp/go-live.md) |
|
|
7
7
|
|
|
8
|
-
Local-only builds: `npx apitogo build` (optional `--preview`). Platform publish is always
|
|
8
|
+
Local-only builds: `npx apitogo build` (optional `--preview`). Platform publish is always
|
|
9
|
+
`npx apitogo deploy`.
|
|
@@ -13,8 +13,8 @@ Start by creating the page you want to add.
|
|
|
13
13
|
|
|
14
14
|
## CLI scaffold
|
|
15
15
|
|
|
16
|
-
`npx apitogo config` can create a starter page under `pages/` and wire it into navigation
|
|
17
|
-
Choose `page` in the wizard loop, then edit the generated `.tsx` file.
|
|
16
|
+
`npx apitogo config` can create a starter page under `pages/` and wire it into navigation
|
|
17
|
+
immediately. Choose `page` in the wizard loop, then edit the generated `.tsx` file.
|
|
18
18
|
|
|
19
19
|
Predefined UI components (Callout, Card, Button, Heading, and more) are documented under
|
|
20
20
|
[/docs/components](/docs/components).
|
|
@@ -8,20 +8,22 @@ APIToGo uses Vite’s [env and mode](https://vite.dev/guide/env-and-mode) model,
|
|
|
8
8
|
|
|
9
9
|
## Portal / publish (`.env`)
|
|
10
10
|
|
|
11
|
-
| Variable
|
|
12
|
-
|
|
|
13
|
-
| `VITE_APITOGO_AUTHENTICATION_API_BASE_URL`
|
|
14
|
-
| `APITOGO_CONFIG_AUTHENTICATION__API_BASE_URL` | Same, via config override
|
|
15
|
-
| `APITOGO_CONFIG_AUTHENTICATION__OIDC__*`
|
|
16
|
-
| `APITOGO_CONFIG_AUTHENTICATION__STRIPE__*`
|
|
17
|
-
| `APITOGO_CONFIG_DEMO_MODE`
|
|
18
|
-
| `APITOGO_CONFIG_SITE__TITLE`
|
|
19
|
-
| `APITOGO_CONFIG_PROJECT_ID`
|
|
20
|
-
|
|
21
|
-
Nested overrides use `__` path segments (SCREAMING_SNAKE). See
|
|
11
|
+
| Variable | Purpose |
|
|
12
|
+
| --------------------------------------------- | ----------------------------------------------- |
|
|
13
|
+
| `VITE_APITOGO_AUTHENTICATION_API_BASE_URL` | Dev-portal API base URL (client) |
|
|
14
|
+
| `APITOGO_CONFIG_AUTHENTICATION__API_BASE_URL` | Same, via config override |
|
|
15
|
+
| `APITOGO_CONFIG_AUTHENTICATION__OIDC__*` | OIDC authority / client id / secret for publish |
|
|
16
|
+
| `APITOGO_CONFIG_AUTHENTICATION__STRIPE__*` | Stripe secret + webhook (paid plans) |
|
|
17
|
+
| `APITOGO_CONFIG_DEMO_MODE` | `false` to disable local demo sign-in |
|
|
18
|
+
| `APITOGO_CONFIG_SITE__TITLE` | Override `site.title` |
|
|
19
|
+
| `APITOGO_CONFIG_PROJECT_ID` | Local project id override |
|
|
20
|
+
|
|
21
|
+
Nested overrides use `__` path segments (SCREAMING_SNAKE). See
|
|
22
|
+
[Manifest](../configuration/manifest.md).
|
|
22
23
|
|
|
23
24
|
**Never commit** OIDC client secrets or Stripe keys. MCP never puts secrets in chat — you write them
|
|
24
|
-
to `.env` before [go-live](../mcp/go-live.md) or `npx apitogo deploy`
|
|
25
|
+
to `.env` before [go-live](../mcp/go-live.md) or `npx apitogo deploy`
|
|
26
|
+
([CLI go-live](../cli/go-live.md)).
|
|
25
27
|
|
|
26
28
|
Example:
|
|
27
29
|
|
|
@@ -83,10 +85,10 @@ interface ImportMeta {
|
|
|
83
85
|
|
|
84
86
|
## MCP host (agent machine)
|
|
85
87
|
|
|
86
|
-
| Variable
|
|
87
|
-
|
|
|
88
|
-
| `APITOGO_API_KEY_ID` / `APITOGO_API_SECRET` | Required for MCP and CLI deploy/status/teardown
|
|
89
|
-
| `APITOGO_DOC_TOOL_PATH`
|
|
90
|
-
| `APITOGO_CLI_PATH`
|
|
88
|
+
| Variable | Purpose |
|
|
89
|
+
| ------------------------------------------- | ------------------------------------------------------------------- |
|
|
90
|
+
| `APITOGO_API_KEY_ID` / `APITOGO_API_SECRET` | Required for MCP and CLI deploy/status/teardown |
|
|
91
|
+
| `APITOGO_DOC_TOOL_PATH` | Optional local doc-tool for scaffold |
|
|
92
|
+
| `APITOGO_CLI_PATH` | Optional local `@lukoweb/apitogo` / doc-tool checkout for MCP spawn |
|
|
91
93
|
|
|
92
94
|
See [MCP overview](../mcp/overview.md) and [CLI overview](../cli/overview.md).
|
|
@@ -21,16 +21,15 @@ For developer portals, enable API keys under **`modules.userPanel.apiKeys`** in
|
|
|
21
21
|
```
|
|
22
22
|
|
|
23
23
|
With MCP, prefer `update_dev_portal_manifest`. Subscription / gateway keys for provisioned portals
|
|
24
|
-
are issued by the APItoGo platform after sign-in; see
|
|
25
|
-
and [MCP go-live](../mcp/go-live.md).
|
|
24
|
+
are issued by the APItoGo platform after sign-in; see
|
|
25
|
+
[Authentication](../configuration/authentication.md) and [MCP go-live](../mcp/go-live.md).
|
|
26
26
|
|
|
27
|
-
Legacy root `apiKeys: { enabled: true }` is still migrated on load into
|
|
28
|
-
`modules.userPanel.apiKeys`.
|
|
27
|
+
Legacy root `apiKeys: { enabled: true }` is still migrated on load into `modules.userPanel.apiKeys`.
|
|
29
28
|
|
|
30
29
|
## Custom API key UI plugin
|
|
31
30
|
|
|
32
|
-
APIToGo includes a UI plugin for managing API consumers and keys (create, view, update, delete).
|
|
33
|
-
|
|
31
|
+
APIToGo includes a UI plugin for managing API consumers and keys (create, view, update, delete). You
|
|
32
|
+
can point it at any backend by implementing callbacks / `ApiKeyService`.
|
|
34
33
|
|
|
35
34
|
Enable and customize from TSX when you need custom create/list logic:
|
|
36
35
|
|
|
@@ -39,13 +38,10 @@ const config = {
|
|
|
39
38
|
apiKeys: {
|
|
40
39
|
enabled: true,
|
|
41
40
|
createKey: async ({ apiKey, context, auth }) => {
|
|
42
|
-
const createApiKeyRequest = new Request(
|
|
43
|
-
"
|
|
44
|
-
{
|
|
45
|
-
|
|
46
|
-
body: JSON.stringify({ apiKey }),
|
|
47
|
-
},
|
|
48
|
-
);
|
|
41
|
+
const createApiKeyRequest = new Request("https://api.example.com/v1/developer/api-key", {
|
|
42
|
+
method: "POST",
|
|
43
|
+
body: JSON.stringify({ apiKey }),
|
|
44
|
+
});
|
|
49
45
|
const signedRequest = await context.signRequest(createApiKeyRequest);
|
|
50
46
|
const response = await fetch(signedRequest);
|
|
51
47
|
if (!response.ok) {
|
|
@@ -66,11 +62,7 @@ enabled.
|
|
|
66
62
|
interface ApiKeyService {
|
|
67
63
|
getConsumers: (context: ApitogoContext) => Promise<ApiConsumer[]>;
|
|
68
64
|
rollKey?: (consumerId: string, context: ApitogoContext) => Promise<void>;
|
|
69
|
-
deleteKey?: (
|
|
70
|
-
consumerId: string,
|
|
71
|
-
keyId: string,
|
|
72
|
-
context: ApitogoContext,
|
|
73
|
-
) => Promise<void>;
|
|
65
|
+
deleteKey?: (consumerId: string, keyId: string, context: ApitogoContext) => Promise<void>;
|
|
74
66
|
updateConsumer?: (
|
|
75
67
|
consumer: { id: string; label?: string },
|
|
76
68
|
context: ApitogoContext,
|
package/docs/mcp/go-live.md
CHANGED
|
@@ -24,8 +24,8 @@ gateway plans, and verifies the live site.
|
|
|
24
24
|
```
|
|
25
25
|
|
|
26
26
|
3. Choose a **platform hosting** plan: **Free**, **Starter**, or **Professional**. Agents should
|
|
27
|
-
call `list_platform_plans` / explain `freeProjectsQuota` before you pick. Starter and
|
|
28
|
-
use Stripe checkout (`checkoutUrl`).
|
|
27
|
+
call `list_platform_plans` / explain `freeProjectsQuota` before you pick. Starter and
|
|
28
|
+
Professional use Stripe checkout (`checkoutUrl`).
|
|
29
29
|
|
|
30
30
|
## Happy path
|
|
31
31
|
|
|
@@ -40,8 +40,8 @@ apply_product_intent({ mode: "goLive", siteDirectory, platformPlan?, ... })
|
|
|
40
40
|
If status is `blocked`, fix the readiness checklist (missing secrets, plan, OpenAPI). Do not invent
|
|
41
41
|
credentials.
|
|
42
42
|
|
|
43
|
-
After success, register **`manualSteps.oidcRedirectUri`** in your IdP. When `stripeRequired` is
|
|
44
|
-
create a Stripe webhook at `manualSteps.stripeWebhookUrl` for the listed events.
|
|
43
|
+
After success, register **`manualSteps.oidcRedirectUri`** in your IdP. When `stripeRequired` is
|
|
44
|
+
true, create a Stripe webhook at `manualSteps.stripeWebhookUrl` for the listed events.
|
|
45
45
|
|
|
46
46
|
Do not treat warm-pool URLs as live until publish / deploy / verify succeed.
|
|
47
47
|
|
|
@@ -69,10 +69,10 @@ shape → deploy_backend → publish_dev_portal(skipBackendRedeploy: true)
|
|
|
69
69
|
|
|
70
70
|
## Platform plan vs API plans
|
|
71
71
|
|
|
72
|
-
| Kind
|
|
73
|
-
|
|
|
74
|
-
| Platform hosting
|
|
75
|
-
| Gateway / API
|
|
72
|
+
| Kind | Meaning | How |
|
|
73
|
+
| ---------------- | ------------------------------------------- | ------------------------- |
|
|
74
|
+
| Platform hosting | Free / Starter / Professional on APItoGo | `ensure_platform_plan` |
|
|
75
|
+
| Gateway / API | End-user SKUs and rate limits on `/pricing` | Manifest / intent `plans` |
|
|
76
76
|
|
|
77
77
|
## Publish behavior
|
|
78
78
|
|
|
@@ -85,10 +85,10 @@ shape → deploy_backend → publish_dev_portal(skipBackendRedeploy: true)
|
|
|
85
85
|
|
|
86
86
|
## CLI deploy vs MCP publish
|
|
87
87
|
|
|
88
|
-
| Path
|
|
89
|
-
|
|
|
90
|
-
| MCP `publish_dev_portal`
|
|
91
|
-
| CLI `npx apitogo deploy`
|
|
88
|
+
| Path | Use when |
|
|
89
|
+
| ------------------------ | --------------------------------------------------- |
|
|
90
|
+
| MCP `publish_dev_portal` | Full product go-live (plans, auth, hosting, verify) |
|
|
91
|
+
| CLI `npx apitogo deploy` | Publish config to platform (apihub + portal) |
|
|
92
92
|
|
|
93
93
|
See [Go live with CLI](../cli/go-live.md).
|
|
94
94
|
|
package/docs/mcp/overview.md
CHANGED
|
@@ -19,17 +19,17 @@ deploy, and go-live. You can use MCP tools, edit site files yourself, or mix bot
|
|
|
19
19
|
**Professional**
|
|
20
20
|
- Deploy backends and sync gateway actions after publish
|
|
21
21
|
|
|
22
|
-
Prefer **`apply_product_intent`** for “create / shape / go live” prompts. See [Shape](./shape.md)
|
|
23
|
-
[Go live](./go-live.md).
|
|
22
|
+
Prefer **`apply_product_intent`** for “create / shape / go live” prompts. See [Shape](./shape.md)
|
|
23
|
+
and [Go live](./go-live.md).
|
|
24
24
|
|
|
25
25
|
## Prerequisites
|
|
26
26
|
|
|
27
27
|
### MCP host environment
|
|
28
28
|
|
|
29
|
-
| Variable
|
|
30
|
-
|
|
|
31
|
-
| `APITOGO_API_KEY_ID`
|
|
32
|
-
| `APITOGO_API_SECRET`
|
|
29
|
+
| Variable | Required | Purpose |
|
|
30
|
+
| -------------------- | -------- | ----------------- |
|
|
31
|
+
| `APITOGO_API_KEY_ID` | Yes | Platform API auth |
|
|
32
|
+
| `APITOGO_API_SECRET` | Yes | Platform API auth |
|
|
33
33
|
|
|
34
34
|
### Agent host
|
|
35
35
|
|
|
@@ -42,10 +42,10 @@ Prefer **`apply_product_intent`** for “create / shape / go live” prompts. Se
|
|
|
42
42
|
|
|
43
43
|
You choose how to edit the portal:
|
|
44
44
|
|
|
45
|
-
| Approach
|
|
46
|
-
|
|
|
47
|
-
| **MCP tools**
|
|
48
|
-
| **Edit files directly** | Full control in your editor — `apitogo.config.json`, `pages/**`, `landing/LandingPage.tsx`, etc.
|
|
45
|
+
| Approach | When it helps |
|
|
46
|
+
| ----------------------- | --------------------------------------------------------------------------------------------------- |
|
|
47
|
+
| **MCP tools** | Agent-driven changes; tools can wire navigation/config and run validation. See [Tools](./tools.md). |
|
|
48
|
+
| **Edit files directly** | Full control in your editor — `apitogo.config.json`, `pages/**`, `landing/LandingPage.tsx`, etc. |
|
|
49
49
|
|
|
50
50
|
Useful MCP tools (optional — not required):
|
|
51
51
|
|
package/docs/mcp/setup.md
CHANGED
|
@@ -18,11 +18,11 @@ server is the same everywhere; only the host config file changes.
|
|
|
18
18
|
|
|
19
19
|
Every host launches the same stdio process:
|
|
20
20
|
|
|
21
|
-
| Field
|
|
22
|
-
|
|
|
23
|
-
| Command
|
|
24
|
-
| Args
|
|
25
|
-
| Env
|
|
21
|
+
| Field | Value |
|
|
22
|
+
| ------- | ------------------------------------------ |
|
|
23
|
+
| Command | `npx` |
|
|
24
|
+
| Args | `-y`, `@lukoweb/apitogo-mcp` |
|
|
25
|
+
| Env | `APITOGO_API_KEY_ID`, `APITOGO_API_SECRET` |
|
|
26
26
|
|
|
27
27
|
Optional env: `APITOGO_API_URL`, `APITOGO_DOC_TOOL_PATH` (local doc-tool for scaffold).
|
|
28
28
|
|
|
@@ -65,10 +65,10 @@ Or project-scoped under `.cursor/skills/apitogo-product`.
|
|
|
65
65
|
|
|
66
66
|
Edit the Claude Desktop MCP config (same `mcpServers` shape as Cursor):
|
|
67
67
|
|
|
68
|
-
| OS | Path
|
|
69
|
-
| ------- |
|
|
70
|
-
| macOS | `~/Library/Application Support/Claude/claude_desktop_config.json`
|
|
71
|
-
| Windows | `%APPDATA%\Claude\claude_desktop_config.json`
|
|
68
|
+
| OS | Path |
|
|
69
|
+
| ------- | ----------------------------------------------------------------- |
|
|
70
|
+
| macOS | `~/Library/Application Support/Claude/claude_desktop_config.json` |
|
|
71
|
+
| Windows | `%APPDATA%\Claude\claude_desktop_config.json` |
|
|
72
72
|
|
|
73
73
|
```json
|
|
74
74
|
{
|
package/docs/mcp/shape.md
CHANGED
|
@@ -53,14 +53,15 @@ Ask only for what is missing:
|
|
|
53
53
|
2. **backend** / **openApi** — source directory and/or OpenAPI path or URL
|
|
54
54
|
3. **plans** — SKUs, prices, rate limits (your choice; not invented)
|
|
55
55
|
4. **auth.mode** — `native` | `oidc` | `nativeAndOidc`
|
|
56
|
-
5. **gatewayPolicies.publicRoutes** — e.g. `/health` (other routes stay subscription-key protected
|
|
57
|
-
default)
|
|
56
|
+
5. **gatewayPolicies.publicRoutes** — e.g. `/health` (other routes stay subscription-key protected
|
|
57
|
+
by default)
|
|
58
58
|
|
|
59
59
|
## Customize after shape
|
|
60
60
|
|
|
61
61
|
Use MCP tools (see [Tools](./tools.md)):
|
|
62
62
|
|
|
63
|
-
- Pages → `add_dev_portal_page` / `update_dev_portal_page` (TSX only; `template`:
|
|
63
|
+
- Pages → `add_dev_portal_page` / `update_dev_portal_page` (TSX only; `template`:
|
|
64
|
+
docs|guide|marketing)
|
|
64
65
|
- OpenAPI → `set_dev_portal_openapi`
|
|
65
66
|
- Plans / branding → `update_dev_portal_manifest`
|
|
66
67
|
- Theme → `set_dev_portal_theme`
|