Download the PHP package sebastiankrupinski/jmap-client-php without Composer
On this page you can find all versions of the php package sebastiankrupinski/jmap-client-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download sebastiankrupinski/jmap-client-php
More information about sebastiankrupinski/jmap-client-php
Files in sebastiankrupinski/jmap-client-php
Package jmap-client-php
Short Description Type-safe PHP client for JMAP mail, calendar, contacts, files, and tasks APIs
License AGPL-3.0-only
Homepage https://github.com/SebastianKrupinski/jmap-client-php
Informations about the package jmap-client-php
JMAP PHP Client
A fully-typed JMAP (JSON Meta Application Protocol) client library for PHP.
About
This project provides a type-safe, object-oriented PHP client library for interacting with JMAP servers. JMAP is a modern, JSON-based protocol for accessing email, calendar, and contact data, designed to be more efficient and flexible than traditional protocols like IMAP and CalDAV.
The library is built with PHP 8.0+ strict typing in mind, ensuring robust type safety and excellent IDE support throughout your codebase.
Features
- Broad JMAP Coverage - Request and response types for core, mail, contacts, calendar, files, and tasks workflows
- Type-Safe - Built with PHP 8.0+ strict types for better code quality and IDE support
- Multiple Authentication Methods - Support for Basic auth, bearer tokens, JSON login flows, cookie-backed sessions, and custom authentication schemes
- Session Management - Automatic session discovery, account lookup, and capability negotiation
- Request Bundling - Compose related JMAP method calls into a single round trip
- Transport Diagnostics - Built-in request/response retention and NDJSON-style transport logging for debugging
- Error Handling - Comprehensive transport and JMAP-level error handling
Requirements
- PHP >= 8.0
- ext-json - JSON extension for PHP
- Guzzle HTTP Client >= 7.0
Installation
Install the library using Composer:
Or, if you're manually managing dependencies in your composer.json:
Then run:
Quick Start
Usage Examples
Setting Up a Client with Different Authentication Methods
Basic Authentication
Bearer Token Authentication
Working with Mail
Listing Mailboxes
Fetching Recent Messages from a Mailbox
Working with Contacts
Fetching Address Books
Fetching Specific Contacts
Listing All Contacts in an Address Book
Server Capability Detection
Session Information
Configuration
Transport Settings
Debug Logging
SSL/TLS Certificate Verification
Error Handling
The JMAP client returns ResponseException objects when JMAP-level errors occur. Here's how to handle them:
Common JMAP Error Types
- unknownMethod - The JMAP method is not supported by the server
- invalidArguments - The request contains invalid parameters
- requestTooLarge - The request payload exceeds server size limits
- unsupportedFilter - The filter criteria is not supported
- stateMismatch - The state parameter doesn't match the current server state
- forbidden - The authenticated user does not have permission
- accountNotFound - The specified account was not found
- serverUnavailable - The server is temporarily unavailable
Contributing
Contributions are welcome! Please ensure that:
- Code is properly type-hinted
- Changes include appropriate documentation
For local validation, the most useful project scripts are:
License
This project is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0-only). See the LICENSE file for details.
Author
Sebastian Krupinski
- Email: [email protected]
- GitHub: SebastianKrupinski
Support
For issues, questions, or contributions, please visit the project repository.
Note: This library implements the JMAP specification as defined at https://jmap.io/