airjson
v0.0.1
Published
Data platform for AI agents
Downloads
11
Maintainers
Readme
airjson
Data platform for AI agents. Store and query JSON documents with zero config.
Install
npm install airjsonQuick Start
import { AirJSON } from "airjson";
const aj = new AirJSON({ apiKey: "aj_store_..." });
// Insert a document
const doc = await aj.insert("store-id", "users", {
name: "Alice",
role: "admin",
});
// List documents
const { data } = await aj.list("store-id", "users");
// Get a single document
const user = await aj.get("store-id", "users", doc.id);
// Update a document
await aj.update("store-id", "users", doc.id, {
name: "Alice",
role: "superadmin",
});
// Patch a document
await aj.patch("store-id", "users", doc.id, { role: "member" });
// Delete a document
await aj.delete("store-id", "users", doc.id);CLI
export AIRJSON_API_KEY="aj_store_..."
# Create a store
airjson stores create my-app
# Insert a document
airjson docs insert --store <store-id> --collection users --data '{"name":"Alice"}'
# List documents
airjson docs list --store <store-id> --collection usersAPI Reference
new AirJSON(options)
| Option | Type | Required | Description |
| --------- | -------- | -------- | ------------------------------------------------ |
| apiKey | string | Yes | Your API key |
| baseUrl | string | No | API base URL (default: https://api.airjson.com) |
Store Methods
createStore(name, slug?)- Create a new storelistStores()- List all storesgetStore(storeId)- Get a storedeleteStore(storeId)- Delete a store
Document Methods
insert(storeId, collection, data)- Insert a documentinsertMany(storeId, collection, documents)- Insert multiple documentsget(storeId, collection, docId)- Get a documentlist(storeId, collection, options?)- List documents (supportslimit,offset)update(storeId, collection, docId, data)- Replace a documentpatch(storeId, collection, docId, data)- Partially update a documentdelete(storeId, collection, docId)- Delete a document
Collection Methods
listCollections(storeId)- List all collections in a store
License
MIT - airjson.com
