@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.
- package/dist/cli/cli.js +2196 -1352
- package/dist/declarations/cli/platform/client/platform-api.d.ts +29 -0
- package/dist/declarations/cli/platform/helpers/platform-plan-catalog.d.ts +6 -0
- package/dist/declarations/config/validators/ZudokuConfig.d.ts +2 -0
- package/dist/declarations/lib/authentication/providers/openid.d.ts +2 -1
- package/dist/declarations/lib/plugins/markdown/index.d.ts +2 -1
- package/dist/flat-config.d.ts +1 -0
- package/docs/cli/commands.md +50 -32
- package/docs/cli/go-live.md +66 -93
- package/docs/cli/overview.md +18 -17
- package/docs/cli/setup.md +130 -141
- package/docs/cli/shape.md +94 -11
- package/docs/cli/walkthrough.md +1 -1
- package/docs/components/slot.mdx +116 -119
- package/docs/configuration/api-reference.md +98 -397
- package/docs/configuration/authentication.md +118 -159
- package/docs/configuration/footer.mdx +89 -118
- package/docs/configuration/make-config.mdx +2 -2
- package/docs/configuration/overview.md +97 -166
- package/docs/configuration/plans.md +100 -110
- package/docs/configuration/portal.md +116 -0
- package/docs/customization/colors-theme.mdx +255 -278
- package/docs/customization/fonts.md +105 -110
- package/docs/customization/landing-page.md +189 -188
- package/docs/deploy/apitogo.md +13 -17
- package/docs/deployment.md +15 -9
- package/docs/guides/stripe-setup.mdx +123 -0
- package/docs/markdown/frontmatter.md +172 -173
- package/docs/mcp/go-live.md +100 -100
- package/docs/mcp/overview.md +76 -76
- package/docs/quickstart.md +88 -72
- package/docs/writing.mdx +68 -72
- package/package.json +1 -1
- package/src/config/v2/docs-navigation.ts +7 -2
- package/src/config/v2/index.ts +1 -0
- package/src/config/v2/resolve.ts +28 -0
- package/src/config/v2/rules.ts +32 -1
- package/src/config/v2/schema.ts +9 -0
- package/src/config/v2/services.ts +90 -15
- package/src/config/v2/starter-landing.ts +41 -0
- package/src/config/v2/wrapper.ts +141 -7
- package/src/config/validators/ZudokuConfig.ts +794 -792
- package/src/lib/authentication/providers/openid.tsx +6 -1
- package/src/lib/plugins/markdown/index.tsx +86 -82
- package/src/vite/dev-server.ts +9 -1
- package/src/vite/dev-ssr-config.ts +32 -0
- package/src/vite/plugin-config.ts +4 -2
- package/src/vite/plugin-docs.ts +213 -205
- package/docs/concepts/auth-provider-api-identities.md +0 -105
- package/docs/configuration/ai-assistants.md +0 -65
- package/docs/configuration/api-catalog.md +0 -109
- package/docs/configuration/authentication-auth0.md +0 -181
- package/docs/configuration/authentication-azure-ad.md +0 -245
- package/docs/configuration/authentication-clerk.md +0 -117
- package/docs/configuration/authentication-firebase.md +0 -69
- package/docs/configuration/authentication-pingfederate.md +0 -143
- package/docs/configuration/authentication-supabase.md +0 -233
- package/docs/configuration/build-configuration.mdx +0 -147
- package/docs/configuration/docs.md +0 -282
- package/docs/configuration/llms.md +0 -90
- package/docs/configuration/manifest.md +0 -129
- package/docs/configuration/navigation.mdx +0 -415
- package/docs/configuration/protected-routes.md +0 -150
- package/docs/configuration/search.md +0 -164
- package/docs/configuration/sentry.mdx +0 -44
- package/docs/configuration/site.md +0 -124
- package/docs/configuration/slots.mdx +0 -125
- package/docs/configuration/vite-config.md +0 -18
- package/docs/custom-plugins.md +0 -285
- package/docs/deploy/apache-nginx.md +0 -41
- package/docs/deploy/cloudflare-pages.md +0 -74
- package/docs/deploy/direct-upload.md +0 -17
- package/docs/deploy/github-pages.md +0 -49
- package/docs/deploy/vercel.md +0 -101
- package/docs/extending/events.md +0 -124
- package/docs/guides/environment-variables.md +0 -94
- package/docs/guides/managing-api-keys-and-identities.md +0 -89
- package/docs/guides/navigation-rules.mdx +0 -203
- package/docs/guides/processors.mdx +0 -234
- package/docs/guides/transforming-examples.md +0 -156
- package/docs/guides/using-multiple-apis.md +0 -87
- package/docs/plugins.md +0 -24
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: Firebase Setup
|
|
3
|
-
sidebar_label: Firebase
|
|
4
|
-
description:
|
|
5
|
-
Learn how to set up Firebase Authentication for APIToGo, leveraging Google's secure authentication
|
|
6
|
-
infrastructure with multiple sign-in providers.
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
:::caution{title="SPA / advanced"}
|
|
10
|
-
|
|
11
|
-
Portal products on APItoGo use [`dev-portal`](./authentication.md) authentication. Use Firebase SPA
|
|
12
|
-
integration only for standalone docs sites that talk to Firebase directly.
|
|
13
|
-
|
|
14
|
-
:::
|
|
15
|
-
|
|
16
|
-
Firebase Authentication provides a comprehensive identity solution from Google, supporting
|
|
17
|
-
email/password authentication and federated identity providers like Google, Facebook, Twitter, and
|
|
18
|
-
more. This guide shows you how to integrate Firebase Authentication with your APIToGo documentation
|
|
19
|
-
site.
|
|
20
|
-
|
|
21
|
-
## Prerequisites
|
|
22
|
-
|
|
23
|
-
- A Google account to access Firebase Console
|
|
24
|
-
- A Firebase project (free tier available)
|
|
25
|
-
- Basic knowledge of Firebase configuration
|
|
26
|
-
|
|
27
|
-
## Setup Firebase
|
|
28
|
-
|
|
29
|
-
1. Go to the [Firebase Console](https://console.firebase.google.com/):
|
|
30
|
-
2. Click **Create a project** (or select an existing project)
|
|
31
|
-
3. Make sure authentication is enabled. Choose your preferred authentication providers.
|
|
32
|
-
4. Configure Authorized Domains, add your domains where the authentication will be used.
|
|
33
|
-
5. **Get Your Firebase Configuration**
|
|
34
|
-
- Go to **Project settings**
|
|
35
|
-
- Scroll to **Your apps** section
|
|
36
|
-
- Click **Add app** → **Web** if you haven't already
|
|
37
|
-
- Register your app with a nickname
|
|
38
|
-
- Copy the Firebase configuration object
|
|
39
|
-
|
|
40
|
-
## Configure APIToGo
|
|
41
|
-
|
|
42
|
-
Add the Firebase configuration to your [APIToGo configuration file](./overview.md):
|
|
43
|
-
|
|
44
|
-
```typescript title="config"
|
|
45
|
-
export default {
|
|
46
|
-
authentication: {
|
|
47
|
-
type: "firebase",
|
|
48
|
-
// Replace these with your Firebase project configuration
|
|
49
|
-
// Get these values from Firebase Console > Project Settings
|
|
50
|
-
apiKey: "<insert your API key here>",
|
|
51
|
-
authDomain: "your-domain.firebaseapp.com",
|
|
52
|
-
projectId: "your-project-id",
|
|
53
|
-
appId: "1:296819355813:web:91d29f11cac6f073595d4c",
|
|
54
|
-
// Optional fields
|
|
55
|
-
storageBucket: "your-project.firebasestorage.app",
|
|
56
|
-
messagingSenderId: "296819355813",
|
|
57
|
-
measurementId: "G-12W6TTNR75",
|
|
58
|
-
// Optional: specify which providers to show in the sign-in UI
|
|
59
|
-
// Available providers: "google", "github", "facebook", "twitter",
|
|
60
|
-
// "microsoft", "apple", "yahoo", "password", "phone"
|
|
61
|
-
// If not specified, all enabled providers in Firebase will be available
|
|
62
|
-
providers: ["google", "github", "password"],
|
|
63
|
-
// Optional: configure redirect URLs after authentication
|
|
64
|
-
redirectToAfterSignIn: "/docs",
|
|
65
|
-
redirectToAfterSignUp: "/getting-started",
|
|
66
|
-
redirectToAfterSignOut: "/",
|
|
67
|
-
},
|
|
68
|
-
};
|
|
69
|
-
```
|
|
@@ -1,143 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: PingFederate Setup
|
|
3
|
-
sidebar_label: PingFederate
|
|
4
|
-
description:
|
|
5
|
-
Learn how to set up PingFederate authentication for APIToGo using OpenID Connect for
|
|
6
|
-
enterprise-grade single sign-on.
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
:::caution{title="SPA / advanced"}
|
|
10
|
-
|
|
11
|
-
Portal products on APItoGo use [`dev-portal`](./authentication.md) authentication. Use PingFederate
|
|
12
|
-
SPA integration only for standalone docs sites that talk to PingFederate directly.
|
|
13
|
-
|
|
14
|
-
:::
|
|
15
|
-
|
|
16
|
-
PingFederate is an enterprise federation server that enables secure single sign-on (SSO) and API
|
|
17
|
-
security for organizations. This guide walks you through integrating PingFederate with APIToGo using
|
|
18
|
-
OpenID Connect.
|
|
19
|
-
|
|
20
|
-
## Prerequisites
|
|
21
|
-
|
|
22
|
-
- Access to a PingFederate server (version 9.0 or later recommended)
|
|
23
|
-
- Administrative access to configure OAuth clients in PingFederate
|
|
24
|
-
- Your PingFederate server's base URL
|
|
25
|
-
|
|
26
|
-
## Setup Steps
|
|
27
|
-
|
|
28
|
-
<Stepper>
|
|
29
|
-
|
|
30
|
-
1. **Create an OAuth Client in PingFederate**
|
|
31
|
-
|
|
32
|
-
In the PingFederate administrative console:
|
|
33
|
-
- Navigate to **Applications** → **OAuth** → **Clients**
|
|
34
|
-
- Click **Add Client**
|
|
35
|
-
- Configure the client:
|
|
36
|
-
- **Client ID**: Choose a unique identifier (e.g., `apitogo-docs`)
|
|
37
|
-
- **Client Authentication**: Select **None (Public Client)**
|
|
38
|
-
- **Grant Types**: Enable **Authorization Code** and **Refresh Token**
|
|
39
|
-
- **Redirect URIs**:
|
|
40
|
-
- Production: `https://your-site.com/oauth/callback`
|
|
41
|
-
- Preview (wildcard): `https://*.your-domain.com/oauth/callback`
|
|
42
|
-
- Local Development: `http://localhost:3000/oauth/callback`
|
|
43
|
-
|
|
44
|
-
2. **Configure OpenID Connect Settings**
|
|
45
|
-
|
|
46
|
-
Still in the OAuth client configuration:
|
|
47
|
-
- Enable **OpenID Connect**
|
|
48
|
-
- Configure scopes:
|
|
49
|
-
- Enable `openid`, `profile`, and `email` (minimum required)
|
|
50
|
-
- Add any custom scopes your organization requires
|
|
51
|
-
- **ID Token Signing Algorithm**: RS256 (recommended)
|
|
52
|
-
- **Access Token Manager**: Select or create an appropriate token manager
|
|
53
|
-
- Save the configuration
|
|
54
|
-
|
|
55
|
-
3. **Configure APIToGo**
|
|
56
|
-
|
|
57
|
-
Add the PingFederate configuration to your [APIToGo configuration file](./overview.md):
|
|
58
|
-
|
|
59
|
-
```typescript
|
|
60
|
-
// site config
|
|
61
|
-
export default {
|
|
62
|
-
// ... other configuration
|
|
63
|
-
authentication: {
|
|
64
|
-
type: "openid",
|
|
65
|
-
clientId: "apitogo-docs", // Your OAuth client ID
|
|
66
|
-
issuer: "https://pingfederate.your-domain.com", // Your PingFederate base URL
|
|
67
|
-
scopes: ["openid", "profile", "email"], // Optional: add custom scopes
|
|
68
|
-
},
|
|
69
|
-
// ... other configuration
|
|
70
|
-
};
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
</Stepper>
|
|
74
|
-
|
|
75
|
-
## Configuration Options
|
|
76
|
-
|
|
77
|
-
### Custom Scopes
|
|
78
|
-
|
|
79
|
-
If your organization uses custom scopes for authorization, include them in the configuration:
|
|
80
|
-
|
|
81
|
-
```typescript
|
|
82
|
-
authentication: {
|
|
83
|
-
type: "openid",
|
|
84
|
-
clientId: "apitogo-docs",
|
|
85
|
-
issuer: "https://pingfederate.your-domain.com",
|
|
86
|
-
scopes: ["openid", "profile", "email", "groups", "roles", "api:read"],
|
|
87
|
-
}
|
|
88
|
-
```
|
|
89
|
-
|
|
90
|
-
## Advanced Configuration
|
|
91
|
-
|
|
92
|
-
### CORS Configuration
|
|
93
|
-
|
|
94
|
-
Configure CORS in PingFederate for your documentation site:
|
|
95
|
-
|
|
96
|
-
1. Navigate to **System** → **Server Configuration** → **Cross-Origin Resource Sharing**
|
|
97
|
-
2. Add your site's domain to the allowed origins:
|
|
98
|
-
- `https://your-site.com`
|
|
99
|
-
- `http://localhost:3000` (for local development)
|
|
100
|
-
|
|
101
|
-
### Attribute Mapping
|
|
102
|
-
|
|
103
|
-
PingFederate can map user attributes from various sources. Ensure these standard claims are mapped:
|
|
104
|
-
|
|
105
|
-
1. Go to **OAuth** → **Access Token Management** → **Your Token Manager**
|
|
106
|
-
2. Configure attribute mappings:
|
|
107
|
-
- `sub` → User's unique identifier
|
|
108
|
-
- `name` → User's display name
|
|
109
|
-
- `email` → User's email address
|
|
110
|
-
- `picture` → User's profile picture URL (if available)
|
|
111
|
-
|
|
112
|
-
## Troubleshooting
|
|
113
|
-
|
|
114
|
-
### Common Issues
|
|
115
|
-
|
|
116
|
-
1. **Discovery Endpoint Not Found**: Ensure your issuer URL is correct and accessible. The OpenID
|
|
117
|
-
Connect discovery endpoint should be available at
|
|
118
|
-
`https://your-pingfederate-server/.well-known/openid-configuration`.
|
|
119
|
-
|
|
120
|
-
2. **Invalid Client Configuration**: Verify that the client ID matches exactly and that the redirect
|
|
121
|
-
URIs are properly configured in PingFederate.
|
|
122
|
-
|
|
123
|
-
3. **CORS Errors**: Check that your site's domain is added to PingFederate's CORS configuration.
|
|
124
|
-
|
|
125
|
-
4. **Missing User Attributes**: Ensure attribute mappings are configured in your Access Token
|
|
126
|
-
Manager.
|
|
127
|
-
|
|
128
|
-
5. **Token Validation Errors**: Verify that your PingFederate server's certificates are valid and
|
|
129
|
-
that clock synchronization is accurate.
|
|
130
|
-
|
|
131
|
-
## Security Considerations
|
|
132
|
-
|
|
133
|
-
- Always use HTTPS for production deployments
|
|
134
|
-
- Regularly rotate signing certificates in PingFederate
|
|
135
|
-
- Configure appropriate session timeouts
|
|
136
|
-
- Review and audit OAuth client configurations periodically
|
|
137
|
-
|
|
138
|
-
## Next Steps
|
|
139
|
-
|
|
140
|
-
- Review [PingFederate documentation](https://docs.pingidentity.com/pingfederate/) for advanced
|
|
141
|
-
features
|
|
142
|
-
- Learn about [protecting routes](./authentication.md#protected-routes) in your documentation
|
|
143
|
-
- Configure group-based access control using PingFederate claims
|
|
@@ -1,233 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: Supabase Setup
|
|
3
|
-
sidebar_label: Supabase
|
|
4
|
-
description:
|
|
5
|
-
Learn how to set up Supabase authentication for APIToGo, leveraging Supabase's built-in auth
|
|
6
|
-
providers for secure documentation access.
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
:::caution{title="SPA / advanced"}
|
|
10
|
-
|
|
11
|
-
Portal products on APItoGo use [`dev-portal`](./authentication.md) authentication. Use Supabase SPA
|
|
12
|
-
integration only for standalone docs sites that talk to Supabase directly.
|
|
13
|
-
|
|
14
|
-
:::
|
|
15
|
-
|
|
16
|
-
Supabase is an open-source Firebase alternative that provides authentication, database, and storage
|
|
17
|
-
services. This guide shows you how to integrate Supabase authentication with your APIToGo
|
|
18
|
-
documentation site.
|
|
19
|
-
|
|
20
|
-
## Prerequisites
|
|
21
|
-
|
|
22
|
-
You'll need a Supabase project. If you don't have one,
|
|
23
|
-
[create a free Supabase project](https://supabase.com/dashboard) to get started.
|
|
24
|
-
|
|
25
|
-
## Setup Steps
|
|
26
|
-
|
|
27
|
-
<Stepper>
|
|
28
|
-
|
|
29
|
-
1. **Configure Authentication Provider**
|
|
30
|
-
|
|
31
|
-
In your [Supabase Dashboard](https://supabase.com/dashboard):
|
|
32
|
-
- Navigate to **Authentication** → **Providers**
|
|
33
|
-
- Enable your preferred authentication provider (GitHub, Google, Azure, etc.)
|
|
34
|
-
- Configure the provider settings:
|
|
35
|
-
- **Redirect URL**: `https://your-project.supabase.co/auth/v1/callback`
|
|
36
|
-
- Copy any required credentials (Client ID, Client Secret) from the provider
|
|
37
|
-
|
|
38
|
-
2. **Get Your Project Credentials**
|
|
39
|
-
|
|
40
|
-
From your Supabase project dashboard:
|
|
41
|
-
- Go to **Settings** → **Data API**
|
|
42
|
-
- Copy your **Project URL** (looks like `https://your-project.supabase.co`)
|
|
43
|
-
- Go to **Settings** → **API Keys**
|
|
44
|
-
- Copy your **anon public** API key
|
|
45
|
-
|
|
46
|
-
3. **Configure APIToGo**
|
|
47
|
-
|
|
48
|
-
Add the Supabase configuration to your [APIToGo configuration file](./overview.md):
|
|
49
|
-
|
|
50
|
-
```ts title="config"
|
|
51
|
-
export default {
|
|
52
|
-
// ... other configuration
|
|
53
|
-
authentication: {
|
|
54
|
-
type: "supabase",
|
|
55
|
-
providers: ["github"], // one or more providers
|
|
56
|
-
supabaseUrl: "https://your-project.supabase.co",
|
|
57
|
-
supabaseKey: "<your-anon-public-key>",
|
|
58
|
-
},
|
|
59
|
-
// ... other configuration
|
|
60
|
-
};
|
|
61
|
-
```
|
|
62
|
-
|
|
63
|
-
You can configure multiple providers:
|
|
64
|
-
|
|
65
|
-
```ts title="config"
|
|
66
|
-
export default {
|
|
67
|
-
// ... other configuration
|
|
68
|
-
authentication: {
|
|
69
|
-
type: "supabase",
|
|
70
|
-
providers: ["github", "google", "azure"],
|
|
71
|
-
supabaseUrl: "https://your-project.supabase.co",
|
|
72
|
-
supabaseKey: "<your-anon-public-key>",
|
|
73
|
-
},
|
|
74
|
-
// ... other configuration
|
|
75
|
-
};
|
|
76
|
-
```
|
|
77
|
-
|
|
78
|
-
4. **Install Supabase Dependencies**
|
|
79
|
-
|
|
80
|
-
Add `@supabase/supabase-js` to your project dependencies:
|
|
81
|
-
|
|
82
|
-
```bash
|
|
83
|
-
npm install @supabase/supabase-js @supabase/auth-ui-shared @supabase/auth-ui-react
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
</Stepper>
|
|
87
|
-
|
|
88
|
-
## Supported Providers
|
|
89
|
-
|
|
90
|
-
Supabase supports numerous authentication providers. Use any of these values in the `providers`
|
|
91
|
-
array:
|
|
92
|
-
|
|
93
|
-
- `apple` - Sign in with Apple
|
|
94
|
-
- `azure` - Microsoft Azure AD
|
|
95
|
-
- `bitbucket` - Bitbucket
|
|
96
|
-
- `discord` - Discord
|
|
97
|
-
- `facebook` - Facebook
|
|
98
|
-
- `figma` - Figma
|
|
99
|
-
- `github` - GitHub
|
|
100
|
-
- `gitlab` - GitLab
|
|
101
|
-
- `google` - Google
|
|
102
|
-
- `kakao` - Kakao
|
|
103
|
-
- `keycloak` - Keycloak
|
|
104
|
-
- `linkedin` / `linkedin_oidc` - LinkedIn
|
|
105
|
-
- `notion` - Notion
|
|
106
|
-
- `slack` / `slack_oidc` - Slack
|
|
107
|
-
- `spotify` - Spotify
|
|
108
|
-
- `twitch` - Twitch
|
|
109
|
-
- `twitter` - Twitter/X
|
|
110
|
-
- `workos` - WorkOS
|
|
111
|
-
- `zoom` - Zoom
|
|
112
|
-
- `fly` - Fly.io
|
|
113
|
-
|
|
114
|
-
:::info
|
|
115
|
-
|
|
116
|
-
Email/password authentication does not need to be specified as a provider because it is enabled by
|
|
117
|
-
default in Supabase. To disable email/password authentication and only use OAuth providers, set
|
|
118
|
-
`onlyThirdPartyProviders: true` in your configuration.
|
|
119
|
-
|
|
120
|
-
:::
|
|
121
|
-
|
|
122
|
-
## Configuration Options
|
|
123
|
-
|
|
124
|
-
All available configuration options for Supabase authentication:
|
|
125
|
-
|
|
126
|
-
```ts title="config"
|
|
127
|
-
authentication: {
|
|
128
|
-
type: "supabase",
|
|
129
|
-
|
|
130
|
-
// Provider configuration (required)
|
|
131
|
-
// Array of one or more OAuth providers to enable
|
|
132
|
-
providers: ["google", "github"],
|
|
133
|
-
|
|
134
|
-
// Supabase credentials (required)
|
|
135
|
-
supabaseUrl: "https://your-project.supabase.co",
|
|
136
|
-
supabaseKey: "<your-anon-public-key>",
|
|
137
|
-
|
|
138
|
-
// Optional: Custom base path for auth routes (default: "/")
|
|
139
|
-
basePath: "/docs",
|
|
140
|
-
|
|
141
|
-
// Optional: Disable email/password authentication, only use OAuth providers
|
|
142
|
-
onlyThirdPartyProviders: true,
|
|
143
|
-
|
|
144
|
-
// Optional: Redirect URLs after authentication events
|
|
145
|
-
redirectToAfterSignUp: "/welcome",
|
|
146
|
-
redirectToAfterSignIn: "/dashboard",
|
|
147
|
-
redirectToAfterSignOut: "/",
|
|
148
|
-
}
|
|
149
|
-
```
|
|
150
|
-
|
|
151
|
-
### Authentication Routes
|
|
152
|
-
|
|
153
|
-
The Supabase authentication provider automatically creates the following routes:
|
|
154
|
-
|
|
155
|
-
- `/signin` - Sign in page with configured providers
|
|
156
|
-
- `/signup` - Sign up page with configured providers
|
|
157
|
-
- `/signout` - Sign out endpoint
|
|
158
|
-
|
|
159
|
-
If you configure a custom `basePath`, these routes will be prefixed with that path (e.g.,
|
|
160
|
-
`/docs/signin`).
|
|
161
|
-
|
|
162
|
-
## Advanced Configuration
|
|
163
|
-
|
|
164
|
-
### User Profile Data
|
|
165
|
-
|
|
166
|
-
APIToGo automatically extracts the following user information from Supabase authentication:
|
|
167
|
-
|
|
168
|
-
- `sub` - User ID from Supabase
|
|
169
|
-
- `email` - User's email address
|
|
170
|
-
- `name` - User's full name (from `user_metadata.full_name` or `user_metadata.name`)
|
|
171
|
-
- `emailVerified` - Whether the email has been confirmed
|
|
172
|
-
- `pictureUrl` - User's avatar URL (from `user_metadata.avatar_url`)
|
|
173
|
-
|
|
174
|
-
### Additional User Metadata
|
|
175
|
-
|
|
176
|
-
To store and access additional user information beyond what's provided by Supabase authentication:
|
|
177
|
-
|
|
178
|
-
1. Create a `profiles` table in your Supabase database
|
|
179
|
-
2. Set up a database trigger to create profile records on user signup
|
|
180
|
-
3. Use the Supabase client to query this data in your application
|
|
181
|
-
|
|
182
|
-
Example profile table structure:
|
|
183
|
-
|
|
184
|
-
```sql
|
|
185
|
-
CREATE TABLE profiles (
|
|
186
|
-
id UUID REFERENCES auth.users ON DELETE CASCADE,
|
|
187
|
-
username TEXT UNIQUE,
|
|
188
|
-
bio TEXT,
|
|
189
|
-
created_at TIMESTAMPTZ DEFAULT NOW(),
|
|
190
|
-
PRIMARY KEY (id)
|
|
191
|
-
);
|
|
192
|
-
|
|
193
|
-
-- Create trigger to automatically create profile on user signup
|
|
194
|
-
CREATE OR REPLACE FUNCTION public.handle_new_user()
|
|
195
|
-
RETURNS TRIGGER AS $$
|
|
196
|
-
BEGIN
|
|
197
|
-
INSERT INTO public.profiles (id)
|
|
198
|
-
VALUES (new.id);
|
|
199
|
-
RETURN new;
|
|
200
|
-
END;
|
|
201
|
-
$$ LANGUAGE plpgsql SECURITY DEFINER;
|
|
202
|
-
|
|
203
|
-
CREATE TRIGGER on_auth_user_created
|
|
204
|
-
AFTER INSERT ON auth.users
|
|
205
|
-
FOR EACH ROW EXECUTE PROCEDURE public.handle_new_user();
|
|
206
|
-
```
|
|
207
|
-
|
|
208
|
-
## Troubleshooting
|
|
209
|
-
|
|
210
|
-
### Common Issues
|
|
211
|
-
|
|
212
|
-
1. **"At least one provider must be provided" Error**: You must configure the `providers` option in
|
|
213
|
-
your authentication configuration with at least one authentication provider in the array.
|
|
214
|
-
|
|
215
|
-
2. **Invalid API Key**: Ensure you're using the `anon public` key, not the `service_role` key from
|
|
216
|
-
your Supabase project settings.
|
|
217
|
-
|
|
218
|
-
3. **Provider Not Working**: Verify the provider is enabled in your Supabase dashboard and properly
|
|
219
|
-
configured with the correct redirect URLs.
|
|
220
|
-
|
|
221
|
-
4. **Redirect URLs**: For local development, update your redirect URLs in both Supabase and the
|
|
222
|
-
OAuth provider to include `http://localhost:3000`.
|
|
223
|
-
|
|
224
|
-
5. **CORS Errors**: Check that your site's domain is properly configured in Supabase's allowed URLs
|
|
225
|
-
under **Authentication** → **URL Configuration**.
|
|
226
|
-
|
|
227
|
-
6. **Authentication Not Working**: Make sure you have installed all required dependencies:
|
|
228
|
-
`@supabase/supabase-js`, `@supabase/auth-ui-react`, and `@supabase/auth-ui-shared`.
|
|
229
|
-
|
|
230
|
-
## Next Steps
|
|
231
|
-
|
|
232
|
-
- Explore [Supabase Auth documentation](https://supabase.com/docs/guides/auth) for advanced features
|
|
233
|
-
- Learn about [protecting routes](./authentication.md#protected-routes) in your documentation
|
|
@@ -1,147 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
sidebar_icon: pickaxe
|
|
3
|
-
---
|
|
4
|
-
|
|
5
|
-
# Build Configuration
|
|
6
|
-
|
|
7
|
-
The `apitogo.build.ts` file allows you to configure build-time settings and processors for your
|
|
8
|
-
APIToGo project. This file is executed during the build process and can be used to transform your
|
|
9
|
-
API schemas before they are used in the documentation.
|
|
10
|
-
|
|
11
|
-
:::tip{title="Security Note"}
|
|
12
|
-
|
|
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
|
-
|
|
16
|
-
- Sensitive operations (like API calls, file system access) can safely be performed
|
|
17
|
-
- No build-time code or data is included in the final client bundle
|
|
18
|
-
- Environment variables and secrets can be safely accessed
|
|
19
|
-
- No browser-specific APIs are available
|
|
20
|
-
|
|
21
|
-
:::
|
|
22
|
-
|
|
23
|
-
## File Location
|
|
24
|
-
|
|
25
|
-
Create a file named `apitogo.build.ts` in the root of your project:
|
|
26
|
-
|
|
27
|
-
```bash
|
|
28
|
-
your-project/
|
|
29
|
-
├── apitogo.config.json
|
|
30
|
-
├── apitogo.build.ts # <-- Add this file
|
|
31
|
-
└── ...
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
## Basic Configuration
|
|
35
|
-
|
|
36
|
-
Here's a basic example of a build configuration file:
|
|
37
|
-
|
|
38
|
-
```ts
|
|
39
|
-
import type { ApitogoBuildConfig } from "@lukoweb/apitogo";
|
|
40
|
-
|
|
41
|
-
const buildConfig: ApitogoBuildConfig = {
|
|
42
|
-
processors: [
|
|
43
|
-
async ({ schema }) => {
|
|
44
|
-
// Transform your schema here
|
|
45
|
-
return schema;
|
|
46
|
-
},
|
|
47
|
-
],
|
|
48
|
-
remarkPlugins: [],
|
|
49
|
-
rehypePlugins: [],
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
export default buildConfig;
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
## Configuration Options
|
|
56
|
-
|
|
57
|
-
### `processors`
|
|
58
|
-
|
|
59
|
-
An array of functions that transform your API schemas. Each processor receives:
|
|
60
|
-
|
|
61
|
-
- `file`: The path to the schema file
|
|
62
|
-
- `schema`: The OpenAPI schema object
|
|
63
|
-
- `params`: Query parameters extracted from the input string (see
|
|
64
|
-
[Splitting Schemas](../guides/processors#using-query-parameters-to-split-schemas))
|
|
65
|
-
- `dereference`: A function to dereference the schema
|
|
66
|
-
|
|
67
|
-
Processors are executed in order, and each processor receives the output of the previous one.
|
|
68
|
-
|
|
69
|
-
:::tip
|
|
70
|
-
|
|
71
|
-
For detailed information about processors and available built-in processors, see the
|
|
72
|
-
[Schema Processors](../guides/processors) guide.
|
|
73
|
-
|
|
74
|
-
:::
|
|
75
|
-
|
|
76
|
-
Here's a simple example that adds a description to all operations:
|
|
77
|
-
|
|
78
|
-
```ts
|
|
79
|
-
async function addDescriptionProcessor({ schema }) {
|
|
80
|
-
if (!schema.paths) return schema;
|
|
81
|
-
|
|
82
|
-
// Add a description to all operations
|
|
83
|
-
Object.values(schema.paths).forEach((path) => {
|
|
84
|
-
Object.values(path).forEach((operation) => {
|
|
85
|
-
if (typeof operation === "object" && operation) {
|
|
86
|
-
operation.description = "This is a public API endpoint";
|
|
87
|
-
}
|
|
88
|
-
});
|
|
89
|
-
});
|
|
90
|
-
|
|
91
|
-
return schema;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
export default {
|
|
95
|
-
processors: [addDescriptionProcessor],
|
|
96
|
-
};
|
|
97
|
-
```
|
|
98
|
-
|
|
99
|
-
### `remarkPlugins`
|
|
100
|
-
|
|
101
|
-
An array of [Remark](https://github.com/remarkjs/remark) plugins to transform Markdown content.
|
|
102
|
-
These plugins run before the content is converted to HTML.
|
|
103
|
-
|
|
104
|
-
```ts
|
|
105
|
-
import remarkContributors from "remark-contributors";
|
|
106
|
-
|
|
107
|
-
export default {
|
|
108
|
-
remarkPlugins: [remarkContributors],
|
|
109
|
-
};
|
|
110
|
-
```
|
|
111
|
-
|
|
112
|
-
### `rehypePlugins`
|
|
113
|
-
|
|
114
|
-
An array of [Rehype](https://github.com/rehypejs/rehype) plugins to transform HTML content. These
|
|
115
|
-
plugins run after Markdown is converted to HTML.
|
|
116
|
-
|
|
117
|
-
```ts
|
|
118
|
-
import rehypeKatex from "rehype-katex";
|
|
119
|
-
|
|
120
|
-
export default {
|
|
121
|
-
rehypePlugins: [rehypeKatex],
|
|
122
|
-
};
|
|
123
|
-
```
|
|
124
|
-
|
|
125
|
-
### `prerender`
|
|
126
|
-
|
|
127
|
-
Configuration for the prerendering process that generates static HTML pages during build time.
|
|
128
|
-
|
|
129
|
-
- `workers`: Number of parallel workers to use for prerendering. Defaults to 80% of available CPU
|
|
130
|
-
cores.
|
|
131
|
-
|
|
132
|
-
```ts
|
|
133
|
-
import os from "node:os";
|
|
134
|
-
|
|
135
|
-
export default {
|
|
136
|
-
prerender: {
|
|
137
|
-
workers: 4, // Fixed number of workers
|
|
138
|
-
},
|
|
139
|
-
};
|
|
140
|
-
|
|
141
|
-
// Or use a percentage of available CPU cores
|
|
142
|
-
export default {
|
|
143
|
-
prerender: {
|
|
144
|
-
workers: Math.floor(os.cpus().length * 0.75), // Use 75% of available cores
|
|
145
|
-
},
|
|
146
|
-
};
|
|
147
|
-
```
|