providers/trakt
default()β
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.
- Trakt does not allow hotlinking images. Even the authenticated user's profie picture.
- Trakt does not supply the authenticated user's email.
The Trakt provider comes with a default configuration. To override the defaults for your use case, check out customizing a built-in OAuth provider.
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.
default<P>(
options
:OAuthUserConfig
<P
>):OAuthConfig
<P
>
Type parametersβ
P
extendsTraktUser
<P
>
Parametersβ
Parameter | Type |
---|---|
options | OAuthUserConfig <P > |
Returnsβ
OAuthConfig
<P
>