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

Instagram Provider

Resources

Setup

Callback URL

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

Environment Variables

AUTH_INSTAGRAM_ID
AUTH_INSTAGRAM_SECRET

Configuration

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

Notes

  • Email address is not returned by the Instagram API.
  • Instagram 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.