Skip to content
Migrating from NextAuth.js v4? Read our migration guide.
Getting Started
Providers
Mastodon

Mastodon Provider

Resources

Setup

Callback URL

https://example.com/api/auth/callback/mastodon

Environment Variables

AUTH_MASTODON_ID
AUTH_MASTODON_SECRET
AUTH_MASTODON_ISSUER

Configuration

/auth.ts
import NextAuth from "next-auth"
import Mastodon from "next-auth/providers/mastodon"
 
export const { handlers, auth, signIn, signOut } = NextAuth({
  providers: [Mastodon],
})

Notes

  • Due to the way Mastodon is architected, you have to define the issuer to be the instance URL against which you want to authenticate
Auth.js © Balázs Orbán and Team - 2024