@lukoweb/apitogo 0.2.46 → 0.2.49

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.
@@ -1,153 +1,154 @@
1
- ---
2
- title: Gateway plans
3
- sidebar_icon: tags
4
- description:
5
- Configure end-user API plans in apitogo.config.json — pricing, rate limits, quotas, and publish
6
- behavior.
7
- ---
8
-
9
- **Gateway plans** (also called API plans) are what your **end users** subscribe to.
10
-
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`.
13
- - **`/account/plans`** — authenticated billing. Sign-in required. Manage and change subscriptions.
14
-
15
- They are separate from **platform hosting** (Free / Starter / Professional on APItoGo), which you
16
- select with `npx apitogo deploy --platform-plan`.
17
-
18
- Store the catalog under `modules.userPanel.plans.items` in `apitogo.config.json`.
19
-
20
- ## Shape with the CLI
21
-
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`.
25
-
26
- ```bash
27
- npx apitogo config
28
- # choose plan → enter title, price, policies → done when finished
29
- ```
30
-
31
- ## Canonical shape
32
-
33
- ```json
34
- {
35
- "modules": {
36
- "userPanel": {
37
- "plans": {
38
- "enabled": true,
39
- "items": [
40
- {
41
- "sku": "free",
42
- "displayName": "Free",
43
- "priceAmount": 0,
44
- "limits": {
45
- "rateLimit": { "calls": 100, "renewalPeriodSeconds": 60 },
46
- "quota": { "calls": 50000, "renewalPeriodDays": 30 }
47
- }
48
- },
49
- {
50
- "sku": "pro",
51
- "displayName": "Pro",
52
- "priceAmount": 29,
53
- "priceCurrency": "usd",
54
- "billingPeriod": "month",
55
- "limits": {
56
- "rateLimit": { "calls": 1000, "renewalPeriodSeconds": 60 },
57
- "quota": { "calls": 500000, "renewalPeriodDays": 30 }
58
- }
59
- }
60
- ]
61
- }
62
- }
63
- }
64
- }
65
- ```
66
-
67
- - **`sku`** — stable identifier (used in checkout URLs and gateway sync).
68
- - **`displayName`** — label on `/pricing`.
69
- - **`priceAmount`** — `0` for free tiers; greater than zero for paid plans (USD by default).
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.
76
-
77
- Enable the catalog with `modules.userPanel.plans.enabled: true`. Legacy root `plans` is migrated on
78
- load.
79
-
80
- ## limits schema
81
-
82
- ```json
83
- {
84
- "rateLimit": { "calls": 100, "renewalPeriodSeconds": 60 },
85
- "quota": { "calls": 50000, "renewalPeriodDays": 30 }
86
- }
87
- ```
88
-
89
- - **rateLimit** — maximum calls per renewal window (per minute when `renewalPeriodSeconds` is 60).
90
- - **quota** — longer-window cap (per 30 days when `renewalPeriodDays` is 30).
91
-
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.
118
-
119
- ## Publish
120
-
121
- Gateway plans are applied when you run:
122
-
123
- ```bash
124
- npx apitogo deploy
125
- ```
126
-
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).
129
-
130
- ## Platform hosting vs gateway plans
131
-
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` |
136
-
137
- ### Free platform limitations
138
-
139
- The **Free** platform plan cannot:
140
-
141
- - Publish **paid** gateway plans (`priceAmount > 0`)
142
- - Attach a **custom domain** to the dev portal
143
-
144
- Use **Starter** or **Professional** for paid API tiers, Stripe checkout, and custom domains. If your
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.
147
-
148
- ## Related
149
-
150
- - [Manifest](./manifest.md)
151
- - [Make config (CLI)](./make-config.mdx)
152
- - [Authentication](./authentication.md)
153
- - [Go live with CLI](../cli/go-live.md)
1
+ ---
2
+ title: Gateway plans
3
+ sidebar_icon: tags
4
+ description:
5
+ Configure end-user API plans in apitogo.config.json — pricing, rate limits, quotas, and publish
6
+ behavior.
7
+ ---
8
+
9
+ **Gateway plans** (also called API plans) are what your **end users** subscribe to.
10
+
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`.
13
+ - **`/account/plans`** — authenticated billing. Sign-in required. Manage and change subscriptions.
14
+
15
+ They are separate from **platform hosting** (Free / Starter / Professional on APItoGo), which you
16
+ select with `npx apitogo deploy --platform-plan`.
17
+
18
+ Store the catalog under `modules.userPanel.plans.items` in `apitogo.config.json`.
19
+
20
+ ## Shape with the CLI
21
+
22
+ In a config version 2 project, plans live in `apitogo/plans.json`. `npx apitogo config` adds them
23
+ interactively (title, price, rate limit, monthly quota) or with `--plan`. A plan with the same `sku`
24
+ is replaced.
25
+
26
+ ```bash
27
+ npx apitogo config
28
+ # choose plan → enter title, price, policies → done when finished
29
+ npx apitogo config --plan '{"sku":"free","displayName":"Free"}'
30
+ ```
31
+
32
+ ## Canonical shape
33
+
34
+ ```json
35
+ {
36
+ "modules": {
37
+ "userPanel": {
38
+ "plans": {
39
+ "enabled": true,
40
+ "items": [
41
+ {
42
+ "sku": "free",
43
+ "displayName": "Free",
44
+ "priceAmount": 0,
45
+ "limits": {
46
+ "rateLimit": { "calls": 100, "renewalPeriodSeconds": 60 },
47
+ "quota": { "calls": 50000, "renewalPeriodDays": 30 }
48
+ }
49
+ },
50
+ {
51
+ "sku": "pro",
52
+ "displayName": "Pro",
53
+ "priceAmount": 29,
54
+ "priceCurrency": "usd",
55
+ "billingPeriod": "month",
56
+ "limits": {
57
+ "rateLimit": { "calls": 1000, "renewalPeriodSeconds": 60 },
58
+ "quota": { "calls": 500000, "renewalPeriodDays": 30 }
59
+ }
60
+ }
61
+ ]
62
+ }
63
+ }
64
+ }
65
+ }
66
+ ```
67
+
68
+ - **`sku`** — stable identifier (used in checkout URLs and gateway sync).
69
+ - **`displayName`** — label on `/pricing`.
70
+ - **`priceAmount`** — `0` for free tiers; greater than zero for paid plans (USD by default).
71
+ - **`pricingModel`** — `fixed` (default) or `custom`. See
72
+ [Custom pricing](#custom-pricing-contact-sales).
73
+ - **`priceLabel`** — optional text shown instead of the price, such as `"Let's talk"` (max 64
74
+ characters).
75
+ - **`limits`** — rate limit and quota policies (see below). Encoded `limitsJson` strings are still
76
+ accepted on load.
77
+
78
+ Enable the catalog with `modules.userPanel.plans.enabled: true`. Legacy root `plans` is migrated on
79
+ load.
80
+
81
+ ## limits schema
82
+
83
+ ```json
84
+ {
85
+ "rateLimit": { "calls": 100, "renewalPeriodSeconds": 60 },
86
+ "quota": { "calls": 50000, "renewalPeriodDays": 30 }
87
+ }
88
+ ```
89
+
90
+ - **rateLimit** — maximum calls per renewal window (per minute when `renewalPeriodSeconds` is 60).
91
+ - **quota** — longer-window cap (per 30 days when `renewalPeriodDays` is 30).
92
+
93
+ New plans include **all** discovered OpenAPI operations unless you set `includedActionKeys`. After
94
+ OpenAPI is deployed, you can scope a plan to specific operations with `includedActionKeys` (for
95
+ example `get:/orders/{id}`). Edit those fields in `apitogo.config.json` — see
96
+ [Manifest](./manifest.md).
97
+
98
+ ## Custom pricing (contact sales)
99
+
100
+ Set `pricingModel: "custom"` for plans with negotiated prices, such as an Enterprise tier. Leave
101
+ `priceAmount` at `0` or omit it.
102
+
103
+ ```json
104
+ {
105
+ "sku": "enterprise",
106
+ "displayName": "Enterprise",
107
+ "pricingModel": "custom",
108
+ "priceLabel": "Let's talk"
109
+ }
110
+ ```
111
+
112
+ On `/pricing`, custom plans show `priceLabel` (or **Custom**) and a **Contact sales** button. The
113
+ button opens a public `/contact-sales` form instead of Stripe checkout or registration. Visitors
114
+ don't need an account.
115
+
116
+ Each submission is emailed to the project's **sales contact email**, or to the project owner's email
117
+ when none is set. Custom plans can't be subscribed to through checkout. Custom plans are available
118
+ on every platform plan, including Free.
119
+
120
+ ## Publish
121
+
122
+ Gateway plans are applied when you run:
123
+
124
+ ```bash
125
+ npx apitogo deploy
126
+ ```
127
+
128
+ `npx apitogo deploy` syncs plans from the manifest to the platform gateway. Paid plans require
129
+ Stripe secrets in `.env` before publish — see [Go live with CLI](../cli/go-live.md).
130
+
131
+ ## Platform hosting vs gateway plans
132
+
133
+ | Kind | What it is | How |
134
+ | ----------------------- | ---------------------------------------------- | ------------------------------------ |
135
+ | **Platform hosting** | APItoGo bill for hosting your portal + API hub | `npx apitogo deploy --platform-plan` |
136
+ | **Gateway / API plans** | What your customers pay for API access | `modules.userPanel.plans.items` |
137
+
138
+ ### Free platform limitations
139
+
140
+ The **Free** platform plan cannot:
141
+
142
+ - Publish **paid** gateway plans (`priceAmount > 0`)
143
+ - Attach a **custom domain** to the dev portal
144
+
145
+ Use **Starter** or **Professional** for paid API tiers, Stripe checkout, and custom domains. If your
146
+ manifest has paid plans and you try `npx apitogo deploy --platform-plan free`, deploy is blocked
147
+ until you upgrade or zero/remove those paid plans.
148
+
149
+ ## Related
150
+
151
+ - [Manifest](./manifest.md)
152
+ - [Make config (CLI)](./make-config.mdx)
153
+ - [Authentication](./authentication.md)
154
+ - [Go live with CLI](../cli/go-live.md)
@@ -1,110 +1,111 @@
1
- ---
2
- title: Custom pages
3
- sidebar_icon: layers-3
4
- ---
5
-
6
- If you want to include pages in your documentation that have greater flexibility than MDX pages, it
7
- is possible to include custom pages of your own.
8
-
9
- These pages are typically built using standard React markup and can borrow from a set of prebuilt
10
- components that APIToGo already has such as buttons, links and headers.
11
-
12
- Start by creating the page you want to add.
13
-
14
- ## CLI scaffold
15
-
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
-
19
- Predefined UI components (Callout, Card, Button, Heading, and more) are documented under
20
- [/docs/components](/docs/components).
21
-
22
- ## Setup a custom page
23
-
24
- Each custom page is a page component of its own and lives in a `src` directory at the root of your
25
- project. Let's create the `<MyCustomPage />` component as an example.
26
-
27
- From the root of your project run this command:
28
-
29
- ```bash
30
- touch src/MyCustomPage.tsx
31
- ```
32
-
33
- You can now open `/src/MyCustomPage.tsx` in the editor of your choice. It will be empty.
34
-
35
- Copy and paste this code to implement the page:
36
-
37
- ```tsx
38
- import { Button, Head, Link } from "@lukoweb/apitogo/components";
39
-
40
- export const MyCustomPage = () => {
41
- return (
42
- <section className="">
43
- <Head>
44
- <title>My Custom Page</title>
45
- </Head>
46
- <div>
47
- <p>Welcome to MyCustomPage</p>
48
- </div>
49
- </section>
50
- );
51
- };
52
- ```
53
-
54
- ## Configuration
55
-
56
- In the [APIToGo Configuration](../configuration/overview.md) you will need to do the following:
57
-
58
- ### Config that embeds JSX
59
-
60
- If you embed React components in config (for example custom pages), use a JSX-capable config module
61
- and import your page component from there.
62
-
63
- ### Import Your Module
64
-
65
- Import the `<MyCustomPage />` component that you created.
66
-
67
- ```typescript
68
- import { MyCustomPage } from "./src/MyCustomPage";
69
- ```
70
-
71
- ### Add a navigation entry
72
-
73
- Add a `custom-page` item to the `navigation` configuration. Each page you want to add to the site
74
- must be its own object.
75
-
76
- The `path` key can be set to whatever you like. This will appear as part of the URL in the address
77
- bar of the browser.
78
-
79
- The `element` key references the name of the custom page component that you want to load.
80
-
81
- ```typescript
82
- {
83
- // ...
84
- navigation: [
85
- {
86
- type: "custom-page",
87
- path: "/a-custom-page",
88
- element: <MyCustomPage />,
89
- },
90
- ]
91
- // ...
92
- }
93
- ```
94
-
95
- This configuration will allow APIToGo to load the contents of the `<MyCustomPage />` component when
96
- a user clicks on a link that points to `/a-custom-page`.
97
-
98
- ## Troubleshooting
99
-
100
- ### Updating Your `tsconfig.json`
101
-
102
- Your `include` property in `tsconfig.json` should automatically be updated to reflect the new custom
103
- pages, but in case it isn't, it should look like this:
104
-
105
- ```json
106
- {
107
- ...
108
- "include": ["src", "src/MyCustomPage.tsx"]
109
- }
110
- ```
1
+ ---
2
+ title: Custom pages
3
+ sidebar_icon: layers-3
4
+ ---
5
+
6
+ If you want to include pages in your documentation that have greater flexibility than MDX pages, it
7
+ is possible to include custom pages of your own.
8
+
9
+ These pages are typically built using standard React markup and can borrow from a set of prebuilt
10
+ components that APIToGo already has such as buttons, links and headers.
11
+
12
+ Start by creating the page you want to add.
13
+
14
+ ## CLI scaffold
15
+
16
+ `npx apitogo config` can create a starter Markdown page at `apitogo/portal/pages/<slug>.mdx`. Choose
17
+ `page` in the wizard loop, or pass `--page-slug` and `--page-title`. The sidebar is built from the
18
+ pages folder, so no navigation entry is needed.
19
+
20
+ Predefined UI components (Callout, Card, Button, Heading, and more) are documented under
21
+ [/docs/components](/docs/components).
22
+
23
+ ## Setup a custom page
24
+
25
+ Each custom page is a page component of its own and lives in a `src` directory at the root of your
26
+ project. Let's create the `<MyCustomPage />` component as an example.
27
+
28
+ From the root of your project run this command:
29
+
30
+ ```bash
31
+ touch src/MyCustomPage.tsx
32
+ ```
33
+
34
+ You can now open `/src/MyCustomPage.tsx` in the editor of your choice. It will be empty.
35
+
36
+ Copy and paste this code to implement the page:
37
+
38
+ ```tsx
39
+ import { Button, Head, Link } from "@lukoweb/apitogo/components";
40
+
41
+ export const MyCustomPage = () => {
42
+ return (
43
+ <section className="">
44
+ <Head>
45
+ <title>My Custom Page</title>
46
+ </Head>
47
+ <div>
48
+ <p>Welcome to MyCustomPage</p>
49
+ </div>
50
+ </section>
51
+ );
52
+ };
53
+ ```
54
+
55
+ ## Configuration
56
+
57
+ In the [APIToGo Configuration](../configuration/overview.md) you will need to do the following:
58
+
59
+ ### Config that embeds JSX
60
+
61
+ If you embed React components in config (for example custom pages), use a JSX-capable config module
62
+ and import your page component from there.
63
+
64
+ ### Import Your Module
65
+
66
+ Import the `<MyCustomPage />` component that you created.
67
+
68
+ ```typescript
69
+ import { MyCustomPage } from "./src/MyCustomPage";
70
+ ```
71
+
72
+ ### Add a navigation entry
73
+
74
+ Add a `custom-page` item to the `navigation` configuration. Each page you want to add to the site
75
+ must be its own object.
76
+
77
+ The `path` key can be set to whatever you like. This will appear as part of the URL in the address
78
+ bar of the browser.
79
+
80
+ The `element` key references the name of the custom page component that you want to load.
81
+
82
+ ```typescript
83
+ {
84
+ // ...
85
+ navigation: [
86
+ {
87
+ type: "custom-page",
88
+ path: "/a-custom-page",
89
+ element: <MyCustomPage />,
90
+ },
91
+ ]
92
+ // ...
93
+ }
94
+ ```
95
+
96
+ This configuration will allow APIToGo to load the contents of the `<MyCustomPage />` component when
97
+ a user clicks on a link that points to `/a-custom-page`.
98
+
99
+ ## Troubleshooting
100
+
101
+ ### Updating Your `tsconfig.json`
102
+
103
+ Your `include` property in `tsconfig.json` should automatically be updated to reflect the new custom
104
+ pages, but in case it isn't, it should look like this:
105
+
106
+ ```json
107
+ {
108
+ ...
109
+ "include": ["src", "src/MyCustomPage.tsx"]
110
+ }
111
+ ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lukoweb/apitogo",
3
- "version": "0.2.46",
3
+ "version": "0.2.49",
4
4
  "type": "module",
5
5
  "sideEffects": [
6
6
  "**/*.css",
@@ -1,6 +1,6 @@
1
- {
2
- "version": 2,
3
- "layout": "standalone",
4
- "project": { "name": "my-docs" },
5
- "portal": { "name": "My Docs" }
6
- }
1
+ {
2
+ "version": 2,
3
+ "layout": "standalone",
4
+ "project": { "name": "my-docs" },
5
+ "portal": { "name": "My Docs" }
6
+ }
@@ -1,14 +1,14 @@
1
- {
2
- "version": 2,
3
- "layout": "embedded",
4
- "gateway": {
5
- "origin": {
6
- "mode": "managed",
7
- "source": ".",
8
- "runtime": "nodejs",
9
- "runtimeVersion": "NODE_22_LTS",
10
- "exclude": ["apitogo/**", "node_modules/**"]
11
- },
12
- "specs": ["openapi.yaml"]
13
- }
14
- }
1
+ {
2
+ "version": 2,
3
+ "layout": "embedded",
4
+ "gateway": {
5
+ "origin": {
6
+ "mode": "managed",
7
+ "source": ".",
8
+ "runtime": "nodejs",
9
+ "runtimeVersion": "NODE_22_LTS",
10
+ "exclude": ["apitogo/**", "node_modules/**"]
11
+ },
12
+ "specs": ["openapi.yaml"]
13
+ }
14
+ }
@@ -1,15 +1,15 @@
1
- {
2
- "version": 2,
3
- "layout": "standalone",
4
- "gateway": {
5
- "origin": { "mode": "proxy", "url": "https://api.acme.com" },
6
- "specs": ["apis/openapi.yaml"],
7
- "auth": {
8
- "mode": "oidc",
9
- "metadataUrl": "https://idp.acme.com/.well-known/openid-configuration",
10
- "issuers": ["https://idp.acme.com/"],
11
- "audiences": ["api://acme-orders"]
12
- },
13
- "policies": { "rateLimit": { "calls": 60, "periodSeconds": 60 } }
14
- }
15
- }
1
+ {
2
+ "version": 2,
3
+ "layout": "standalone",
4
+ "gateway": {
5
+ "origin": { "mode": "proxy", "url": "https://api.acme.com" },
6
+ "specs": ["apis/openapi.yaml"],
7
+ "auth": {
8
+ "mode": "oidc",
9
+ "metadataUrl": "https://idp.acme.com/.well-known/openid-configuration",
10
+ "issuers": ["https://idp.acme.com/"],
11
+ "audiences": ["api://acme-orders"]
12
+ },
13
+ "policies": { "rateLimit": { "calls": 60, "periodSeconds": 60 } }
14
+ }
15
+ }