Skip to content
需要从 NextAuth.js v4 升级到最新版本吗?请查阅 版本升级指南

Threads Provider

Resources

Setup

Callback URL

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

Environment Variables

AUTH_THREADS_ID
AUTH_THREADS_SECRET

Configuration

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

Notes

  • Email address is not returned by the Threads API.
  • Threads requires a callback URL to be configured in your Facebook app and Facebook requires you to use https even for localhost. In order to do that, you either need to add an SSL to your localhost or use a proxy such as ngrok.