@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.
Files changed (82) hide show
  1. package/dist/cli/cli.js +2196 -1352
  2. package/dist/declarations/cli/platform/client/platform-api.d.ts +29 -0
  3. package/dist/declarations/cli/platform/helpers/platform-plan-catalog.d.ts +6 -0
  4. package/dist/declarations/config/validators/ZudokuConfig.d.ts +2 -0
  5. package/dist/declarations/lib/authentication/providers/openid.d.ts +2 -1
  6. package/dist/declarations/lib/plugins/markdown/index.d.ts +2 -1
  7. package/dist/flat-config.d.ts +1 -0
  8. package/docs/cli/commands.md +50 -32
  9. package/docs/cli/go-live.md +66 -93
  10. package/docs/cli/overview.md +18 -17
  11. package/docs/cli/setup.md +130 -141
  12. package/docs/cli/shape.md +94 -11
  13. package/docs/cli/walkthrough.md +1 -1
  14. package/docs/components/slot.mdx +116 -119
  15. package/docs/configuration/api-reference.md +98 -397
  16. package/docs/configuration/authentication.md +118 -159
  17. package/docs/configuration/footer.mdx +89 -118
  18. package/docs/configuration/make-config.mdx +2 -2
  19. package/docs/configuration/overview.md +97 -166
  20. package/docs/configuration/plans.md +100 -110
  21. package/docs/configuration/portal.md +116 -0
  22. package/docs/customization/colors-theme.mdx +255 -278
  23. package/docs/customization/fonts.md +105 -110
  24. package/docs/customization/landing-page.md +189 -188
  25. package/docs/deploy/apitogo.md +13 -17
  26. package/docs/deployment.md +15 -9
  27. package/docs/guides/stripe-setup.mdx +123 -0
  28. package/docs/markdown/frontmatter.md +172 -173
  29. package/docs/mcp/go-live.md +100 -100
  30. package/docs/mcp/overview.md +76 -76
  31. package/docs/quickstart.md +88 -72
  32. package/docs/writing.mdx +68 -72
  33. package/package.json +1 -1
  34. package/src/config/v2/docs-navigation.ts +7 -2
  35. package/src/config/v2/index.ts +1 -0
  36. package/src/config/v2/resolve.ts +28 -0
  37. package/src/config/v2/rules.ts +32 -1
  38. package/src/config/v2/schema.ts +9 -0
  39. package/src/config/v2/services.ts +90 -15
  40. package/src/config/v2/starter-landing.ts +41 -0
  41. package/src/config/v2/wrapper.ts +141 -7
  42. package/src/config/validators/ZudokuConfig.ts +794 -792
  43. package/src/lib/authentication/providers/openid.tsx +6 -1
  44. package/src/lib/plugins/markdown/index.tsx +86 -82
  45. package/src/vite/dev-server.ts +9 -1
  46. package/src/vite/dev-ssr-config.ts +32 -0
  47. package/src/vite/plugin-config.ts +4 -2
  48. package/src/vite/plugin-docs.ts +213 -205
  49. package/docs/concepts/auth-provider-api-identities.md +0 -105
  50. package/docs/configuration/ai-assistants.md +0 -65
  51. package/docs/configuration/api-catalog.md +0 -109
  52. package/docs/configuration/authentication-auth0.md +0 -181
  53. package/docs/configuration/authentication-azure-ad.md +0 -245
  54. package/docs/configuration/authentication-clerk.md +0 -117
  55. package/docs/configuration/authentication-firebase.md +0 -69
  56. package/docs/configuration/authentication-pingfederate.md +0 -143
  57. package/docs/configuration/authentication-supabase.md +0 -233
  58. package/docs/configuration/build-configuration.mdx +0 -147
  59. package/docs/configuration/docs.md +0 -282
  60. package/docs/configuration/llms.md +0 -90
  61. package/docs/configuration/manifest.md +0 -129
  62. package/docs/configuration/navigation.mdx +0 -415
  63. package/docs/configuration/protected-routes.md +0 -150
  64. package/docs/configuration/search.md +0 -164
  65. package/docs/configuration/sentry.mdx +0 -44
  66. package/docs/configuration/site.md +0 -124
  67. package/docs/configuration/slots.mdx +0 -125
  68. package/docs/configuration/vite-config.md +0 -18
  69. package/docs/custom-plugins.md +0 -285
  70. package/docs/deploy/apache-nginx.md +0 -41
  71. package/docs/deploy/cloudflare-pages.md +0 -74
  72. package/docs/deploy/direct-upload.md +0 -17
  73. package/docs/deploy/github-pages.md +0 -49
  74. package/docs/deploy/vercel.md +0 -101
  75. package/docs/extending/events.md +0 -124
  76. package/docs/guides/environment-variables.md +0 -94
  77. package/docs/guides/managing-api-keys-and-identities.md +0 -89
  78. package/docs/guides/navigation-rules.mdx +0 -203
  79. package/docs/guides/processors.mdx +0 -234
  80. package/docs/guides/transforming-examples.md +0 -156
  81. package/docs/guides/using-multiple-apis.md +0 -87
  82. package/docs/plugins.md +0 -24
