Intuitive Design
An API that gets out of the way, making JMAP easier to use.
Make method calls
An API that gets out of the way, making JMAP easier to use.
Make method calls
Method calls are queued behind the scenes, then sent as one request when awaited.
Control request batches
Subscribing to server state changes is supported out of the box.
Listen for changes
Add support for new capabilities and method calls with minimal fuss.
Add an extension
Comprehensive error classes make failures straightforward to handle.
View errors reference
Rigorously built and tested against the official JMAP standards
View RFCs
Calls made together travel in a single JMAP request, without a round-trip.
import { JsonMetaClient } from "json-meta-client";
const client = new JsonMetaClient({
sessionUrl: "<server>",
auth: "<credentials>",
capabilities: ["mail"],
});
const unread = client.api.Email.query({
filter: { notKeyword: "$seen" },
limit: 5,
});
const emails = await client.api.Email.get({
ids: unread.resultRef("/ids"),
properties: ["subject", "from"],
});
for (const { subject, from } of emails.list) {
console.log(subject, from);
}