Skip to content
Migrating from NextAuth.js v4? Read our migration guide.

providers/threads

Built-in Threads integration.

ThreadsProfile

User

Properties

data

data: {
  id: string;
  threads_biography: string;
  threads_profile_picture_url: string;
  username: string;
};
id
id: string;

Unique identifier of this user. This is returned as a string in order to avoid complications with languages and tools that cannot handle large integers.

threads_biography?
optional threads_biography: string;

The text of this user’s profile biography (also known as bio), if the user provided one.

To return this field, add fields=threads_biography in the authorization request’s query parameter.

threads_profile_picture_url?
optional threads_profile_picture_url: string;

The URL to the profile image for this user, as shown on the user’s profile.

To return this field, add fields=threads_profile_picture_url in the authorization request’s query parameter.

username?
optional username: string;

The Threads handle (username) of this user.

To return this field, add fields=username in the authorization request’s query parameter.


default()

default(config): OAuthConfig<ThreadsProfile>

Add Threads login to your page.

Setup

Callback URL

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

Configuration

import { Auth } from "@auth/core"
import Threads from "@auth/core/providers/threads"
 
const request = new Request(origin)
const response = await Auth(request, {
  providers: [
    Threads({
      clientId: THREADS_CLIENT_ID,
      clientSecret: THREADS_CLIENT_SECRET,
    }),
  ],
})

Resources

Notes

⚠️

Email address is not returned by the Threads API.

💡

Threads required callback URL to be configured in your Facebook app and Facebook required 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.

By default, Auth.js assumes that the Threads provider is based on the OAuth 2 specification.

💡

The Threads provider comes with a default configuration. To override the defaults for your use case, check out customizing a built-in OAuth provider.

Disclaimer If you think you found a bug in the default configuration, you can open an issue.

Auth.js strictly adheres to the specification and it cannot take responsibility for any deviation from the spec by the provider. You can open an issue, but if the problem is non-compliance with the spec, we might not pursue a resolution. You can ask for more help in Discussions.

Parameters

ParameterType
configOAuthUserConfig<ThreadsProfile>

Returns

OAuthConfig<ThreadsProfile>

Auth.js © Balázs Orbán and Team - 2024