Back to Home

Documentation

Learn how to integrate and use Stet in your Next.js project

Installation

pnpm add @packages/stet

Install Stet in your Next.js project using your preferred package manager.

Configuration

Set up NextAuth with GitHub provider and configure your environment variables:

# .env.local
AUTH_GITHUB_ID=your_github_oauth_app_id
AUTH_GITHUB_SECRET=your_github_oauth_app_secret
AUTH_SECRET=your_random_secret

NEXT_PUBLIC_GITHUB_REPO_OWNER=username
NEXT_PUBLIC_GITHUB_REPO_NAME=repo-name

OPENAI_API_KEY=sk-...
ANTHROPIC_API_KEY=sk-ant-...

Usage

Add Stet to your root layout:

import { Stet } from '@packages/stet'
import '@packages/stet/styles.css'
import { auth } from '@/auth'

export default async function RootLayout({ children }) {
  const session = await auth()
  
  return (
    <html>
      <body>
        {children}
        <Stet accessToken={session?.accessToken} />
      </body>
    </html>
  )
}

API Reference

StetProps

  • repository - GitHub repository configuration
  • branch - Git branch to read from (default: 'main')
  • filePath - File path to edit (auto-detected if not provided)
  • accessToken - GitHub access token from NextAuth

Need help? Check out our GitHub repository

View on GitHub