npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

nuxt-directus-sdk

v6.1.2

Published

A Nuxt module for Directus with built-in authentication, realtime, file management, type generation, and visual editor support.

Readme

nuxt-directus-sdk

npm version npm downloads CI Install size Nuxt Care License Nuxt

A Nuxt module for Directus with built-in authentication, realtime, file management, type generation, and visual editor support.

Features

  • 🔒  Session-based authentication with cross-domain support
  • ⚡  Realtime via typed WebSocket subscriptions
  • 📁  File management with @nuxt/image integration
  • ✏️  Visual editor support for @directus/visual-editing
  • 🧩  Auto-generated types from your Directus schema, plus a standalone CLI
  • 📐  Rules DSL for defining and syncing permissions in code
  • 🗂️  Directus admin panel embedded in Nuxt Devtools

Requirements

  • Nuxt 4.0+
  • Directus v11.16.0+ (required by the bundled @directus/visual-editing v2 and @directus/sdk v21)

Quick Setup

  1. Add nuxt-directus-sdk dependency to your project
# Using pnpm
pnpm add -D nuxt-directus-sdk

# Using yarn
yarn add --dev nuxt-directus-sdk

# Using npm
npm install --save-dev nuxt-directus-sdk

# Using bun
bun install --save-dev nuxt-directus-sdk
  1. Add nuxt-directus-sdk to the modules section of nuxt.config.ts
export default defineNuxtConfig({
  modules: ['nuxt-directus-sdk'],
  directus: {
    url: process.env.DIRECTUS_URL,
  },
})
  1. Create a .env file:
DIRECTUS_URL=https://your-directus-url.com
DIRECTUS_ADMIN_TOKEN=your_admin_token # Optional: required for type generation
  1. Configure your Directus backend for cross-domain authentication (see the Authentication Guide)

That's it! You can now use Directus within your Nuxt app ✨

For cross-domain setups (e.g. app.example.com and api.example.com), see the Authentication Guide.

CLI

The module ships with a CLI for type generation and permissions/rules sync that doesn't require a running Nuxt instance. Useful in CI, pre-commit hooks, or quick regeneration during development.

# Generate TypeScript types from a Directus schema
npx nuxt-directus-sdk generate-types --prefix App -o types/directus.d.ts

# Pull permissions/rules to a JSON file
npx nuxt-directus-sdk rules:pull -o rules.json

# See all commands
npx nuxt-directus-sdk --help

See the CLI documentation for flags and examples.

Development

[!IMPORTANT] The playground uses the directus-template-cli cms template. Apply the template with npx directus-template-cli@latest apply and follow the interactive prompts.

# Install dependencies
pnpm install

# Add DIRECTUS_ADMIN_TOKEN to playground .env (don't forget to update your token)
cp ./playground/.env.example ./playground/.env

# Generate type stubs
pnpm run dev:prepare

# Develop with the playground
pnpm run dev

# Build the playground
pnpm run dev:build

# Run ESLint
pnpm run lint

# Run Vitest
pnpm run test
pnpm run test:watch

# Release new version (see RELEASING.md)
pnpm run release

Contributing

Contributions are welcome. Please target the next branch for new features and fixes; main is reserved for stable releases and hotfixes. See RELEASING.md for the release process.