directus / directus/docs

Broken TypeScript sample in your homepage hero snippets

Open Beginner friendly
#816 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
22
Forks
82
Avg merge
18h 49m
Merged PRs (30d)
4

Description

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'.

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

Contributor guide

Open the contributing guide

Research direction

Start with the homepage hero partials and inspect both the standard and realtime TypeScript snippets against @directus/sdk@25.0.1. Verify the examples compile after composing the clients as described, then run the existing checker or TypeScript validation; done means both snippets compile without the reported client errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
documentation
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.