or run

tessl search
Log in

Version

Files

tile.json

task.mdevals/scenario-6/

Configurable Workspace Notion Client

Build a small module that constructs and reuses a Notion client configured with authentication, optional base URL, default time zone, and per-request overrides.

Capabilities

Authenticated client

  • Creating a client with an auth token and active user leads to page fetches that include those credentials when issuing API calls @test

Custom base URL

  • Fetching a page while supplying a base URL uses that host for the request instead of the default workspace endpoint @test

Time zone handling

  • A page fetch with no per-call time zone uses the module's default time zone @test
  • A per-call time zone overrides the module default for that request only @test

Fetch option overrides

  • Per-call fetch options merge with, and can override, the module's default fetch options without mutating stored defaults @test

Implementation

@generates

API

export interface ClientConfig {
  authToken: string;
  activeUser?: string;
  apiBaseUrl?: string;
  defaultTimeZone?: string;
  defaultOfetchOptions?: Record<string, unknown>;
}

export interface RequestOptions {
  pageId: string;
  timeZone?: string;
  apiBaseUrl?: string;
  ofetchOptions?: Record<string, unknown>;
}

export function createClient(config: ClientConfig): unknown;
export function fetchPageWithClient(client: unknown, options: RequestOptions): Promise<unknown>;

Dependencies { .dependencies }

notion-client { .dependency }

Provides a client for interacting with Notion workspaces, including authentication, base URL, and time zone settings.