Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/michael-tiger-2010/dragonjson/llms.txt

Use this file to discover all available pages before exploring further.

dragonJSON is a JavaScript client library that turns a structured HTTP endpoint into a navigable object. Access deeply nested data with plain property traversal — dragonJSON handles fetching, caching, request batching, and real-time invalidation so your application code stays simple and declarative.

Quickstart

Get your first dragonJSON client running in under five minutes.

Installation

Import from source or add to your project.

API Reference

Complete reference for every client method and option.

Server Protocol

Build a compatible server in any language using the protocol spec.

How it works

dragonJSON wraps your API endpoint in a JavaScript Proxy. Every property access you write is intercepted — when you await the result, the client looks up the path in its local cache, fetches any missing segment from the server, and returns the value. Parent responses automatically populate the cache for their children, so repeated deep access is instant.
import dragonJSON from './client/web-client.js';

const [server] = dragonJSON("https://api.example.com/data", {
  auth: "Bearer my-token",
  enableBatching: true,
});

// Fetches only what you access
const title = await server.posts.page1.title;

// Children resolved from cache — no second request
const body = await server.posts.page1.body;

Key features

Lazy Loading

Fetch only the data you actually access, not the entire dataset.

Automatic Caching

Parent fetches populate children. Subsequent reads are instant.

Request Batching

Concurrent reads coalesce into a single HTTP round trip automatically.

Live Sync

Keep all clients in sync via WebSocket relay with zero extra boilerplate.

Mutations

set,set, add, and $remove with server-driven cache invalidation.

Event System

Subscribe to changes at any path with direct or bubbling listeners.
1

Import the client

Copy client/web-client.js into your project or import it directly as an ES module.
2

Initialize with your endpoint

Call dragonJSON(url, options) and destructure the [server, control] tuple.
3

Read data with await

Access any path with normal property chaining and await to resolve the value.
4

Mutate with $ methods

Use $set, $add, and $remove to write data. The server returns invalidation hints and the cache updates automatically.

Build docs developers (and LLMs) love