Skip to content
masterclassBuddyTech Buzz5 fresh blogs · 5:00 AM IST

Auth.js · Const

Todoist

Todoist is a built-in Auth.js OAuth provider. Configure it with Todoist client credentials and add the resulting provider configuration to Auth.js.

How it works

Todoist is a built-in Auth.js OAuth provider. Calling it with provider options creates an OAuth configuration that can be supplied in the Auth.js providers list; the default settings handle the standard Todoist OAuth flow, while explicit options can customize the provider.

Syntax

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

Parameters

NameTypeDescription
optionsOAuthUserConfig<P>OAuth provider options, parameterized by a profile type extending TodoistProfile.

Returns

OAuthConfig<P>

Key points

  • Auth.js includes Todoist as a built-in provider, so application code can use the supplied provider factory instead of implementing OAuth manually.
  • The Todoist OAuth callback uses the provider-specific route ending in /callback/todoist.
  • The documented configuration passes Todoist client credentials through the provider factory.
  • Most applications can rely on the provider's predefined OAuth endpoints and settings rather than specifying every OAuth field.
  • Provider defaults can be replaced when the standard Todoist configuration does not fit the application's requirements.

Common mistakes

  • The provider is configured as OAuth 2 by default, so custom protocol behavior should only be added when your use case requires overriding the built-in defaults.

Example: Configure Todoist authentication

import { Auth } from "@auth/core"
import Todoist from "@auth/core/providers/todoist"

const request = new Request(origin)
const response = await Auth(request, {
  providers: [
    Todoist({
      clientId: TODOIST_CLIENT_ID,
      clientSecret: TODOIST_CLIENT_SECRET,
    }),
  ],
})

Registers Todoist as an OAuth provider with its client credentials.

When to use it

Todoist login

Add Todoist as a sign-in option in an Auth.js application.

Default OAuth setup

Use the standard Todoist OAuth endpoints with minimal configuration.

Customized provider configuration

Adapt the built-in provider to application-specific OAuth requirements.

Interview questions

QHow do you register Todoist in Auth.js?

Todoist is added by importing the provider and placing the result of Todoist(options) in the Auth.js providers array. The options shown by the reference are clientId and clientSecret.

Follow-up: What does the provider factory return? It returns an OAuthConfig parameterized by the provider profile type.

QWhat callback URL must Todoist use?

The callback endpoint is https://example.com/api/auth/callback/todoist. The Todoist application must use the corresponding callback URL for the deployed Auth.js base URL.

Follow-up: Why does the final path contain todoist? The provider identifier is part of the callback route used by Auth.js.

QWhat are the Todoist provider function's parameter and return types?

Todoist(options) accepts OAuthUserConfig<P>, where P extends TodoistProfile. It returns OAuthConfig<P>, which Auth.js consumes as a provider configuration.

Follow-up: How can defaults be changed? Supply supported provider options to the factory and customize the built-in OAuth configuration.

  • TodoistProfile
  • OAuthUserConfig
  • OAuthConfig
  • Auth
  • customizing a built-in OAuth provider

Source: Auth.js | Todoist. Checked 2026-10-15.