Extensions Api Internals
Using Directus Internals
To access systems like permission checks and your collections, you can use internal Directus services, available through an API extension's context parameter.
Error Handling
To create errors in API extensions, you can utilize the @directus/errors package which is available to all extensions without installation.
import { createError, ForbiddenError } from '@directus/errors';
const CustomError = createError('CUSTOM', 'This is a custom error.', 418);
throw new ForbiddenError();
throw new CustomError();
Get once-a-month release notes & real‑world code tips...no fluff. 🐰
Extensions Api
This extension type is loaded into the Directus process. They can use the provided services exported by the @directus/extensions-sdk package and can be written in JavaScript or TypeScript.
Extensions App
This extension type is loaded into the Directus Data Studio. They are are built with Vue 3, and can use the provided composables exported by the @directus/extensions-sdk package. Extensions can be written in JavaScript or TypeScript.