EdgeSpark ships with a managed auth service that handles OAuth flows end to end. To turn on a social provider such as Google or GitHub, you register an OAuth app with the provider, store the client ID as a var and the client secret as a secret, then enable the provider inDocumentation Index
Fetch the complete documentation index at: https://docs.edgespark.dev/llms.txt
Use this file to discover all available pages before exploring further.
configs/auth-config.yaml and deploy.
The managed auth UI in @edgespark/web reads your applied config and renders the right buttons automatically — no frontend changes are needed when you add a new provider.
The shape of every provider setup
Every OAuth provider follows the same four-step pattern:- Create an OAuth app with the provider and enter the EdgeSpark callback URL.
- Store the client ID as a var:
edgespark var set <PROVIDER>_CLIENT_ID=<value>. - Store the client secret as a secret:
edgespark secret set <PROVIDER>_CLIENT_SECRET. - Enable the provider in
configs/auth-config.yaml, runedgespark auth apply, thenedgespark deploy.
Callback URL
When you create the OAuth app with the provider, set the authorization callback (redirect) URL to:<your-domain>is your deployed project URL, for examplemy-app.edgespark.app, or your custom domain.<provider>is one of:google,github,gitlab,discord.
Fixed var and secret names
Key names are fixed per provider — you cannot choose arbitrary names. The platform reads the values through these exact keys.| Provider | YAML key | Client ID var | Client secret | Extra config |
|---|---|---|---|---|
providerGoogle | GOOGLE_CLIENT_ID | GOOGLE_CLIENT_SECRET | — | |
| GitHub | providerGithub | GITHUB_CLIENT_ID | GITHUB_CLIENT_SECRET | — |
| GitLab | providerGitlab | GITLAB_CLIENT_ID | GITLAB_CLIENT_SECRET | — |
| Discord | providerDiscord | DISCORD_CLIENT_ID | DISCORD_CLIENT_SECRET | — |
server/src/defs/runtime.ts. That step is optional for the auth flow itself, which is fully handled by the platform.
- Open the Google Cloud Console and select or create a project.
- Go to APIs & Services → Credentials and click Create credentials → OAuth client ID.
- Configure the OAuth consent screen if prompted (External user type is typical for consumer apps).
- Choose Web application as the application type and give it a name.
- Under Authorized JavaScript origins, add your deployed project URL:
For example,
https://my-app.edgespark.app. - Under Authorized redirect URIs, add:
- Copy the Client ID and Client secret from the credential details page.
- Store them with the CLI:
- Enable the provider in
configs/auth-config.yaml:configs/auth-config.yaml - Apply and deploy:
GitHub
- Open GitHub Settings → Developer settings → OAuth Apps (either on your user account or organization) and click New OAuth App.
- Set Homepage URL to your deployed project URL, for example
https://my-app.edgespark.app. - Set Authorization callback URL to:
- After creating the app, copy the Client ID and click Generate a new client secret. Copy the secret value immediately — GitHub shows it only once.
- Store them with the CLI:
- Enable the provider in
configs/auth-config.yaml:configs/auth-config.yaml - Apply and deploy:
GitLab
- In GitLab, open User Settings → Applications for a personal app, or Admin → Applications for an instance-wide app.
- Give the application a name and add the Redirect URI:
- Select at least the
read_userandopenidscopes (plusemailandprofileif you want the user’s email and name). - Save the application, then copy the Application ID (this is the client ID) and Secret.
- Store them with the CLI:
- Enable the provider in
configs/auth-config.yaml:configs/auth-config.yaml - Apply and deploy:
Discord
- Open the Discord Developer Portal and click New Application.
- In the application, open OAuth2 → General.
- Under Redirects, add:
- Copy the Client ID, then click Reset Secret to generate a Client Secret.
- Store them with the CLI:
- Enable the provider in
configs/auth-config.yaml:configs/auth-config.yaml - Apply and deploy:
Use enabled providers in the UI
The managed auth UI picks up every enabled provider automatically:web/src/pages/LoginPage.tsx
client.auth.signIn.social:
web/src/lib/auth.ts
provider accepts any of "google", "github", "gitlab", or "discord" — use the same string as in the callback URL.
Full example: enabling multiple providers
configs/auth-config.yaml
Troubleshooting
| Symptom | Likely cause | Fix |
|---|---|---|
edgespark auth apply validation error on a provider config | A provider with enabled: true requires both clientIdVarRef and clientSecretRef. | Fill in both fields in configs/auth-config.yaml. An empty config: {} will fail validation. |
| Login button missing in the managed UI | Config not applied or not deployed. | Run edgespark auth apply then edgespark deploy. Verify with edgespark auth get that the provider has enabled: true. |
redirect_uri_mismatch from the provider | The callback URL registered with the provider does not match the URL EdgeSpark sent. | Re-register https://<your-domain>/api/_es/auth/callback/<provider> exactly — https, exact host, lowercase provider name. |
Provider returns invalid_client | Wrong, missing, or expired client ID or client secret. | Confirm edgespark var list shows the right <PROVIDER>_CLIENT_ID value and edgespark secret list shows <PROVIDER>_CLIENT_SECRET. Re-run edgespark var set or edgespark secret set if needed. |
| Validation mentions unknown or newer fields | CLI version is outdated for the schema. | Compare your YAML with https://schemas.edgespark.dev/v1/auth-config.schema.json and upgrade the CLI with npm update -g @edgespark/cli. |
See also
Manage auth configuration
Full
configs/auth-config.yaml reference, including sessions and email/password.Build auth UI
Mount the managed auth UI or call headless auth methods from the browser.