Files
cozsweet-frontend-nextjs/docs/nextauth/docs/providers/trakt.md
T
admin d70e61f92e refactor(auth): switch to class-based social login and v4 route handler
Migrate from function-based social login helpers (`facebookLogin`, `googleLogin`)
to class-based services (`new FacebookLogin().signIn()`, `new GoogleLogin().signIn()`),
updating call sites in `AuthFacebookPanel` and `SplashButton` with try/catch error
handling. The NextAuth route handler is also refactored to the v4 pattern, importing
pre-built `GET` / `POST` exports from `@/lib/auth/nextauth` instead of constructing
the handler inline with `NextAuth(authOptions)`.
2026-06-10 15:34:52 +08:00

1.2 KiB

id, title
id title
trakt Trakt

Documentation

https://trakt.docs.apiary.io/#reference/authentication-oauth

Configuration

If you're using the api in production by calling api.trakt.tv. Follow the example below. If you wish to develop on Trakt's sandbox environment by calling api-staging.trakt.tv. Use the default options with the changed 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.

Options

The Trakt Provider comes with a set of default options:

You can override any of the options to suit your own use case.

Example

providers: [
  TraktProvider({
    clientId: process.env.TRAKT_ID,
    clientSecret: process.env.TRAKT_SECRET,
  }),
]

:::warning Trakt does not allow hotlinking images. Even the authenticated user's profie picture. :::

:::warning Trakt does not supply the authenticated user's email. :::