@replexica/integration-directus v0.1.9
Replexica Integration for Directus
This is the official Replexica integration for Directus, a headless CMS, enabling automated AI-powered localization within your Directus workflow.
Overview
This integration adds a Replexica operation to Directus CMS that allows you to automatically translate content across 80+ languages using Replexica's AI localization engine.
Configuration
- Install Replexica Extension in your Directus project
- Create a new Flow in Directus with Replexica Extension
- Run the Flow to localize content
1. Set up Replexica Extension
This section is based on the Directus documentation for installing extensions via the npm registry.
Modify docker-compose.yml
Open the docker-compose.yml file of your project and replace the image option with a build section:
- remove the
imageoption:
image: directus/directus:11.x.y- add the
buildsection:
build:
context: ./This allows you to build a customized Docker Image with the added extensions.
Create a Dockerfile
At the root of your project, create a Dockerfile if one doesn't already exist and add the following:
FROM directus/directus:11.x.y
USER root
RUN corepack enable
USER node
RUN pnpm install @replexica/integration-directusBuild the Docker Image
Build your Docker image:
docker compose buildStart the Docker Container
Start your Docker container:
docker compose upOn startup, Directus will automatically load any extension installed in the previous steps.
2. Create a New Flow
- Navigate to the Flows section in Directus CMS.
- Create a new Flow

- Select a Manual trigger, check collections to apply to, and Save.

- Add Confirmation dialog with Target Languages and Save.

- Click '+' to add a new operation and select Replexica Integration for Directus.

- Configure the operation with the required parameters.

- Save the Flow.
3. Run the Flow
Go to Content and run the Flow on the collection to localize your content.

Results
The Flow will automatically translate the content in the selected collection.

Replexica Extension Inputs
The integration provides a Directus operation that accepts the following parameters:
item_id: The ID of the item to translatecollection: The collection containing the contenttranslation_table: The table storing translationslanguage_table: The table containing supported languagesreplexica_api_key: Your Replexica API keysource_language: Source language code (defaults to 'en-US')target_languages: Array of target language codes (example: 'fr-FR', 'de-DE')
Development
To run the integration locally:
# Clone the repo
git clone https://github.com/replexica/replexica
# Install dependencies
cd integrations/directus
pnpm install
# Run dev server
pnpm dev
# Build
pnpm build
# Run tests
pnpm testThe integration can be tested using the included Docker setup:
docker-compose upThis will start Directus at http://localhost:8055.
License
More Information
Support
For questions and support: