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
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:
The snippet imports
restbut never calls.with(rest())— the bare clientfrom
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