@lukoweb/apitogo 0.1.121 → 0.1.126
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/LICENSE.md +18 -0
- package/dist/cli/cli.js +606 -396
- package/dist/declarations/config/local-manifest.d.ts +1 -1
- 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/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 +19 -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 +10 -155
- package/src/config/apitogo-config-core.ts +5 -1
- package/src/config/gateway-limits.ts +7 -2
- package/src/config/loader.ts +5 -7
- package/src/config/local-manifest.ts +7 -7
- package/src/config/resolve-modules.ts +5 -7
- 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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import { type GatewayLimits } from "./gateway-limits.js";
|
|
3
2
|
import { APITOGO_CONFIG_FILENAME } from "./apitogo-config-loader.js";
|
|
3
|
+
import { type GatewayLimits } from "./gateway-limits.js";
|
|
4
4
|
import { type LandingManifestInput } from "./landing-manifest.js";
|
|
5
5
|
export declare const APITOGO_MANIFEST_BASE_FILENAME = "apitogo.json";
|
|
6
6
|
export declare const APITOGO_MANIFEST_ENV_FILES: {
|
|
@@ -7,4 +7,8 @@ export declare const LOGIN_HEADER_NAV_ITEM: {
|
|
|
7
7
|
display: "anon";
|
|
8
8
|
};
|
|
9
9
|
export declare function withoutLoginNavigation(navigation: HeaderNavigation): HeaderNavigation;
|
|
10
|
-
export declare function applyAuthenticationHeaderNav<T extends ZudokuConfig
|
|
10
|
+
export declare function applyAuthenticationHeaderNav<T extends ZudokuConfig & {
|
|
11
|
+
__meta?: {
|
|
12
|
+
authenticationEnabled?: boolean;
|
|
13
|
+
};
|
|
14
|
+
}>(config: T): T;
|
|
@@ -4,10 +4,32 @@ export declare const useRefreshUserProfile: ({ refetchOnWindowFocus, }?: {
|
|
|
4
4
|
refetchOnWindowFocus?: boolean | "always";
|
|
5
5
|
}) => import("@tanstack/react-query").UseQueryResult<boolean | undefined, Error>;
|
|
6
6
|
export declare const useVerifiedEmail: () => {
|
|
7
|
-
email:
|
|
8
|
-
isVerified:
|
|
7
|
+
email: string | undefined;
|
|
8
|
+
isVerified: boolean | undefined;
|
|
9
9
|
supportsEmailVerification: boolean;
|
|
10
10
|
refresh: () => undefined;
|
|
11
11
|
requestEmailVerification: (options?: AuthActionOptions) => Promise<void>;
|
|
12
12
|
};
|
|
13
|
-
export declare const useAuth: () =>
|
|
13
|
+
export declare const useAuth: () => {
|
|
14
|
+
isBackendAvailable: boolean;
|
|
15
|
+
authMode: import("./state.js").AuthMode;
|
|
16
|
+
isDemoSession: boolean;
|
|
17
|
+
isDemoMode: boolean;
|
|
18
|
+
hasDistinctSignUpFlow: boolean;
|
|
19
|
+
login: (options?: AuthActionOptions) => Promise<void>;
|
|
20
|
+
logout: () => Promise<void>;
|
|
21
|
+
signup: (options?: AuthActionOptions) => Promise<void>;
|
|
22
|
+
requestEmailVerification: (options?: AuthActionOptions) => Promise<void>;
|
|
23
|
+
isAuthenticated: boolean;
|
|
24
|
+
isPending: boolean;
|
|
25
|
+
sessionChecked: boolean;
|
|
26
|
+
profile: import("./state.js").UserProfile | null;
|
|
27
|
+
providerData: import("./state.js").ProviderData | null;
|
|
28
|
+
setAuthenticationPending: () => void;
|
|
29
|
+
setLoggedOut: () => void;
|
|
30
|
+
setLoggedIn: (args: {
|
|
31
|
+
profile: import("./state.js").UserProfile;
|
|
32
|
+
providerData: import("./state.js").ProviderData;
|
|
33
|
+
}) => void;
|
|
34
|
+
isAuthEnabled: boolean;
|
|
35
|
+
};
|
|
@@ -21,9 +21,45 @@ type AuthStateStore = ReturnType<typeof createAuthStateStore>;
|
|
|
21
21
|
declare global {
|
|
22
22
|
var __APITOGO_AUTH_STATE: AuthStateStore | undefined;
|
|
23
23
|
}
|
|
24
|
-
declare function createAuthStateStore():
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
declare function createAuthStateStore(): import("zustand").UseBoundStore<Omit<import("zustand").StoreApi<AuthState>, "setState" | "persist"> & {
|
|
25
|
+
setState(partial: AuthState | Partial<AuthState> | ((state: AuthState) => AuthState | Partial<AuthState>), replace?: false | undefined): unknown;
|
|
26
|
+
setState(state: AuthState | ((state: AuthState) => AuthState), replace: true): unknown;
|
|
27
|
+
persist: {
|
|
28
|
+
setOptions: (options: Partial<import("zustand/middleware").PersistOptions<AuthState, unknown, unknown>>) => void;
|
|
29
|
+
clearStorage: () => void;
|
|
30
|
+
rehydrate: () => Promise<void> | void;
|
|
31
|
+
hasHydrated: () => boolean;
|
|
32
|
+
onHydrate: (fn: (state: AuthState) => void) => () => void;
|
|
33
|
+
onFinishHydration: (fn: (state: AuthState) => void) => () => void;
|
|
34
|
+
getOptions: () => Partial<import("zustand/middleware").PersistOptions<AuthState, unknown, unknown>>;
|
|
35
|
+
};
|
|
36
|
+
}>;
|
|
37
|
+
export declare const authState: import("zustand").UseBoundStore<Omit<import("zustand").StoreApi<AuthState>, "setState" | "persist"> & {
|
|
38
|
+
setState(partial: AuthState | Partial<AuthState> | ((state: AuthState) => AuthState | Partial<AuthState>), replace?: false | undefined): unknown;
|
|
39
|
+
setState(state: AuthState | ((state: AuthState) => AuthState), replace: true): unknown;
|
|
40
|
+
persist: {
|
|
41
|
+
setOptions: (options: Partial<import("zustand/middleware").PersistOptions<AuthState, unknown, unknown>>) => void;
|
|
42
|
+
clearStorage: () => void;
|
|
43
|
+
rehydrate: () => Promise<void> | void;
|
|
44
|
+
hasHydrated: () => boolean;
|
|
45
|
+
onHydrate: (fn: (state: AuthState) => void) => () => void;
|
|
46
|
+
onFinishHydration: (fn: (state: AuthState) => void) => () => void;
|
|
47
|
+
getOptions: () => Partial<import("zustand/middleware").PersistOptions<AuthState, unknown, unknown>>;
|
|
48
|
+
};
|
|
49
|
+
}>;
|
|
50
|
+
export declare const useAuthState: import("zustand").UseBoundStore<Omit<import("zustand").StoreApi<AuthState>, "setState" | "persist"> & {
|
|
51
|
+
setState(partial: AuthState | Partial<AuthState> | ((state: AuthState) => AuthState | Partial<AuthState>), replace?: false | undefined): unknown;
|
|
52
|
+
setState(state: AuthState | ((state: AuthState) => AuthState), replace: true): unknown;
|
|
53
|
+
persist: {
|
|
54
|
+
setOptions: (options: Partial<import("zustand/middleware").PersistOptions<AuthState, unknown, unknown>>) => void;
|
|
55
|
+
clearStorage: () => void;
|
|
56
|
+
rehydrate: () => Promise<void> | void;
|
|
57
|
+
hasHydrated: () => boolean;
|
|
58
|
+
onHydrate: (fn: (state: AuthState) => void) => () => void;
|
|
59
|
+
onFinishHydration: (fn: (state: AuthState) => void) => () => void;
|
|
60
|
+
getOptions: () => Partial<import("zustand/middleware").PersistOptions<AuthState, unknown, unknown>>;
|
|
61
|
+
};
|
|
62
|
+
}>;
|
|
27
63
|
export declare const waitForAuthStateHydration: () => Promise<void>;
|
|
28
64
|
export interface UserProfile {
|
|
29
65
|
sub: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Processor } from "
|
|
1
|
+
import type { Processor } from "../../../../config/validators/BuildSchema.js";
|
|
2
2
|
export declare const APITOGO_GATEWAY_URL_ENV = "APITOGO_GATEWAY_URL";
|
|
3
3
|
export declare function injectApitogoGatewayServer(options?: {
|
|
4
4
|
gatewayUrl?: string;
|
package/docs/cli/go-live.md
CHANGED
|
@@ -49,7 +49,8 @@ npx apitogo status
|
|
|
49
49
|
- Creates or links the platform project
|
|
50
50
|
- Provisions modules and syncs gateway plans
|
|
51
51
|
- Deploys the API hub (when configured)
|
|
52
|
-
- Updates the portal backend (including auth API URL in `.env`) and builds + deploys the portal
|
|
52
|
+
- Updates the portal backend (including auth API URL in `.env`) and builds + deploys the portal
|
|
53
|
+
frontend
|
|
53
54
|
|
|
54
55
|
If deploy is blocked, fix the reported checklist (missing secrets, plan, OpenAPI). Do not invent
|
|
55
56
|
credentials.
|
|
@@ -69,24 +70,24 @@ npx apitogo deploy --only apihub,portal-frontend
|
|
|
69
70
|
npx apitogo deploy --only portal-frontend --force
|
|
70
71
|
```
|
|
71
72
|
|
|
72
|
-
| Resource
|
|
73
|
-
|
|
|
74
|
-
| `apihub`
|
|
75
|
-
| `portal-backend`
|
|
76
|
-
| `portal-frontend` | Site build + Static Web App deploy
|
|
73
|
+
| Resource | What it updates |
|
|
74
|
+
| ----------------- | ------------------------------------------------ |
|
|
75
|
+
| `apihub` | Gateway plans/baseline, API hub package + deploy |
|
|
76
|
+
| `portal-backend` | Dev-portal module settings and plan catalog |
|
|
77
|
+
| `portal-frontend` | Site build + Static Web App deploy |
|
|
77
78
|
|
|
78
79
|
Omit `--only` to apply all three. Use `--force` to redeploy even when hashes match.
|
|
79
80
|
|
|
80
81
|
## Other deploy flags
|
|
81
82
|
|
|
82
|
-
| Flag
|
|
83
|
-
|
|
|
84
|
-
| `--project-id`
|
|
85
|
-
| `--project-name`
|
|
83
|
+
| Flag | Purpose |
|
|
84
|
+
| ----------------- | ------------------------------------- |
|
|
85
|
+
| `--project-id` | Override project GUID |
|
|
86
|
+
| `--project-name` | Display name when creating a project |
|
|
86
87
|
| `--platform-plan` | `free` \| `starter` \| `professional` |
|
|
87
|
-
| `--resume-from`
|
|
88
|
-
| `--no-wait`
|
|
89
|
-
| `--json`
|
|
88
|
+
| `--resume-from` | Resume publish ledger from step id |
|
|
89
|
+
| `--no-wait` | Do not wait for long-running jobs |
|
|
90
|
+
| `--json` | Print raw JSON result only |
|
|
90
91
|
|
|
91
92
|
Resume state is stored in `.apitogo/publish-state.json`.
|
|
92
93
|
|
|
@@ -100,17 +101,17 @@ npx apitogo teardown --yes # delete the platform project
|
|
|
100
101
|
|
|
101
102
|
## Platform plan vs API plans
|
|
102
103
|
|
|
103
|
-
| Kind | Meaning | How
|
|
104
|
-
| ---------------- | ------------------------------------------- |
|
|
105
|
-
| Platform hosting | Free / Starter / Professional on APItoGo | `--platform-plan`
|
|
104
|
+
| Kind | Meaning | How |
|
|
105
|
+
| ---------------- | ------------------------------------------- | ------------------------------------------------------------------ |
|
|
106
|
+
| Platform hosting | Free / Starter / Professional on APItoGo | `--platform-plan` |
|
|
106
107
|
| Gateway / API | End-user SKUs and rate limits on `/pricing` | `apitogo.config.json` — [Gateway plans](../configuration/plans.md) |
|
|
107
108
|
|
|
108
109
|
## CLI deploy vs MCP publish
|
|
109
110
|
|
|
110
|
-
| Path
|
|
111
|
-
|
|
|
112
|
-
| `npx apitogo deploy` | Terminal, CI, scripts — full product go-live
|
|
113
|
-
| MCP `publish_dev_portal` | Agent-driven go-live with the same engine
|
|
111
|
+
| Path | Use when |
|
|
112
|
+
| ------------------------ | -------------------------------------------- |
|
|
113
|
+
| `npx apitogo deploy` | Terminal, CI, scripts — full product go-live |
|
|
114
|
+
| MCP `publish_dev_portal` | Agent-driven go-live with the same engine |
|
|
114
115
|
|
|
115
116
|
## Related
|
|
116
117
|
|
package/docs/components/slot.mdx
CHANGED
|
@@ -97,8 +97,8 @@ declare module "@lukoweb/apitogo" {
|
|
|
97
97
|
## Integration with Configuration
|
|
98
98
|
|
|
99
99
|
The Slot component works with configuration-based slots. Content defined in your
|
|
100
|
-
`apitogo.config.json` and content injected via `Slot.Source` components will be combined according
|
|
101
|
-
the `type` parameter.
|
|
100
|
+
`apitogo.config.json` and content injected via `Slot.Source` components will be combined according
|
|
101
|
+
to the `type` parameter.
|
|
102
102
|
|
|
103
103
|
```tsx
|
|
104
104
|
// In your site config
|
package/docs/components.mdx
CHANGED
|
@@ -9,50 +9,50 @@ Use these components in MDX pages and custom React pages. Import from `@lukoweb/
|
|
|
9
9
|
|
|
10
10
|
## General
|
|
11
11
|
|
|
12
|
-
| Component
|
|
13
|
-
|
|
|
14
|
-
| [Alert](/docs/components/alert)
|
|
15
|
-
| [Callout](/docs/components/callout)
|
|
16
|
-
| [Badge](/docs/components/badge)
|
|
17
|
-
| [Card](/docs/components/card)
|
|
18
|
-
| [Dialog](/docs/components/dialog)
|
|
19
|
-
| [Icons](/docs/components/icons)
|
|
20
|
-
| [Markdown](/docs/components/markdown)
|
|
21
|
-
| [Tooltip](/docs/components/tooltip)
|
|
12
|
+
| Component | Import | Description |
|
|
13
|
+
| ----------------------------------------- | ----------------------------- | ------------------------------------------------ |
|
|
14
|
+
| [Alert](/docs/components/alert) | `@lukoweb/apitogo/ui/Alert` | Important messages with severity levels |
|
|
15
|
+
| [Callout](/docs/components/callout) | `@lukoweb/apitogo/ui/Callout` | Highlight notes, tips, and warnings |
|
|
16
|
+
| [Badge](/docs/components/badge) | `@lukoweb/apitogo/ui/Badge` | Status labels and tags |
|
|
17
|
+
| [Card](/docs/components/card) | `@lukoweb/apitogo/ui/Card` | Grouped content with header, body, and footer |
|
|
18
|
+
| [Dialog](/docs/components/dialog) | `@lukoweb/apitogo/ui/Dialog` | Modal dialogs that require attention |
|
|
19
|
+
| [Icons](/docs/components/icons) | `@lukoweb/apitogo/icons` | Lucide icons re-exported for MDX and React |
|
|
20
|
+
| [Markdown](/docs/components/markdown) | `@lukoweb/apitogo/components` | Render markdown with syntax highlighting |
|
|
21
|
+
| [Tooltip](/docs/components/tooltip) | `@lukoweb/apitogo/ui/Tooltip` | Hover or focus hints |
|
|
22
22
|
| [Typography](/docs/components/typography) | `@lukoweb/apitogo/components` | Prose styling for headings, lists, and body text |
|
|
23
23
|
|
|
24
24
|
## Documentation
|
|
25
25
|
|
|
26
|
-
| Component
|
|
27
|
-
|
|
|
28
|
-
| [CodeTabs](/docs/components/code-tabs)
|
|
29
|
-
| [Mermaid](/docs/components/mermaid)
|
|
30
|
-
| [API Playground](/docs/components/playground)
|
|
31
|
-
| [Secret](/docs/components/secret)
|
|
32
|
-
| [Stepper](/docs/components/stepper)
|
|
33
|
-
| [Syntax Highlight](/docs/components/syntax-highlight) | `@lukoweb/apitogo/ui/SyntaxHighlight` | Highlighted code with line numbers and copy
|
|
26
|
+
| Component | Import | Description |
|
|
27
|
+
| ----------------------------------------------------- | ------------------------------------- | ---------------------------------------------------- |
|
|
28
|
+
| [CodeTabs](/docs/components/code-tabs) | MDX built-in | Tabbed code examples (languages or package managers) |
|
|
29
|
+
| [Mermaid](/docs/components/mermaid) | `@lukoweb/apitogo/mermaid` | Client-rendered Mermaid diagrams |
|
|
30
|
+
| [API Playground](/docs/components/playground) | MDX built-in | Try API requests from the docs |
|
|
31
|
+
| [Secret](/docs/components/secret) | `@lukoweb/apitogo/ui/Secret` | Mask and reveal API keys |
|
|
32
|
+
| [Stepper](/docs/components/stepper) | MDX built-in | Numbered multi-step guides |
|
|
33
|
+
| [Syntax Highlight](/docs/components/syntax-highlight) | `@lukoweb/apitogo/ui/SyntaxHighlight` | Highlighted code with line numbers and copy |
|
|
34
34
|
|
|
35
35
|
## Form
|
|
36
36
|
|
|
37
|
-
| Component
|
|
38
|
-
|
|
|
39
|
-
| [Button](/docs/components/button)
|
|
40
|
-
| [Checkbox](/docs/components/checkbox) | `@lukoweb/apitogo/ui/Checkbox` | Boolean checkbox input
|
|
41
|
-
| [Input](/docs/components/input)
|
|
42
|
-
| [Label](/docs/components/label)
|
|
43
|
-
| [Select](/docs/components/select)
|
|
44
|
-
| [Slider](/docs/components/slider)
|
|
45
|
-
| [Switch](/docs/components/switch)
|
|
46
|
-
| [Textarea](/docs/components/textarea) | `@lukoweb/apitogo/ui/Textarea` | Multiline text input
|
|
37
|
+
| Component | Import | Description |
|
|
38
|
+
| ------------------------------------- | ------------------------------ | ------------------------------- |
|
|
39
|
+
| [Button](/docs/components/button) | `@lukoweb/apitogo/ui/Button` | Actions with variants and sizes |
|
|
40
|
+
| [Checkbox](/docs/components/checkbox) | `@lukoweb/apitogo/ui/Checkbox` | Boolean checkbox input |
|
|
41
|
+
| [Input](/docs/components/input) | `@lukoweb/apitogo/ui/Input` | Single-line text input |
|
|
42
|
+
| [Label](/docs/components/label) | `@lukoweb/apitogo/ui/Label` | Accessible form labels |
|
|
43
|
+
| [Select](/docs/components/select) | `@lukoweb/apitogo/ui/Select` | Choose from a list of options |
|
|
44
|
+
| [Slider](/docs/components/slider) | `@lukoweb/apitogo/ui/Slider` | Numeric range input |
|
|
45
|
+
| [Switch](/docs/components/switch) | `@lukoweb/apitogo/ui/Switch` | Boolean toggle |
|
|
46
|
+
| [Textarea](/docs/components/textarea) | `@lukoweb/apitogo/ui/Textarea` | Multiline text input |
|
|
47
47
|
|
|
48
48
|
## Utility
|
|
49
49
|
|
|
50
|
-
| Component
|
|
51
|
-
|
|
|
52
|
-
| [ClientOnly](/docs/components/client-only) | `@lukoweb/apitogo/components` | Render children only on the client
|
|
53
|
-
| [Head](/docs/components/head)
|
|
54
|
-
| [Link](/docs/components/link)
|
|
55
|
-
| [Slot](/docs/components/slot)
|
|
50
|
+
| Component | Import | Description |
|
|
51
|
+
| ------------------------------------------ | ----------------------------- | ----------------------------------- |
|
|
52
|
+
| [ClientOnly](/docs/components/client-only) | `@lukoweb/apitogo/components` | Render children only on the client |
|
|
53
|
+
| [Head](/docs/components/head) | `@lukoweb/apitogo/components` | Set title, meta, and link tags |
|
|
54
|
+
| [Link](/docs/components/link) | `@lukoweb/apitogo/components` | Client-side and external navigation |
|
|
55
|
+
| [Slot](/docs/components/slot) | `@lukoweb/apitogo/components` | Inject content into layout slots |
|
|
56
56
|
|
|
57
57
|
## shadcn/ui
|
|
58
58
|
|
|
@@ -4,8 +4,8 @@ sidebar_label: Authentication and Identities
|
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
When building an API documentation portal, you often need a way for users to authenticate API
|
|
7
|
-
requests — API keys and other identities — separately from how they sign in to the portal.
|
|
8
|
-
|
|
7
|
+
requests — API keys and other identities — separately from how they sign in to the portal. APIToGo
|
|
8
|
+
splits **portal authentication** from **API identities**.
|
|
9
9
|
|
|
10
10
|
## Authentication Providers and API Identities
|
|
11
11
|
|
|
@@ -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,8 @@ 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
|
-
- **`limits`** — rate limit and quota policies (see below). Encoded `limitsJson` strings are still
|
|
70
|
+
- **`limits`** — rate limit and quota policies (see below). Encoded `limitsJson` strings are still
|
|
71
|
+
accepted on load.
|
|
69
72
|
|
|
70
73
|
Enable the catalog with `modules.userPanel.plans.enabled: true`. Legacy root `plans` is migrated on
|
|
71
74
|
load.
|
|
@@ -82,10 +85,10 @@ load.
|
|
|
82
85
|
- **rateLimit** — maximum calls per renewal window (per minute when `renewalPeriodSeconds` is 60).
|
|
83
86
|
- **quota** — longer-window cap (per 30 days when `renewalPeriodDays` is 30).
|
|
84
87
|
|
|
85
|
-
New plans include **all** discovered OpenAPI operations unless you set `includedActionKeys`.
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
88
|
+
New plans include **all** discovered OpenAPI operations unless you set `includedActionKeys`. After
|
|
89
|
+
OpenAPI is deployed, you can scope a plan to specific operations with `includedActionKeys` (for
|
|
90
|
+
example `get:/orders/{id}`). Edit those fields in `apitogo.config.json` — see
|
|
91
|
+
[Manifest](./manifest.md).
|
|
89
92
|
|
|
90
93
|
## Publish
|
|
91
94
|
|
|
@@ -95,15 +98,15 @@ Gateway plans are applied when you run:
|
|
|
95
98
|
npx apitogo deploy
|
|
96
99
|
```
|
|
97
100
|
|
|
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).
|
|
101
|
+
`npx apitogo deploy` syncs plans from the manifest to the platform gateway. Paid plans require
|
|
102
|
+
Stripe secrets in `.env` before publish — see [Go live with CLI](../cli/go-live.md).
|
|
100
103
|
|
|
101
104
|
## Platform hosting vs gateway plans
|
|
102
105
|
|
|
103
|
-
| Kind
|
|
104
|
-
|
|
|
105
|
-
| **Platform hosting**
|
|
106
|
-
| **Gateway / API plans** | What your customers pay for API access
|
|
106
|
+
| Kind | What it is | How |
|
|
107
|
+
| ----------------------- | ---------------------------------------------- | ------------------------------------ |
|
|
108
|
+
| **Platform hosting** | APItoGo bill for hosting your portal + API hub | `npx apitogo deploy --platform-plan` |
|
|
109
|
+
| **Gateway / API plans** | What your customers pay for API access | `modules.userPanel.plans.items` |
|
|
107
110
|
|
|
108
111
|
### Free platform limitations
|
|
109
112
|
|
|
@@ -113,8 +116,8 @@ The **Free** platform plan cannot:
|
|
|
113
116
|
- Attach a **custom domain** to the dev portal
|
|
114
117
|
|
|
115
118
|
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.
|
|
119
|
+
manifest has paid plans and you try `npx apitogo deploy --platform-plan free`, deploy is blocked
|
|
120
|
+
until you upgrade or zero/remove those paid plans.
|
|
118
121
|
|
|
119
122
|
## Related
|
|
120
123
|
|
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).
|