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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@onderwijsin/directus-extension-data-sync

v1.4.1

Published

Sync data between multiple Directus instances

Readme

Data sync extension

Create an automated data sync between multiple Directus instances, for one or more collections. These collections need to share (part of) their field schema for this extension to work.

Features

  • 🔄 Keep data in sync between an unlimited number of Directus instances
  • ✍️ Works with create, update, and delete events
  • 🛠 Define shared collection and field schemas for each remote instance
  • 🚨 Notify users when syncing errors occur

You need to install this extension in each of the Directus instances you want synced. You need to repeat the configuration steps for each instance

⚠️ Schema changes

This extension makes modifications to your existing database schema. It adds two collections: data_sync_remote_sources and data_sync_remote_sources_directus_users. It also adds a new user, a new access policy, and assigns this policy to the user (see configuration setp 1 and 3). Neither of these should interfere with any of you existing data.

However, if you don't want this extension to modify your schema, or want more control over field configuration, you can disable it by setting one of these env vars:

DATA_SYNC_DISABLE_SCHEMA_CHANGE="true"
DISABLE_EXTENSION_SCHEMA_CHANGE="true" (globally applied to all @onderwijsin extensions)

If you disable schema modifications, you're responsible for the availability of the necessary collections and fields! Please check the ./schema.ts file for reference.

Configuration pre installation

Make sure you don't have a collection named data_sync_remote_sources or data_sync_remote_sources_directus_users

Installation

Refer to the Official Guide for details on installing the extension from the Marketplace or manually.

Configuration

  1. Navigate to Settings > Access Policies
    • For the policy "Data Sync", add create, update and delete permissions for each of the collection you want to sync.
    • Optional: configure the permitted fields for each collection, though strictly speaking this is not necessary, due to the config you'll provide in the next step
  2. Navigate to the newly created collection Data Sync Remote Sources. For each of the remote instances you want to sync with, create a data source, and provide info for each field:
    • status: Only published sources are synced

    • url: The full URL for the remote instance (for example: https://instance2.directus.io)

    • api_key: The api key for the Data Sync user in the remote instance (see next steps)

    • users_notification: Select which users should receive a notification if a data sync error occurs

    • schema: The data schema you want to sync. Add an array of objects, where each object is a collection to sync, with a list of field keys. Only listed field keys are synced to the remote source! Both props are required.

      [
        {
            "collection": "collection",
            "fields": [
                "field_key"
            ]
        }
      ]
  3. Navigate to Users. Generate a token for the new "Data Sync Directus" user. Copy this token and store it for later
  4. Repeat each of the steps above, for each of the remote sources. Afterwards, you'll need to add the tokens generated in the remote sources to the first instance.

Gotchas

  • Syncing of relationships is not supported
  • You should not use users other then the one created by this extensions to authenticate data sync requests. Doing so would result in an infinite update loop, since the user id is what prevents this.