Learn more about our ✨ new ✨ native MCP
Directus Logo
  • Use Cases and Features
    • Headless CMS
      Manage and deliver content with ease
    • Backend-as-a-Service
      Build and ship applications faster
    • Headless Commerce
      A single source of truth for products
    • 100+ More Use Cases
      Build anything (or everything)
    • Instant APIs
      Connect a database, get REST + GraphQL APIs
    • Granular Policy-Based Auth
      Provide secure, autonomous data access
    • Visual Automation Builder
      Automate content and data workflows with ease
    • 50+ More Features
      Get everything you need out-of-the-box
    Project Showcase
    Built With Directus

    Built With Directus

    See what everyone's been building with Directus

  • Learn More
    • Blog
      Read our latest articles and guides
    • Case Studies
      Case studies and success stories
    • Community
      Join our new community forum.
    • Agency Directory
      Browse our list of agency partners
    • About Us
      Learn more about Directus and the team
    • Wall of Love
      See what others are saying about us
    • Contact
      Have a general inquiry or question for us?
    • Support
      Reach out to Directus support
    Watch Directus TV
    Directus TV
    Video

    Directus TV

    Go down the rabbit hole with hours of original video content from our team.

  • Developers
  • Enterprise
  • Pricing
Book a DemoGet StartedLog In
GitHub logo33,617
Directus Marketplace
Marketplace
  1. Extensions
  2. Integrations
  3. Templates
Back to Extensions
endpoint

Sync

This extension exposes routes to manage id mapping for Directus sync.

directus-extension-sync

The directus-sync CLI provides a set of tools for managing and synchronizing the schema and collections within Directus across different environments. It allows to synchronize the following elements: dashboards, flows, folders, operations, panels, permissions, policies, presets, roles, settings and translations.

More information about the directus-sync CLI tool can be found here.

Overview

The directus-extension-sync is an essential extension required for using the directus-sync CLI. It manages the mapping between synchronization identifiers (SyncIDs) and Directus's internal entity IDs. This extension allows directus-sync to perform version control and synchronization tasks across various Directus instances.

Features

  • ID Mapping: Maintains a mapping table linking SyncIDs with Directus's internal IDs.
  • Initialization: Automatically creates the mapping table upon first use.
  • CRUD Operations: Provides endpoints to create, read, update, and delete mappings.

Installation

Installation with NPM

In your Directus installation root, run:

npm install directus-extension-sync

Then, restart Directus.

Use pre-built Docker image

You can use the pre-built Docker image with this extension pre-installed.

This image is available on Docker Hub: tractr/directus-sync.

Installation within custom Docker image

If you prefer to build your own Docker image, you can follow the instructions from this issue: https://github.com/tractr/directus-sync/issues/63#issuecomment-2096657924

Installation with Directus Marketplace

Unfortunately, the extension is not available in the Directus Marketplace out of the box. Directus Marketplace does not support extensions that require a database connection (more details here).

However, you can force Directus Marketplace to show all extensions by setting the MARKETPLACE_TRUST environment variable to all.

MARKETPLACE_TRUST=all

Then, go to the Directus Marketplace and search for the directus-extension-sync extension.

Marketplace installation

Usage

The extension provides a set of RESTful endpoints that are used internally by the directus-sync tool to manage SyncIDs. These endpoints include:

  • GET /directus-extension-sync/table/:table/sync_id/:sync_id: Retrieve a mapping by SyncID.
  • GET /directus-extension-sync/table/:table/local_id/:local_id: Retrieve a mapping by local ID.
  • GET /directus-extension-sync/table/:table: Retrieve all mappings for a table.
  • POST /directus-extension-sync/table/:table: Create a new mapping entry.
  • DELETE /directus-extension-sync/table/:table/sync_id/:sync_id: Remove a mapping by SyncID.
  • DELETE /directus-extension-sync/table/:table/local_id/:local_id: Remove a mapping by local ID.

Helpers

  • DELETE /directus-extension-sync/helpers/permissions/duplicates: Remove conflicts in permissions when there are duplicated groups "policy + collection + action".

Development

Link the package to a development Directus instance:

npm run link /path/to/directus/extensions

The run in development mode:

npm run dev

directus-extension-sync

npm i directus-extension-sync
This extension is not sandboxed and can only be installed in self-hosted instances using npm. Learn more.
edouarddemotes
3.0.1
Works with v11.1.0+
Updated 2 months ago
GPL-3.0 License
116.8 KiB (5 files)
npm
Repository
  • Directus LogoDirectus Logo

    A composable backend to build your Headless CMS, BaaS, and more. 

  • Solutions
    • Headless CMS
    • Backend-as-a-Service
    • Product Information
    • 100+ Things to Build
  • Resources
    • Documentation
    • Guides
    • Community
    • Release Notes
  • Support
    • Issue Tracker
    • Feature Requests
    • Community Chat
    • Cloud Dashboard
  • Organization
    • About
    • Careers
    • Brand Assets
    • Contact
©2025 Monospace Inc
  • Cloud Policies
  • License
  • Terms
  • Privacy