sanity-plugin-arena-sync
v1.0.7
Published
Sanity Studio v3 plugin for Are.na sync dashboard
Maintainers
Readme
sanity-plugin-arena-sync
Sanity Studio v3 plugin for the Are.na sync dashboard.
Features
- Shows configured Are.na channel slugs
- Displays last sync status and timestamp
- Manual sync trigger button (calls your backend endpoint)
- Auto-refreshes when configuration changes
This plugin is part of the arena-sanity-sync ecosystem.
Installation
npm install sanity-plugin-arena-syncAdd it to your sanity.config.ts:
import { defineConfig } from "sanity";
import { arenaSyncPlugin } from "sanity-plugin-arena-sync";
export default defineConfig({
// ...
plugins: [arenaSyncPlugin()],
});Configuration
The plugin does not perform syncs directly. It POSTs to an HTTP endpoint you host (Nuxt, Next.js, Cloudflare Worker, etc.) that runs arena-sanity-core.
Option 1: Configuration document (recommended)
Create a document with ID arenaSyncConfig containing:
channelSlugs- array of Are.na channel slugs to syncsyncEndpoint- URL to POST to when triggering sync
A ready-to-use schema is available at:
schemas/arena/arenaSyncConfig.jsCopy it to your Studio's schemas/ folder and import it:
import arenaSyncConfig from "./arena/arenaSyncConfig";
export const schemaTypes = [arenaSyncConfig];Option 2: Environment variable
Set in your Studio environment:
SANITY_STUDIO_SYNC_ENDPOINT=https://your-app.xyz/api/syncThe plugin will POST to this URL when an editor clicks "Trigger Full Sync Now".
Sync endpoint requirements
Your endpoint should:
- Accept POST requests
- Call
syncArenaChannels()fromarena-sanity-core - Return a JSON response with
success: boolean - Optionally check authorization (e.g.,
Authorization: Bearer <secret>)
Example implementation: see arena-sanity-adapter-nuxt.
Testing the endpoint
curl -X POST "$SANITY_STUDIO_SYNC_ENDPOINT" \
-H "Authorization: Bearer $SYNC_CRON_SECRET" \
-H "Content-Type: application/json" \
-d '{"test": true}'Development
This plugin uses @sanity/plugin-kit.
# Install dependencies
npm install
# Build
npm run build
# Lint
npm run lintSee Testing a plugin in Sanity Studio for local development instructions.
Related packages
- arena-sanity-core - sync engine
- arena-sanity-adapter-nuxt - Nuxt 3 API route
License
MIT - Bartek Pierscinski
