This example demonstrates how to register additional capabilities with the client so that non‑Core invocations can be constructed and validated. It uses FastMail's Masked Email capability, which is a vendor-specific extension.
MaskedEmail capability with client.registerCapabilities(...)MaskedEmail/get requestCreate a .env file in the repo root or export these variables in your shell:
JMAP_BEARER_TOKEN=your-token
JMAP_HOSTNAME=api.fastmail.com
JMAP_LOG_LEVEL=info
Clone the jmap-kit repository, then from the repo root:
yarn tsx examples/capability-registration/maskedemail.ts
The example builds a MaskedEmail/get request. Because the MaskedEmail capability is a vendor extension, the using array includes both the core URI and the vendor URI:
{
"using": ["urn:ietf:params:jmap:core", "https://www.fastmail.com/dev/maskedemail"],
"methodCalls": [
[
"MaskedEmail/get",
{
"accountId": "u1234",
"ids": null,
"properties": ["id", "email", "state"]
},
"id_0"
]
]
}
Passing ids: null requests all objects of that type. The server returns a MaskedEmail/get response with a list array containing each masked email object.