@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,159 +1,118 @@
1
- ---
2
- title: Authentication
3
- sidebar_icon: shield-check
4
- ---
5
-
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
-
9
- For docs-only sites that embed a SPA identity provider directly in the browser, see
10
- [SPA providers (advanced)](#spa-providers-advanced).
11
-
12
- ## Dev portal (recommended)
13
-
14
- Set authentication in `apitogo.config.json` (enabled by default on new scaffolds):
15
-
16
- ```json
17
- {
18
- "authentication": {
19
- "enabled": true,
20
- "type": "dev-portal",
21
- "redirectToAfterSignIn": "/account/dashboard",
22
- "redirectToAfterSignUp": "/account/dashboard"
23
- }
24
- }
25
- ```
26
-
27
- Backend API URL (`npx apitogo deploy` writes this to `.env` after the portal backend is
28
- provisioned):
29
-
30
- ```bash
31
- VITE_APITOGO_AUTHENTICATION_API_BASE_URL=https://your-dev-portal-api.example.com
32
- ```
33
-
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.
36
-
37
- ### Local demo mode
38
-
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:
41
-
42
- ```text
43
- demo@apitogo.local / password
44
- ```
45
-
46
- Disable with `APITOGO_CONFIG_DEMO_MODE=false` or `"demoMode": false` in JSON. Demo mode is never
47
- active in production builds.
48
-
49
- When demo is off and the backend URL is a placeholder, the account area explains that sign-in
50
- unlocks after publish. Docs and API reference stay public. Plans on `/pricing` come from
51
- `apitogo.config.json` (see [Manifest](./manifest.md)).
52
-
53
- ### Config files
54
-
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__*` |
59
-
60
- ### Production OIDC
61
-
62
- Register one OIDC app with redirect URI `https://{backend}/signin-oidc` (MCP returns
63
- `manualSteps.oidcRedirectUri` after publish). The frontend uses cookie sessions via
64
- `credentials: "include"` on `/api/v1/auth/me`.
65
-
66
- Publish secrets (site `.env`, never commit):
67
-
68
- ```sh
69
- APITOGO_CONFIG_AUTHENTICATION__OIDC__AUTHORITY=https://login.example.com
70
- APITOGO_CONFIG_AUTHENTICATION__OIDC__CLIENT_ID=your-client-id
71
- APITOGO_CONFIG_AUTHENTICATION__OIDC__CLIENT_SECRET=your-client-secret
72
- APITOGO_CONFIG_AUTHENTICATION__STRIPE__SECRET_KEY=sk_test_...
73
- APITOGO_CONFIG_AUTHENTICATION__STRIPE__WEBHOOK_SECRET=whsec_...
74
- ```
75
-
76
- Stripe is required only when you have **paid** gateway plans. Full flow:
77
- [MCP go-live](../mcp/go-live.md).
78
-
79
- Auth mode for end users (`native` | `oidc` | `nativeAndOidc`) is shaped via MCP /
80
- `update_dev_portal_manifest`.
81
-
82
- ## Protected routes
83
-
84
- After authentication is configured, protect routes with patterns or callbacks:
85
-
86
- ```json
87
- {
88
- "protectedRoutes": ["/admin/*", "/settings", "/api/*"]
89
- }
90
- ```
91
-
92
- Or in TSX for custom authorization — see [Protected routes](./protected-routes.md).
93
-
94
- ## SPA providers (advanced)
95
-
96
- :::caution{title="Portal products use dev-portal"}
97
-
98
- SPA providers (Auth0, Clerk, OpenID, Supabase, Azure B2C, Firebase, PingFederate) run the OAuth
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.
101
-
102
- :::
103
-
104
- Configure `authentication` in JSON or TSX. Provider-specific pages:
105
-
106
- - [Auth0](./authentication-auth0.md)
107
- - [Clerk](./authentication-clerk.md)
108
- - [Azure AD / B2C](./authentication-azure-ad.md)
109
- - [PingFederate](./authentication-pingfederate.md)
110
- - [Supabase](./authentication-supabase.md)
111
- - [Firebase](./authentication-firebase.md)
112
-
113
- Typical SPA callback setup:
114
-
115
- - Production: `https://your-site.com/oauth/callback`
116
- - Local: `http://localhost:3000/oauth/callback`
117
- - Add your site hostname to allowed CORS origins in the IdP
118
-
119
- ### Auth0 (SPA example)
120
-
121
- ```ts
122
- authentication: {
123
- type: "auth0",
124
- domain: "yourdomain.us.auth0.com",
125
- clientId: "<your-auth0-clientId>",
126
- scopes: ["openid", "profile", "email"],
127
- }
128
- ```
129
-
130
- ### Clerk (SPA example)
131
-
132
- ```ts
133
- authentication: {
134
- type: "clerk",
135
- clerkPubKey: "<your-clerk-publishable-key>",
136
- jwtTemplateName: "dev-portal", // optional
137
- }
138
- ```
139
-
140
- ### OpenID (SPA example)
141
-
142
- ```ts
143
- authentication: {
144
- type: "openid",
145
- clientId: "<your-client-id>",
146
- issuer: "<the-issuer-url>",
147
- scopes: ["openid", "profile", "email"],
148
- }
149
- ```
150
-
151
- ### Supabase / Azure B2C
152
-
153
- See the provider pages for full options. Default scopes are `openid`, `profile`, and `email` unless
154
- you override them.
155
-
156
- ## User profile fields
157
-
158
- After SPA login, the profile comes from the provider UserInfo endpoint: `name`, `email`, `picture`,
159
- `email_verified`. Missing fields are left blank. Dev-portal sessions use the portal API instead.
1
+ ---
2
+ title: Sign-in
3
+ sidebar_icon: shield-check
4
+ description: >-
5
+ The identity section of apitogo.config.json: how the people who use your portal sign up and sign
6
+ in, with APItoGo's sign-in service or your own OpenID Connect provider.
7
+ ---
8
+
9
+ The `identity` section gives your portal sign-in: accounts, the sign-up and sign-in pages, password
10
+ reset and email verification. The console (plans, API keys, usage) needs it.
11
+
12
+ ```json title=apitogo.config.json
13
+ {
14
+ "identity": {}
15
+ }
16
+ ```
17
+
18
+ `"identity": {}` uses **APItoGo's sign-in service**. `apitogo deploy` sets it up for your project,
19
+ with its own address (`https://id.apitogo.com/<project>`), and connects the portal to it. Nothing
20
+ else is needed.
21
+
22
+ ## Settings
23
+
24
+ | Setting | Default | What it does |
25
+ | -------------------- | --------- | -------------------------------------------------------------------------- |
26
+ | `provider` | `apitogo` | `apitogo` (the hosted sign-in service) or `oidc` (your own provider) |
27
+ | `native` | `true` | People can create an account with an email address and a password |
28
+ | `connections` | none | Sign in with another provider too, such as Microsoft or Google |
29
+ | `providerOptions` | none | Passwords, sign-up, MFA, branding ([below](#provider-options)) |
30
+ | `clients` | none | Extra apps that sign people in with the same accounts |
31
+ | `issuer`, `clientId` | none | With `provider: "oidc"`: your provider's issuer and the portal's client id |
32
+ | `enabled` | `true` | `false` keeps the section but leaves sign-in out of deploys |
33
+
34
+ ## Provider options
35
+
36
+ ```json
37
+ "identity": {
38
+ "providerOptions": {
39
+ "signup": { "mode": "open", "allowedEmailDomains": ["example.com"] },
40
+ "password": { "minLength": 12, "checkBreached": true },
41
+ "mfa": { "mode": "optional" },
42
+ "branding": { "logo": "https://example.com/logo.svg", "color": "#0d9488" }
43
+ }
44
+ }
45
+ ```
46
+
47
+ - `signup.mode`: `open` (anyone), `invite` (people you invite) or `closed` (nobody new).
48
+ `allowedEmailDomains` limits sign-up to those domains.
49
+ - `password`: the shortest password allowed (8 to 128), and whether known-breached passwords are
50
+ refused.
51
+ - `mfa.mode`: `off`, `optional` or `required`.
52
+ - `branding`: the logo and color of the sign-in pages and emails.
53
+ - `customDomain`: a hostname of your own for the sign-in pages, such as `id.example.com`.
54
+
55
+ ## Sign in with another provider
56
+
57
+ Add an OpenID Connect provider next to email and password. Its client secret is a project secret:
58
+
59
+ ```json
60
+ "identity": {
61
+ "connections": [
62
+ {
63
+ "id": "microsoft",
64
+ "type": "oidc",
65
+ "authority": "https://login.microsoftonline.com/<tenant>/v2.0",
66
+ "clientId": "<client id>",
67
+ "clientSecret": "secret:MICROSOFT_CLIENT_SECRET",
68
+ "displayName": "Microsoft"
69
+ }
70
+ ]
71
+ }
72
+ ```
73
+
74
+ ```bash
75
+ npx apitogo secrets set MICROSOFT_CLIENT_SECRET
76
+ ```
77
+
78
+ Set `"native": false` to offer only the connections.
79
+
80
+ ## Your own OpenID Connect provider
81
+
82
+ If your users already have accounts somewhere else, point the portal at that provider instead:
83
+
84
+ ```json
85
+ "identity": {
86
+ "provider": "oidc",
87
+ "issuer": "https://login.example.com",
88
+ "clientId": "portal"
89
+ }
90
+ ```
91
+
92
+ Register the portal in your provider with the redirect address
93
+ `https://<your-portal>/oauth/callback`.
94
+
95
+ ## Use the same sign-in for your API
96
+
97
+ By default the gateway checks API keys. To have it check the signed-in person's token as well, set
98
+ `gateway.auth`:
99
+
100
+ ```json
101
+ "gateway": {
102
+ "auth": { "mode": "identity" }
103
+ }
104
+ ```
105
+
106
+ The API reference's Try it then also offers **Signed-in user**, which sends that token. See
107
+ [Gateway](./gateway.md).
108
+
109
+ ## Local preview
110
+
111
+ `npx apitogo run` before the first deploy has no sign-in service yet. The console then signs in with
112
+ a demo account, so you can try every page:
113
+
114
+ ```text
115
+ demo@apitogo.local / password
116
+ ```
117
+
118
+ The demo account exists only in a local preview, never in a deployed portal.
@@ -1,118 +1,89 @@
1
- ---
2
- sidebar_label: Footer
3
- sidebar_icon: panel-bottom-dashed
4
- description:
5
- Configure the site footer via modules.landing.content.footer in apitogo.config.json, or
6
- site.footer for advanced layouts.
7
- ---
8
-
9
- # Footer Configuration
10
-
11
- Portal sites (MCP / `apitogo init` scaffolds) render a global footer from **`apitogo.config.json`**
12
- → `modules.landing.content.footer`. That footer appears on home, docs, API reference, pricing, and
13
- auth pages, and replaces the default “Built with APIToGo” line.
14
-
15
- ## Recommended: landing content footer (JSON)
16
-
17
- Ask for real link columns, social URLs, copyright, and optional brand/tagline before inventing copy.
18
- Example:
19
-
20
- ```json title=config.json
21
- {
22
- "modules": {
23
- "landing": {
24
- "enabled": true,
25
- "path": "/",
26
- "layout": "landing",
27
- "content": {
28
- "footer": {
29
- "columns": [
30
- {
31
- "title": "Product",
32
- "links": [
33
- { "label": "Features", "href": "/features" },
34
- { "label": "Pricing", "href": "/pricing" },
35
- { "label": "Documentation", "href": "/docs" }
36
- ]
37
- },
38
- {
39
- "title": "Company",
40
- "links": [
41
- { "label": "About", "href": "/about" },
42
- { "label": "Contact", "href": "/contact" }
43
- ]
44
- }
45
- ],
46
- "social": [
47
- { "icon": "github", "href": "https://github.com/your-org" },
48
- { "icon": "linkedin", "href": "https://www.linkedin.com/company/apitogo" }
49
- ],
50
- "copyright": "© 2026 Your Company. All rights reserved."
51
- }
52
- }
53
- }
54
- }
55
- }
56
- ```
57
-
58
- With MCP connected, prefer asking the user for footer content, then editing JSON (there is no
59
- dedicated footer MCP tool). See [MCP overview](../mcp/overview.md).
60
-
61
- ## Advanced: `site.footer` (engine)
62
-
63
- For custom layouts you can still configure `site.footer` (often from TSX when you need dynamic
64
- values):
65
-
66
- ```tsx title=config
67
- export default {
68
- site: {
69
- footer: {
70
- position: "center", // "start" | "center" | "end"
71
- copyright: `© ${new Date().getFullYear()} YourCompany LLC. All rights reserved.`,
72
- columns: [
73
- {
74
- title: "Product",
75
- links: [
76
- { label: "Features", href: "/features" },
77
- { label: "Pricing", href: "/pricing" },
78
- ],
79
- },
80
- ],
81
- social: [
82
- { icon: "github", href: "https://github.com/yourusername" },
83
- { icon: "x", href: "https://x.com/yourhandle", label: "Follow us" },
84
- ],
85
- logo: {
86
- src: { light: "/logo-light.svg", dark: "/logo-dark.svg" },
87
- alt: "Company Logo",
88
- width: "100px",
89
- },
90
- },
91
- },
92
- };
93
- ```
94
-
95
- ### Social icons
96
-
97
- Supported `icon` values include: `reddit`, `discord`, `github`, `x`, `linkedin`, `facebook`,
98
- `instagram`, `youtube`, `tiktok`, `twitch`, `pinterest`, `snapchat`, `whatsapp`, `telegram` — or a
99
- custom React component.
100
-
101
- ## Slots
102
-
103
- Insert content around the footer with `footer-before` and `footer-after` in site config `slots`:
104
-
105
- ```tsx
106
- slots: {
107
- "footer-before": () => (
108
- <div>
109
- <h3>Custom pre-footer content</h3>
110
- </div>
111
- ),
112
- }
113
- ```
114
-
115
- ## Related
116
-
117
- - [Manifest](./manifest.md)
118
- - [Site](./site.md)
1
+ ---
2
+ title: Footer
3
+ sidebar_label: Footer
4
+ sidebar_icon: panel-bottom-dashed
5
+ description: >-
6
+ The portal's footer is a React file you own, named by portal.footer. It shows under every page
7
+ except the console's.
8
+ ---
9
+
10
+ The footer is a React file in your folder, **`apitogo/portal/footer/Footer.tsx`**, named by
11
+ `portal.footer` in `apitogo.config.json`:
12
+
13
+ ```json title=apitogo.config.json
14
+ {
15
+ "portal": {
16
+ "footer": "apitogo/portal/footer/Footer.tsx"
17
+ }
18
+ }
19
+ ```
20
+
21
+ It shows under the home page, the docs, the API reference and the pricing page. It is not shown on
22
+ the console's pages (`/account`, `/login`, `/signup`).
23
+
24
+ `apitogo add portal` writes a starter footer and the setting. Remove `portal.footer` to have no
25
+ footer.
26
+
27
+ ## The starter footer
28
+
29
+ The starter uses `FooterSection` from `@lukoweb/apitogo-module-landing`, so it matches the home
30
+ page. Change anything in it:
31
+
32
+ ```tsx title=apitogo/portal/footer/Footer.tsx
33
+ import { FooterSection } from "@lukoweb/apitogo-module-landing";
34
+
35
+ const NAME = "Books API";
36
+
37
+ export default function Footer() {
38
+ return (
39
+ <FooterSection
40
+ footer={{
41
+ brand: { name: NAME, tagline: "Documentation, API keys and plans for the Books API." },
42
+ columns: [
43
+ {
44
+ title: "Developers",
45
+ links: [
46
+ { label: "Documentation", href: "/introduction" },
47
+ { label: "API Reference", href: "/api" },
48
+ { label: "Pricing", href: "/pricing" },
49
+ ],
50
+ },
51
+ {
52
+ title: "Company",
53
+ links: [{ label: "Contact", href: "mailto:hello@example.com" }],
54
+ },
55
+ ],
56
+ social: [{ icon: "github", href: "https://github.com/example", label: "GitHub" }],
57
+ copyright: `© ${new Date().getFullYear()} ${NAME}`,
58
+ }}
59
+ />
60
+ );
61
+ }
62
+ ```
63
+
64
+ `FooterSection` takes:
65
+
66
+ | Field | What it is |
67
+ | ----------- | --------------------------------------------------------------------------- |
68
+ | `brand` | `name`, an optional `tagline`, and an optional `logoSrc` (an image address) |
69
+ | `columns` | Link columns: a `title` and `links` of `{ label, href }` |
70
+ | `social` | Icon links: `icon` (`github`, `x`), `href` and an optional `label` |
71
+ | `copyright` | The last line; by default `© <year> <name>. All rights reserved.` |
72
+
73
+ ## Your own footer
74
+
75
+ The file can render anything: it is a React component, and its default export is the footer. Use the
76
+ theme's classes (`bg-background`, `text-muted-foreground`, `border-t`) so it follows light and dark
77
+ mode:
78
+
79
+ ```tsx title=apitogo/portal/footer/Footer.tsx
80
+ export default function Footer() {
81
+ return (
82
+ <footer className="border-t bg-background py-8 text-center text-sm text-muted-foreground">
83
+ © {new Date().getFullYear()} Books API · <a href="/pricing">Pricing</a>
84
+ </footer>
85
+ );
86
+ }
87
+ ```
88
+
89
+ `apitogo check` reports a `portal.footer` that names a file that does not exist.
@@ -2,7 +2,7 @@
2
2
  title: Make config (CLI)
3
3
  navigation_label: Make config
4
4
  sidebar_icon: file-cog
5
- description:
5
+ description: >-
6
6
  Change a config version 2 project from the CLI: portal name, API code, OpenAPI files, docs pages
7
7
  and plans.
8
8
  ---
@@ -95,6 +95,6 @@ npx apitogo config --patch '{"portal":{"search":"none"}}'
95
95
 
96
96
  ## See also
97
97
 
98
- - [Manifest (`apitogo.config.json`)](./manifest.md)
98
+ - [Manifest (`apitogo.config.json`)](./overview.md)
99
99
  - [Gateway plans](./plans.md)
100
100
  - [Shape with CLI](../cli/shape.md)