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

Slack Provider

Resources

Setup

Callback URL

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

Environment Variables

AUTH_SLACK_ID
AUTH_SLACK_SECRET

Configuration

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

Notes

  • Slack requires that the redirect URL of your app uses https, even for local development. An easy workaround for this is using a service like ngrok that creates a secure tunnel to your app, using https. Remember to set the url as AUTH_URL as well.
Auth.js © Balázs Orbán and Team - 2024