Skip to main content

providers/trakt

Built-in Trakt integration.

default()​

default<P>(options): OAuthConfig< P >

Add Trakt login to your page.

Setup​

Callback URL​

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

Configuration​

import Auth from "@auth/core"
import Trakt from "@auth/core/providers/trakt"

const request = new Request(origin)
const response = await Auth(request, {
providers: [Trakt({ clientId: TRAKT_CLIENT_ID, clientSecret: TRAKT_CLIENT_SECRET })],
})

Resources​

If you're using the api in production by calling api.trakt.tv. Follow the example. If you wish to develop on Trakt's sandbox environment by calling api-staging.trakt.tv, change the URLs.

Start by creating an OAuth app on Trakt for production or development. Then set the Client ID and Client Secret as TRAKT_ID and TRAKT_SECRET in .env.

Notes​

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

danger
  • Trakt does not allow hotlinking images. Even the authenticated user's profie picture.
  • Trakt does not supply the authenticated user's email.
tip

The Trakt 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.

Type parameters​

β–ͺ P extends TraktUser

Parameters​

β–ͺ options: OAuthUserConfig< P >

Returns​

OAuthConfig< P >