Skip to content

Broken TypeScript sample in your homepage hero snippets #816

Description

@David19876543210

I ran a checker over your docs and 2 of the TypeScript samples don't compile
against @directus/sdk@25.0.1 (found via the homepage hero partials, reused
elsewhere). Example:

import { createDirectus, rest, readItems } from '@directus/sdk';
const directus = createDirectus('http://directus.example.com');

const item = await directus.request(
  readItems('articles', { fields: ['id', 'title'] })
);

// TS error: Property 'request' does not exist on type 'DirectusClient<any>'.

The snippet imports rest but never calls .with(rest()) — the bare client
from createDirectus() doesn't have .request() until you compose it in.
Same issue on the realtime hero snippet: it calls .setToken() without
.with(authentication()).

Separately: docs.directus.io/llms-full.txt currently redirects to a dead
Vercel preview URL (404) — probably unrelated, but worth a look.

I think it's drift between the published package and the docs rather than a
mistake in the sample.

I'm building a small CLI that catches this in CI. Two questions if you have a
minute: does this kind of thing get reported to you by users, and is it
something anyone currently owns?

Happy to share the full JSON report if that's useful — just ask.

David

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions