gainforest-oauth-setup

Automate ATProto OAuth integration in Next.js App Router apps with Supabase session storage.

1|Updated Feb 5, 2026
One-click install
npx skills add https://github.com/GainForest/agent-skills --skill gainforest-oauth-setup
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: gainforest-oauth-setup
Source: https://github.com/GainForest/agent-skills/tree/main/skills/gainforest-oauth-setup
Command: npx skills add https://github.com/GainForest/agent-skills --skill gainforest-oauth-setup

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires jose, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill provides a complete blueprint to integrate ATProto OAuth in a Next.js App Router application using gainforest-sdk-nextjs, covering login, logout, session management, and PDS integration.

Core Features & Use Cases

  • End-to-end OAuth flow with server routes: authorize, callback, session, and logout.
  • Supabase-backed storage for OAuth sessions and temporary states, plus public JWKS and client-metadata endpoints.
  • Local development loopback support and production-ready configuration guidelines for climateai.org and gainforest.id PDS.

Quick Start

Install the required packages and follow the integration steps in the guide to enable ATProto OAuth in your Next.js project.

Frequently Asked Questions about gainforest-oauth-setup

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I set up ATProto OAuth in a Next.js App Router application?

To set up ATProto OAuth in Next.js App Router, this Skill automates the secure integration flow using gainforest-sdk-nextjs, providing server-side helpers, Supabase-backed session storage, and production-ready routes for authorize, callback, logout, and session checks.

Can I use Supabase to manage ATProto OAuth sessions and temporary states?

Yes, you can use Supabase to manage ATProto OAuth sessions. This Skill implements Supabase-backed storage for session management and temporary states, alongside public JWKS and client-metadata endpoints for the OAuth flow.

What is needed to add ATProto authentication flows connecting with GainForest or Hypercerts?

Adding ATProto authentication for GainForest or Hypercerts requires server-side OAuth routes, JWKS endpoints, and client-metadata configuration. This Skill provides the complete blueprint to enable login, logout, and session management using the jose dependency.

Does this ATProto OAuth integration support local development and production environments?

This ATProto OAuth integration supports both local development and production. It includes loopback support for local testing and production-ready configuration guidelines for PDS ecosystems like climateai.org and gainforest.id.

Why do I need JWKS and client-metadata endpoints for ATProto OAuth?

JWKS and client-metadata endpoints are required for ATProto OAuth to securely expose public keys and client configuration. This Skill automates the creation of these public endpoints alongside the core authorize, callback, and logout routes.

What is the best way to handle login and logout flows for ATProto PDS ecosystems in Next.js?

The best way to handle ATProto PDS login and logout flows in Next.js is by implementing dedicated server routes. This Skill provides a production-ready set of routes for authorize, callback, session checks, and logout using Supabase.