Skip to content

JMAP 1.0 client library in TypeScript

License

Notifications You must be signed in to change notification settings

qyb/jmap-client-ts

 
 

Repository files navigation

jmap-client-ts

A Jmap Client written in Typescript.

How to use it

Import in in your project (in you package.json), you can reference a commit or a branch to use snapshot versions.

Create the client

let client = new Client({
    accessToken: 'myToken',
    sessionUrl: 'http://jmap.example.com/session,
});

Fetch the session, it will return a promise (of void), the result will be stored on the client and can be accesed later with getSession()

client.fetchSession();

When the fetchSession() promise resolves, you can make requests, the name of the method corresponds to the names in the specs, with lowerCamelCase, and the / replaced by a _, it will return a promise.

client.mailbox_get({
    accountId: Object.keys(jmapClient.getSession().accounts)[0],
    ids: null,
})

About

JMAP 1.0 client library in TypeScript

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 98.8%
  • JavaScript 1.2%