You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A TypeScript client for the JMAP protocol (RFC 8620 / RFC 8621), with a pluggable transport layer supporting Fetch, Axios, and XMLHttpRequest.
Features
Full JMAP Mail support: Mailbox, Email, Thread, and EmailSubmission operations
Pluggable transport layer: use the built-in FetchTransport, AxiosTransport, or XmlHttpRequestTransport
Automatic accountId substitution: pass null as accountId and it resolves to the primary account
Session caching: fetch once, reuse across requests
JMAP capability detection from session response
Install
npm install jmap-client-ts
Quick start
import{Client}from'jmap-client-ts';import{FetchTransport}from'jmap-client-ts/lib/utils/fetch-transport';constclient=newClient({sessionUrl: 'https://jmap.example.com/.well-known/jmap',accessToken: 'your-bearer-token',transport: newFetchTransport(fetch),});// Fetch and cache the JMAP sessionawaitclient.fetchSession();// List all mailboxes (pass null for accountId to use the primary account)constmailboxes=awaitclient.mailbox_get({accountId: null,ids: null,});console.log(mailboxes.list);