Twitch OAuth

Twitch OAuth with PKCE; requires Client-Id header for user API.

Overview

Twitch requires the Client-Id header when calling /helix/users. PKCE (S256) is enabled by default.

Environment

# .env.local
AUTH_SECRET=your-secret-key-min-32-chars-long
TWITCH_CLIENT_ID=your-twitch-client-id
TWITCH_CLIENT_SECRET=your-twitch-client-secret
TWITCH_REDIRECT_URI=http://localhost:3000/api/auth/callback/twitch

Configuration

Basic Twitch OAuth Setup

Minimal configuration

import { twitch } from '@warpy-auth-sdk/core';

const provider = twitch({
  clientId: process.env.TWITCH_CLIENT_ID!,
  clientSecret: process.env.TWITCH_CLIENT_SECRET!,
  redirectUri: process.env.TWITCH_REDIRECT_URI!,
  scope: ['user:read:email'],
});

Headers

The SDK sets the required headers when fetching user info; ensure TWITCH_CLIENT_ID is configured.
Twitch OAuth | @warpy-auth-sdk/core