GitLab OAuth with PKCE and self-hosted instance support.
GitLab OAuth supports PKCE (S256) by default. For self-hosted GitLab, pass your base URL via thedomain option (defaults to https://gitlab.com).
# .env.local
AUTH_SECRET=your-secret-key-min-32-chars-long
GITLAB_CLIENT_ID=your-gitlab-client-id
GITLAB_CLIENT_SECRET=your-gitlab-client-secret
GITLAB_REDIRECT_URI=http://localhost:3000/api/auth/callback/gitlabHosted on gitlab.com
import { gitlab } from '@warpy-auth-sdk/core';
const provider = gitlab({
clientId: process.env.GITLAB_CLIENT_ID!,
clientSecret: process.env.GITLAB_CLIENT_SECRET!,
redirectUri: process.env.GITLAB_REDIRECT_URI!,
scope: ['read_user', 'email'],
});Using a custom domain
const provider = gitlab({
clientId: process.env.GITLAB_CLIENT_ID!,
clientSecret: process.env.GITLAB_CLIENT_SECRET!,
redirectUri: process.env.GITLAB_REDIRECT_URI!,
domain: 'https://gitlab.mycompany.com',
});read_user for basic profile and email for the user's email.