Skip to main content
The ClientOptions interface defines all configuration options that can be passed to the Client constructor.

Type Definition

Properties

auth
string
The Notion API token or OAuth access token for authentication.Default: undefined (must be provided per-request or set on the client)
logLevel
LogLevel
The minimum log level for console output. Use LogLevel.DEBUG, LogLevel.INFO, LogLevel.WARN, or LogLevel.ERROR.Default: LogLevel.WARN
timeoutMs
number
Request timeout in milliseconds.Default: 60000 (60 seconds)
baseUrl
string
The base URL for the Notion API. Useful for testing or proxying requests.Default: "https://api.notion.com"
logger
Logger
Custom logger function that receives log level, message, and extra information.Default: makeConsoleLogger("@notionhq/client")Type signature:
Example:
notionVersion
string
The Notion API version to use. This sets the Notion-Version header.Default: "2025-09-03" (from Client.defaultNotionVersion)
fetch
SupportedFetch
Custom fetch implementation. Useful for testing or using alternative fetch libraries.Default: fetch (global fetch)Type signature:
Example:
agent
Agent
HTTP agent for Node.js requests. Silently ignored in browser environments.Default: undefinedType: import("node:http").AgentExample:
retry
RetryOptions | false
Configuration for automatic retries on rate limit (429) and server errors. Set to false to disable retries entirely.Default: { maxRetries: 2, initialRetryDelayMs: 1000, maxRetryDelayMs: 60000 }RetryOptions type:
Retry behavior:
  • Rate limits (429) are always retried for all HTTP methods
  • Server errors (500, 503) are only retried for idempotent methods (GET, DELETE)
  • Uses retry-after header when present, otherwise exponential back-off with jitter
Example - custom retry settings:
Example - disable retries:

LogLevel

RetryOptions

See Also