@@ -1,110 +1,105 @@
1
- ---
2
- sidebar_icon: baseline
3
- title: Font & Typography
4
- sidebar_label: Font & Typography
5
- description:
6
- Learn how to customize fonts and typography in APIToGo using predefined Google Fonts, custom font
7
- URLs, or local fonts for sans, serif, and monospace text.
8
- ---
9
-
10
- APIToGo allows you to customize fonts for text (`sans`), serif content (`serif`), and code (`mono`).
11
- You can use predefined Google Fonts, external sources, or local fonts.
12
-
13
- ## Predefined Google Fonts
14
-
15
- The easiest way to use fonts is with predefined Google Fonts. Simply specify the font name as a
16
- string:
17
-
18
- ```ts title=config
19
- const config = {
20
- theme: {
21
- fonts: {
22
- sans: "Inter",
23
- serif: "Merriweather",
24
- mono: "JetBrains Mono",
25
- },
26
- },
27
- };
28
- ```
29
-
30
- ### Available Google Fonts
31
-
32
- The following fonts are available as predefined options:
33
-
34
- **Sans Serif:** Inter, Roboto, Open Sans, Poppins, Montserrat, Outfit, Plus Jakarta Sans, DM Sans,
35
- IBM Plex Sans, Geist, Oxanium, Space Grotesk
36
-
37
- **Serif:** Architects Daughter, Merriweather, Playfair Display, Lora, Source Serif Pro, Libre
38
- Baskerville
39
-
40
- **Monospace:** JetBrains Mono, Fira Code, Source Code Pro, IBM Plex Mono, Roboto Mono, Space Mono,
41
- Geist Mono
42
-
43
- ## Custom Font URLs
44
-
45
- For more control or to use fonts not in the predefined list, you can specify a custom font URL:
46
-
47
- ```ts title=config
48
- const config = {
49
- theme: {
50
- fonts: {
51
- sans: {
52
- url: "https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap",
53
- fontFamily: "Roboto, sans-serif",
54
- },
55
- mono: {
56
- url: "https://fonts.googleapis.com/css2?family=Roboto+Mono:wght@400;700&display=swap",
57
- fontFamily: "Roboto Mono, monospace",
58
- },
59
- },
60
- },
61
- };
62
- ```
63
-
64
- ## Local Fonts
65
-
66
- To use local fonts, add them to the `public` folder and create a `fonts.css` file:
67
-
68
- ```css
69
- @font-face {
70
- font-family: "CustomFont";
71
- font-style: normal;
72
- font-weight: 400;
73
- src: url("/custom-font-400.woff2") format("woff2");
74
- }
75
- ```
76
-
77
- Then reference the local CSS file:
78
-
79
- ```ts title=config
80
- const config = {
81
- theme: {
82
- fonts: {
83
- sans: {
84
- url: "/fonts.css",
85
- fontFamily: "CustomFont, sans-serif",
86
- },
87
- },
88
- },
89
- };
90
- ```
91
-
92
- ## Mixed Configuration
93
-
94
- You can mix predefined fonts with custom fonts:
95
-
96
- ```ts title=config
97
- const config = {
98
- theme: {
99
- fonts: {
100
- sans: "Inter", // Predefined Google Font
101
- serif: {
102
- // Custom font
103
- url: "/custom-serif.css",
104
- fontFamily: "CustomSerif, serif",
105
- },
106
- mono: "Fira Code", // Predefined Google Font
107
- },
108
- },
109
- };
110
- ```
1
+ ---
2
+ sidebar_icon: baseline
3
+ title: Font & Typography
4
+ sidebar_label: Font & Typography
5
+ description:
6
+ Learn how to customize fonts and typography in APIToGo using predefined Google Fonts, custom font
7
+ URLs, or local fonts for sans, serif, and monospace text.
8
+ ---
9
+
10
+ APIToGo allows you to customize fonts for text (`sans`), serif content (`serif`), and code (`mono`).
11
+ You can use predefined Google Fonts, external sources, or local fonts.
12
+
13
+ Fonts go under `fonts` in the portal's theme file, **`apitogo/portal/theme.json`**. See
14
+ [Colors & theme](./colors-theme.mdx) for the rest of that file. Local font files go in
15
+ `apitogo/portal/public/`, which the portal serves at `/`.
16
+
17
+ ## Predefined Google Fonts
18
+
19
+ The easiest way to use fonts is with predefined Google Fonts. Simply specify the font name as a
20
+ string:
21
+
22
+ ```json title=apitogo/portal/theme.json
23
+ {
24
+ "fonts": {
25
+ "sans": "Inter",
26
+ "serif": "Merriweather",
27
+ "mono": "JetBrains Mono"
28
+ }
29
+ }
30
+ ```
31
+
32
+ ### Available Google Fonts
33
+
34
+ The following fonts are available as predefined options:
35
+
36
+ **Sans Serif:** Inter, Roboto, Open Sans, Poppins, Montserrat, Outfit, Plus Jakarta Sans, DM Sans,
37
+ IBM Plex Sans, Geist, Oxanium, Space Grotesk
38
+
39
+ **Serif:** Architects Daughter, Merriweather, Playfair Display, Lora, Source Serif Pro, Libre
40
+ Baskerville
41
+
42
+ **Monospace:** JetBrains Mono, Fira Code, Source Code Pro, IBM Plex Mono, Roboto Mono, Space Mono,
43
+ Geist Mono
44
+
45
+ ## Custom Font URLs
46
+
47
+ For more control or to use fonts not in the predefined list, you can specify a custom font URL:
48
+
49
+ ```json title=apitogo/portal/theme.json
50
+ {
51
+ "fonts": {
52
+ "sans": {
53
+ "url": "https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap",
54
+ "fontFamily": "Roboto, sans-serif"
55
+ },
56
+ "mono": {
57
+ "url": "https://fonts.googleapis.com/css2?family=Roboto+Mono:wght@400;700&display=swap",
58
+ "fontFamily": "Roboto Mono, monospace"
59
+ }
60
+ }
61
+ }
62
+ ```
63
+
64
+ ## Local Fonts
65
+
66
+ To use local fonts, add them to the `public` folder and create a `fonts.css` file:
67
+
68
+ ```css
69
+ @font-face {
70
+ font-family: "CustomFont";
71
+ font-style: normal;
72
+ font-weight: 400;
73
+ src: url("/custom-font-400.woff2") format("woff2");
74
+ }
75
+ ```
76
+
77
+ Then reference the local CSS file:
78
+
79
+ ```json title=apitogo/portal/theme.json
80
+ {
81
+ "fonts": {
82
+ "sans": {
83
+ "url": "/fonts.css",
84
+ "fontFamily": "CustomFont, sans-serif"
85
+ }
86
+ }
87
+ }
88
+ ```
89
+
90
+ ## Mixed Configuration
91
+
92
+ You can mix predefined fonts with custom fonts:
93
+
94
+ ```json title=apitogo/portal/theme.json
95
+ {
96
+ "fonts": {
97
+ "sans": "Inter",
98
+ "serif": {
99
+ "url": "/custom-serif.css",
100
+ "fontFamily": "CustomSerif, serif"
101
+ },
102
+ "mono": "Fira Code"
103
+ }
104
+ }
105
+ ```
@@ -1,188 +1,189 @@
1
- ---
2
- sidebar_icon: house
3
- title: Landing Page
4
- description:
5
- Customize your dev portal home page and show your real API operations in the API showcase, loaded
6
- live from your dev portal backend.
7
- ---
8
-
9
- A scaffolded dev portal home page lives in `landing/LandingPage.tsx`. It composes section components
10
- from `@lukoweb/apitogo-module-landing` inside a `LandingShell`:
11
-
12
- | Component | Purpose |
13
- | --------------------- | --------------------------------------------- |
14
- | `HeroSection` | Headline, description, CTAs and code examples |
15
- | `TrustSection` | Logos or social proof |
16
- | `FeaturesSection` | Feature grid |
17
- | `StepsSection` | Numbered "how it works" steps |
18
- | `ApiShowcaseSection` | Grid or method + path list of your API |
19
- | `PlansPreviewSection` | Short plan comparison linking to `/pricing` |
20
- | `PricingCtaSection` | Closing call to action |
21
-
22
- Edit the file directly to add, remove or reorder sections. The site footer is configured separately
23
- in `apitogo.config.json` under `modules.landing.content.footer` (see
24
- [Footer](/docs/configuration/footer)).
25
-
26
- ## API showcase
27
-
28
- `ApiShowcaseSection` renders the items you pass it. The scaffold ships with a **static sample
29
- list**:
30
-
31
- ```tsx
32
- <ApiShowcaseSection
33
- apiShowcase={{
34
- title: "Sample endpoints",
35
- layout: "list", // or "grid"
36
- browseAllHref: "/api",
37
- items: [
38
- { name: "List users", path: "/v1/users", method: "GET", summary: "List paginated users" },
39
- ],
40
- }}
41
- />
42
- ```
43
-
44
- Each item accepts `name`, `path`, and optionally `method`, `summary`, `icon` and `latency`.
45
-
46
- ## Live APIs
47
-
48
- Instead of maintaining the list by hand, you can load your API's real operations. Your dev portal
49
- backend syncs the **gateway actions** of your project (every operation discovered from the OpenAPI
50
- spec you deployed) and serves them publicly at `GET /api/v1/actions`. The `useGatewayActions()` hook
51
- fetches that list; you decide what to show and pass the result to `ApiShowcaseSection`.
52
-
53
- ```tsx
54
- import {
55
- ApiShowcaseSection,
56
- LandingShell,
57
- toApiShowcaseItems,
58
- useGatewayActions,
59
- } from "@lukoweb/apitogo-module-landing";
60
-
61
- const staticItems = [
62
- { name: "List users", path: "/v1/users", method: "GET", summary: "List paginated users" },
63
- ];
64
-
65
- // Optional friendly labels, keyed by action key (`method:path`, lower-case method).
66
- const labels: Record<string, string> = {
67
- "get:/v1/users": "List paginated users",
68
- "post:/v1/orders": "Create an order",
69
- };
70
-
71
- export default function LandingPage() {
72
- const { data } = useGatewayActions({ inPlan: true });
73
-
74
- const liveItems = toApiShowcaseItems(
75
- (data?.actions ?? []).filter((action) => action.path.startsWith("/v1/")).slice(0, 6),
76
- labels,
77
- );
78
-
79
- return (
80
- <LandingShell title="My API">
81
- <ApiShowcaseSection
82
- apiShowcase={{
83
- title: "Our APIs",
84
- layout: "list",
85
- browseAllHref: "/api",
86
- items: liveItems.length > 0 ? liveItems : staticItems,
87
- }}
88
- />
89
- </LandingShell>
90
- );
91
- }
92
- ```
93
-
94
- ### Filters
95
-
96
- `useGatewayActions()` accepts server-side filters. All filters are combined:
97
-
98
- | Option | Type | Description |
99
- | ------------ | --------- | ------------------------------------------------------ |
100
- | `inPlan` | `boolean` | Only actions included in at least one active plan |
101
- | `plan` | `string` | Only actions included in the plan with this SKU |
102
- | `isPublic` | `boolean` | Only actions callable without an API key (or only not) |
103
- | `method` | `string` | HTTP method, e.g. `GET` |
104
- | `pathPrefix` | `string` | Path prefix, e.g. `/v1/orders` |
105
- | `limit` | `number` | Maximum number of actions (server cap: 500) |
106
- | `enabled` | `boolean` | Set to `false` to skip the request |
107
-
108
- Anything else — sorting, renaming, grouping, picking a hand-curated subset — is up to you in plain
109
- TypeScript before you build the items.
110
-
111
- Each action has this shape:
112
-
113
- ```ts
114
- type GatewayAction = {
115
- actionKey: string; // e.g. "get:/orders/{id}"
116
- method: string; // e.g. "GET"
117
- path: string; // e.g. "/orders/{id}"
118
- isPublic: boolean; // callable without an API key
119
- };
120
- ```
121
-
122
- Actions only carry the method and path. Use the `summaries` argument of `toApiShowcaseItems()` (or
123
- your own mapping) to add human-friendly names.
124
-
125
- ### Always keep a fallback
126
-
127
- The hook runs in the browser only, so the prerendered HTML never contains a stale list. `data` is
128
- `undefined`:
129
-
130
- - while the request is loading,
131
- - if the request fails,
132
- - in preview and demo mode, or when no dev portal backend URL is configured (for example in
133
- `npm run dev` before your portal is provisioned).
134
-
135
- `ApiShowcaseSection` renders nothing for an empty list, so pass a static fallback as shown above.
136
-
137
- ### What becomes public
138
-
139
- `GET /api/v1/actions` is anonymous: **every operation in the OpenAPI spec deployed to your gateway
140
- is listable**, including ones you may not document in the portal. Use `inPlan: true` to limit the
141
- list to operations your plans actually sell, and remove internal operations from the spec you deploy
142
- to the gateway if they must not be discoverable.
143
-
144
- ### Freshness and limits
145
-
146
- - The backend syncs actions at startup and on the plan sync interval (15 minutes by default). A new
147
- release shows up after the next sync.
148
- - Responses are cacheable for 5 minutes (`Cache-Control: public, max-age=300`).
149
- - The endpoint is rate limited per client IP (60 requests per minute).
150
-
151
- ### Troubleshooting
152
-
153
- - **The list is always the fallback:** check that `authentication.apiBaseUrl` (or
154
- `VITE_APITOGO_AUTHENTICATION_API_BASE_URL`) points at your dev portal backend and is not the
155
- placeholder URL.
156
- - **CORS errors:** the backend only allows the portal's configured frontend URL. Serving the site
157
- from another domain requires adding it to the backend's allowed origins.
158
- - **Empty list on a new portal:** the portal is not activated yet, or the gateway has no release.
159
- Deploy your backend, then wait for the next sync.
160
-
161
- ## Plans preview
162
-
163
- `PlansPreviewSection` shows the same plans as `/pricing`. The scaffold loads them with the
164
- `usePlansPreview` hook from the billing plugin, so you only maintain plans in one place —
165
- `modules.userPanel.plans.items` in `apitogo.config.json`:
166
-
167
- ```tsx
168
- import { usePlansPreview } from "@lukoweb/apitogo-plugin-dev-portal-billing";
169
-
170
- export default function LandingPage() {
171
- const plans = usePlansPreview();
172
-
173
- return (
174
- <LandingShell title="…">
175
- {/* … */}
176
- <PlansPreviewSection plans={plans} />
177
- </LandingShell>
178
- );
179
- }
180
- ```
181
-
182
- In a live portal the plans come from your dev portal backend (`GET /api/v1/plans`); in local
183
- preview, and while the live catalog loads, they come from `apitogo.config.json`. Each card shows the
184
- plan's `displayName`, price and billing period, and its first two feature lines (`features`, or
185
- lines derived from `limits`). The highlighted card matches the "Popular" plan on `/pricing`.
186
-
187
- To write the cards by hand instead, pass a static array of `{ name, price, unit, blurb, featured }`
188
- objects to `plans`.
1
+ ---
2
+ sidebar_icon: house
3
+ title: Landing Page
4
+ description:
5
+ Customize your dev portal home page and show your real API operations in the API showcase, loaded
6
+ live from your dev portal backend.
7
+ ---
8
+
9
+ The portal's home page is a React file: `apitogo/portal/landing/LandingPage.tsx`, named by
10
+ `portal.landing` in `apitogo.config.json`. `apitogo add portal` writes a starter one (or
11
+ `apitogo create --template full`). It composes section components from
12
+ `@lukoweb/apitogo-module-landing` inside a `LandingShell`:
13
+
14
+ | Component | Purpose |
15
+ | --------------------- | --------------------------------------------- |
16
+ | `HeroSection` | Headline, description, CTAs and code examples |
17
+ | `TrustSection` | Logos or social proof |
18
+ | `FeaturesSection` | Feature grid |
19
+ | `StepsSection` | Numbered "how it works" steps |
20
+ | `ApiShowcaseSection` | Grid or method + path list of your API |
21
+ | `PlansPreviewSection` | Short plan comparison linking to `/pricing` |
22
+ | `PricingCtaSection` | Closing call to action |
23
+
24
+ Edit the file directly to add, remove or reorder sections. Remove `portal.landing` from the config
25
+ to have no home page: `/` then opens the first docs page. The footer is a file of its own (see
26
+ [Footer](../configuration/footer.mdx)).
27
+
28
+ ## API showcase
29
+
30
+ `ApiShowcaseSection` renders the items you pass it. The scaffold ships with a **static sample
31
+ list**:
32
+
33
+ ```tsx
34
+ <ApiShowcaseSection
35
+ apiShowcase={{
36
+ title: "Sample endpoints",
37
+ layout: "list", // or "grid"
38
+ browseAllHref: "/api",
39
+ items: [
40
+ { name: "List users", path: "/v1/users", method: "GET", summary: "List paginated users" },
41
+ ],
42
+ }}
43
+ />
44
+ ```
45
+
46
+ Each item accepts `name`, `path`, and optionally `method`, `summary`, `icon` and `latency`.
47
+
48
+ ## Live APIs
49
+
50
+ Instead of maintaining the list by hand, you can load your API's real operations. Your dev portal
51
+ backend syncs the **gateway actions** of your project (every operation discovered from the OpenAPI
52
+ spec you deployed) and serves them publicly at `GET /api/v1/actions`. The `useGatewayActions()` hook
53
+ fetches that list; you decide what to show and pass the result to `ApiShowcaseSection`.
54
+
55
+ ```tsx
56
+ import {
57
+ ApiShowcaseSection,
58
+ LandingShell,
59
+ toApiShowcaseItems,
60
+ useGatewayActions,
61
+ } from "@lukoweb/apitogo-module-landing";
62
+
63
+ const staticItems = [
64
+ { name: "List users", path: "/v1/users", method: "GET", summary: "List paginated users" },
65
+ ];
66
+
67
+ // Optional friendly labels, keyed by action key (`method:path`, lower-case method).
68
+ const labels: Record<string, string> = {
69
+ "get:/v1/users": "List paginated users",
70
+ "post:/v1/orders": "Create an order",
71
+ };
72
+
73
+ export default function LandingPage() {
74
+ const { data } = useGatewayActions({ inPlan: true });
75
+
76
+ const liveItems = toApiShowcaseItems(
77
+ (data?.actions ?? []).filter((action) => action.path.startsWith("/v1/")).slice(0, 6),
78
+ labels,
79
+ );
80
+
81
+ return (
82
+ <LandingShell title="My API">
83
+ <ApiShowcaseSection
84
+ apiShowcase={{
85
+ title: "Our APIs",
86
+ layout: "list",
87
+ browseAllHref: "/api",
88
+ items: liveItems.length > 0 ? liveItems : staticItems,
89
+ }}
90
+ />
91
+ </LandingShell>
92
+ );
93
+ }
94
+ ```
95
+
96
+ ### Filters
97
+
98
+ `useGatewayActions()` accepts server-side filters. All filters are combined:
99
+
100
+ | Option | Type | Description |
101
+ | ------------ | --------- | ------------------------------------------------------ |
102
+ | `inPlan` | `boolean` | Only actions included in at least one active plan |
103
+ | `plan` | `string` | Only actions included in the plan with this SKU |
104
+ | `isPublic` | `boolean` | Only actions callable without an API key (or only not) |
105
+ | `method` | `string` | HTTP method, e.g. `GET` |
106
+ | `pathPrefix` | `string` | Path prefix, e.g. `/v1/orders` |
107
+ | `limit` | `number` | Maximum number of actions (server cap: 500) |
108
+ | `enabled` | `boolean` | Set to `false` to skip the request |
109
+
110
+ Anything else — sorting, renaming, grouping, picking a hand-curated subset — is up to you in plain
111
+ TypeScript before you build the items.
112
+
113
+ Each action has this shape:
114
+
115
+ ```ts
116
+ type GatewayAction = {
117
+ actionKey: string; // e.g. "get:/orders/{id}"
118
+ method: string; // e.g. "GET"
119
+ path: string; // e.g. "/orders/{id}"
120
+ isPublic: boolean; // callable without an API key
121
+ };
122
+ ```
123
+
124
+ Actions only carry the method and path. Use the `summaries` argument of `toApiShowcaseItems()` (or
125
+ your own mapping) to add human-friendly names.
126
+
127
+ ### Always keep a fallback
128
+
129
+ The hook runs in the browser only, so the prerendered HTML never contains a stale list. `data` is
130
+ `undefined`:
131
+
132
+ - while the request is loading,
133
+ - if the request fails,
134
+ - in preview and demo mode, or when no dev portal backend URL is configured (for example in
135
+ `npm run dev` before your portal is provisioned).
136
+
137
+ `ApiShowcaseSection` renders nothing for an empty list, so pass a static fallback as shown above.
138
+
139
+ ### What becomes public
140
+
141
+ `GET /api/v1/actions` is anonymous: **every operation in the OpenAPI spec deployed to your gateway
142
+ is listable**, including ones you may not document in the portal. Use `inPlan: true` to limit the
143
+ list to operations your plans actually sell, and remove internal operations from the spec you deploy
144
+ to the gateway if they must not be discoverable.
145
+
146
+ ### Freshness and limits
147
+
148
+ - The backend syncs actions at startup and on the plan sync interval (15 minutes by default). A new
149
+ release shows up after the next sync.
150
+ - Responses are cacheable for 5 minutes (`Cache-Control: public, max-age=300`).
151
+ - The endpoint is rate limited per client IP (60 requests per minute).
152
+
153
+ ### Troubleshooting
154
+
155
+ - **The list is always the fallback:** the project has no plans backend yet. Add `plans` to the
156
+ config and run `npx apitogo deploy`.
157
+ - **CORS errors:** the backend only allows the portal's configured frontend URL. Serving the site
158
+ from another domain requires adding it to the backend's allowed origins.
159
+ - **Empty list on a new portal:** the portal is not activated yet, or the gateway has no release.
160
+ Deploy your backend, then wait for the next sync.
161
+
162
+ ## Plans preview
163
+
164
+ `PlansPreviewSection` shows the same plans as `/pricing`. The scaffold loads them with the
165
+ `usePlansPreview` hook from the billing plugin, so you only maintain plans in one place,
166
+ `apitogo/plans.json`:
167
+
168
+ ```tsx
169
+ import { usePlansPreview } from "@lukoweb/apitogo-plugin-dev-portal-billing";
170
+
171
+ export default function LandingPage() {
172
+ const plans = usePlansPreview();
173
+
174
+ return (
175
+ <LandingShell title="…">
176
+ {/* … */}
177
+ <PlansPreviewSection plans={plans} />
178
+ </LandingShell>
179
+ );
180
+ }
181
+ ```
182
+
183
+ In a live portal the plans come from your dev portal backend (`GET /api/v1/plans`); in local
184
+ preview, and while the live catalog loads, they come from `apitogo/plans.json`. Each card shows the
185
+ plan's `displayName`, price and billing period, and its first two feature lines (`features`, or
186
+ lines derived from `limits`). The highlighted card matches the "Popular" plan on `/pricing`.
187
+
188
+ To write the cards by hand instead, pass a static array of `{ name, price, unit, blurb, featured }`
189
+ objects to `plans`.
@@ -1,17 +1,13 @@
1
- # Deploy with APIToGo CLI
2
-
3
- Platform publish is **`npx apitogo deploy`** — the same engine as MCP `publish_dev_portal`.
4
-
5
- Full walkthrough (prerequisites, secrets, `--only`, status, teardown):
6
-
7
- → **[Go live with CLI](../cli/go-live.md)**
8
-
9
- Quick reference:
10
-
11
- ```bash
12
- export APITOGO_API_KEY_ID=apk_...
13
- export APITOGO_API_SECRET=...
14
- cd ./dev-portal
15
- npx apitogo deploy --platform-plan free
16
- npx apitogo status
17
- ```
1
+ # Deploy with the APItoGo CLI
2
+
3
+ ```bash
4
+ npx apitogo login
5
+ npx apitogo deploy
6
+ npx apitogo status
7
+ ```
8
+
9
+ `deploy` creates the project on its first run, then sets up every service in `apitogo.config.json`.
10
+ `--only portal` (or `gateway`, `identity`, `plans`) deploys one of them.
11
+
12
+ Full walkthrough (sign-in, secrets, `--only`, status, teardown):
13
+ **[Go live with CLI](../cli/go-live.md)**.