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 🙏

© 2026 – Pkg Stats / Ryan Hefner

arena-sanity-core

v0.3.1

Published

Framework-agnostic sync engine for Are.na to Sanity

Downloads

401

Readme

arena-sanity-core

Sync Are.na channels to your Sanity dataset.


Quickstart

1. Install

npm install arena-sanity-core @sanity/client are.na

2. Add the schema to your Sanity project

Copy the schema file from this repository into your Sanity project:

# From the arena-sanity-sync repo
cp schemas/arena/arenaBlock.jsx your-sanity-project/schemas/

Or download directly:

Then import it in your schemas/index.js:

import areNaBlock from './arenaBlock'

export const schemaTypes = [areNaBlock]

3. Set environment variables

export ARENA_ACCESS_TOKEN=your-arena-token
export SANITY_PROJECT_ID=your-project-id
export SANITY_DATASET=production
export SANITY_TOKEN=your-sanity-write-token

4. Run your first sync

npx arena-sanity-core -c your-channel-slug -v

Check your Sanity Studio. Your Are.na blocks are now documents.


CLI

npx arena-sanity-core [options]

Options:
  -c, --channels <slugs>    Comma-separated channel slugs (required)
  -i, --image-upload <mode> off, auto, on (default: auto)
  -d, --dry-run             Show what would happen without syncing
  -v, --verbose             Show detailed logs
  -h, --help                Show help
  --version                 Show version

Examples:

# Sync multiple channels
npx arena-sanity-core -c channel-1,channel-2

# Sync without uploading images (faster, uses Are.na URLs)
npx arena-sanity-core -c my-channel -i off

Deployment strategies

| Approach | Best for | |----------|----------| | CLI + cron/CI | Large channels, full image sync | | Serverless endpoint | Small channels, incremental syncs | | Local only | Development, one-time imports |

Timeout limits

| Platform | Limit | |----------|-------| | Vercel Hobby | 10s | | Vercel Pro | 60s | | Netlify | 10-26s | | Cloudflare Workers | 30s | | VPS / CLI | No limit |

Recommended workflow

  1. Run initial sync locally with images: npx arena-sanity-core -c my-channel -i on -v
  2. Set up serverless for incremental syncs with imageUpload: "off"
  3. Incremental syncs skip unchanged blocks automatically

Programmatic usage

import {
  syncArenaChannels,
  createSanityClient,
  createArenaClient,
} from "arena-sanity-core";

const sanity = createSanityClient({
  projectId: process.env.SANITY_PROJECT_ID,
  dataset: process.env.SANITY_DATASET,
  token: process.env.SANITY_TOKEN,
});

const arena = createArenaClient({
  accessToken: process.env.ARENA_ACCESS_TOKEN,
});

const result = await syncArenaChannels({
  arena,
  sanity,
  options: {
    channels: ["my-channel"],
    imageUpload: "auto",
  },
});

console.log(result);
// { success: true, updatedOrCreated: 42, ... }

Nuxt API route

// server/api/sync.post.ts
import { syncArenaChannels, createSanityClient, createArenaClient } from "arena-sanity-core";

export default defineEventHandler(async () => {
  const config = useRuntimeConfig();

  const sanity = createSanityClient({
    projectId: config.sanityProjectId,
    dataset: config.sanityDataset,
    token: config.sanityToken,
  });

  const arena = createArenaClient({
    accessToken: config.arenaAccessToken,
  });

  return await syncArenaChannels({
    arena,
    sanity,
    options: { channels: config.arenaChannels.split(",") },
  });
});

Options

| Option | Default | Description | |--------|---------|-------------| | channels | required | Array of channel slugs | | imageUpload | "auto" | "off" / "auto" / "on" | | timeBudgetMs | Infinity | Stop after N ms | | perPage | 100 | Are.na page size | | retries | 3 | Retry count | | driftFix | true | Remove orphaned channel refs | | onLog | noop | Log callback |


Schema

The sync creates documents of type areNaBlock. The full schema includes:

  • Basic fields (title, image, description)
  • Are.na metadata (blockType, sourceUrl, timestamps)
  • Multi-channel support
  • Field locking (lockAll, lockImage)
  • Raw Are.na data preservation

Schema files:


Related packages


License

MIT