Skip to content

Resource Hub

Directus Documentation

Explore our resources and powerful data engine to build your projects confidently.

js
import { createDirectus, rest, readItems } from '@directus/sdk';
const client = createDirectus('https://xyz.directus.app').with(rest());

const item = await client.request(
	readItems('articles', {
		fields: ['id', 'title', 'date_published', 'summary']
	})
);
import { createDirectus, rest, readItems } from '@directus/sdk';
const client = createDirectus('https://xyz.directus.app').with(rest());

const item = await client.request(
	readItems('articles', {
		fields: ['id', 'title', 'date_published', 'summary']
	})
);
js
import { createDirectus, rest, createItem } from '@directus/sdk';
const client = createDirectus('https://xyz.directus.app').with(rest());

const item = await client.request(
	createItem('articles', {
		title: 'Hello, world!',
		summary: 'This is my next big thing.'
	})
);
import { createDirectus, rest, createItem } from '@directus/sdk';
const client = createDirectus('https://xyz.directus.app').with(rest());

const item = await client.request(
	createItem('articles', {
		title: 'Hello, world!',
		summary: 'This is my next big thing.'
	})
);
js
import { createDirectus, rest, createUser, authentication } from '@directus/sdk';
const client = createDirectus('https://xyz.directus.app').with(rest()).with(authentication());

const newUser = await client.request(
	createUser({
		email: 'user@example.com',
		password: 'd1r3ctu5'
	})
);

const user = await client.login('user@example.com', 'd1r3ctu5');
import { createDirectus, rest, createUser, authentication } from '@directus/sdk';
const client = createDirectus('https://xyz.directus.app').with(rest()).with(authentication());

const newUser = await client.request(
	createUser({
		email: 'user@example.com',
		password: 'd1r3ctu5'
	})
);

const user = await client.login('user@example.com', 'd1r3ctu5');
js
import { createDirectus, realtime } from '@directus/sdk'
const client = createDirectus('https://xyz.directus.app').with(realtime({ authMode: 'public' }));

const { subscription } = await client.subscribe('messages');

for await (const item of subscription) {
	console.log(item);
}
import { createDirectus, realtime } from '@directus/sdk'
const client = createDirectus('https://xyz.directus.app').with(realtime({ authMode: 'public' }));

const { subscription } = await client.subscribe('messages');

for await (const item of subscription) {
	console.log(item);
}

Latest From The Blog

Project tutorials, tips & tricks, and best practices from the Directus team and community.

We 💜 Your Framework

Combine Directus with your favorite framework to create flexible and fast web applications.

Next.js
Nuxt
Astro
SvelteKit
SolidStart
Gastby
Eleventy
Remix

Self Hosted Directus

Learn how to run Directus on your own machine, customize settings, and deploy with confidence.

Contributing to Directus

There are many ways in which you can contribute to the health and growth of the Directus project.