Skip to main content
The Aranx plugin for EmDash receives the Aranx webhook, fetches each article from the Aranx API, and saves it as an EmDash entry. It then reports the entry status and live URL back to Aranx. The plugin is @aranx.com/aranx in the EmDash plugin registry. Its source code is on GitHub.

Before you start

  • Your site runs EmDash 0.12 or later on Cloudflare Workers, with a sandbox runner. This needs the Workers Paid plan, a LOADER Worker Loader binding, and PluginBridge exported from the Worker entry point. See Plugin sandbox.
  • The Worker has a cron trigger that runs every minute (* * * * *). The EmDash Cloudflare templates include it.
  • The site has a collection with a title field and a Portable Text field. The default is posts.
astro.config.mjs

Setup

1

Install the plugin

In the EmDash admin, open Plugins > Registry and search for aranx. Click Install and accept the capabilities.
2

Create an API connection

In Aranx, create an API connection for the website. Copy the API key and the webhook signing secret.
3

Add the keys

In EmDash, open the Aranx plugin settings. Paste the API key and the webhook secret. Change the collection or the category taxonomy if your site does not use posts and category.
4

Set the webhook URL

Open the Aranx page in the EmDash admin and copy the webhook URL. In Aranx, set it as the webhook URL of the API connection. Then click Send test event.
The Aranx page in the EmDash admin shows the number of imported articles and the last sync. Sync now reads the Aranx change feed at once.

What Aranx sends

  • The title, body, excerpt, and featured image. The plugin uploads the image to the EmDash media library.
  • Categories. The plugin creates missing terms in the category taxonomy and assigns them.
  • The SEO title and description, when the entry is created.
The plugin matches entries by the Aranx article ID. When an article changes in Aranx, the plugin updates the same entry. When you delete an article in Aranx, the plugin moves the entry to the trash.

Review drafts

The plugin supports Save as draft. When you pick it as the publishing method, Aranx saves each new article as a draft entry in EmDash. Review and publish it in EmDash, or click Publish in the article menu in Aranx. The plugin never unpublishes a live entry. When an editor publishes, unpublishes, schedules, or deletes an entry in EmDash, the plugin reports the new status to Aranx. If the plugin misses a webhook, it reads the Aranx change feed every 15 minutes and saves changed articles as drafts. From plugin 0.1.6, the plugin handles your site’s own publishing rules, for example a plugin that requires a category. When such a rule refuses a new article, the entry stays a draft and Aranx shows the article as a draft. When it refuses a change to a live entry, the live version stays and Aranx keeps showing it as published. The change waits as a draft in EmDash. Aranx shows the reason on the article page. The plugin also writes it to your Worker logs: Workers Logs in the Cloudflare dashboard, if enabled, or wrangler tail. Fix the entry in EmDash and publish it there, or fix the article in Aranx and publish it again.

Limitations

  • EmDash makes the slug from the title. The plugin cannot set it.
  • Later changes to the SEO title and description do not reach EmDash. EmDash accepts them only when the entry is created.
  • Renamed or deleted Aranx categories keep their old terms in EmDash.
  • EmDash headings have no IDs, so the plugin drops the table of contents.
  • The plugin does not find articles that were deleted in Aranx without a webhook.
For the webhook contract, see the webhook API reference.