PHPackages                             jackwh/nylas-v3-api-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. jackwh/nylas-v3-api-php

ActiveLibrary[API Development](/categories/api)

jackwh/nylas-v3-api-php
=======================

Nylas API v3 PHP SDK client

173[1 PRs](https://github.com/JackWH/nylas-v3-api-php/pulls)PHP

Since Sep 15Pushed 1y ago1 watchersCompare

[ Source](https://github.com/JackWH/nylas-v3-api-php)[ Packagist](https://packagist.org/packages/jackwh/nylas-v3-api-php)[ RSS](/packages/jackwh-nylas-v3-api-php/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (2)Used By (0)

Nylas V3 API for PHP
====================

[](#nylas-v3-api-for-php)

PHP API clients for the [Nylas V3 API](https://developer.nylas.com/docs/v3/).

> This is an experimental package and is not officially endorsed by Nylas. I've released this as their PHP SDK [is no longer actively maintained](https://github.com/nylas/nylas-php?tab=readme-ov-file#note-the-nylas-php-sdk-is-currently-not-actively-maintained-and-may-need-some-tlc-however-our-ruby-node-or-python-sdks-are-fully-supported), and the only other PHP clients available are for V2. Please refer to the notes below for how the API clients were generated.

Installation and Usage
----------------------

[](#installation-and-usage)

Install the project using Composer:

```
composer require "jackwh/nylas-v3-api-php":"dev-main"
```

You can then use the relevant API clients like so:

```
use JackWH\NylasV3;

$accessToken = '**********';
$grantId     = '##########';

$api = new NylasV3\EmailCalendar\Api\CalendarApi(
    new \GuzzleHttp\Client(),
    NylasV3\EmailCalendar\Configuration::getDefaultConfiguration()->setAccessToken($accessToken)
);

$result = $api->getCalendars($grantId, limit: 10);
```

In this example you'll receive back a `NylasV3\EmailCalendar\Model\GetCalendars200Response` object, with entries mapped to `NylasV3\EmailCalendar\Model\Calendar` objects. When converted to JSON the output will look something like this:

```
{
    "request_id": "17262346...",
    "data": [
        {
            "name": "My Calendar",
            "timezone": "Europe\/London",
            "hex_color": "#0e61b9",
            "hex_foreground_color": "#ffffff",
            "grant_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
            "id": "example.com_vj9230@group.calendar.google.com",
            "object": "calendar",
            "is_primary": false,
            "read_only": false,
            "is_owned_by_user": true
        },
        {
            "description": "Holidays and Observances in United Kingdom",
            "name": "Holidays in United Kingdom",
            "timezone": "Europe\/London",
            "hex_color": "#711a76",
            "hex_foreground_color": "#ffffff",
            "grant_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
            "id": "en.uk#holiday@group.v.calendar.google.com",
            "object": "calendar",
            "is_primary": false,
            "read_only": true,
            "is_owned_by_user": false
        }
    ],
    "next_cursor": "EiIKDAj..."
}
```

About This Repository
---------------------

[](#about-this-repository)

As there's no official v3 API client for PHP, I've done my best to semi-automatically generate this one. There were a few hoops to jump through, I'm sure there must be an easier/simpler way to do this (if anybody knows, please explain!). Here's how I went about it...

1. Export [OpenAPI specs](https://developer.nylas.com/docs/api/v3/scheduler/) from Nylas' documentation for each API, and save to `api_specs/yaml`.
2. Take the YAML specs and [convert them to JSON](https://onlineyamltools.com/convert-yaml-to-json), place these alongside the originals in `api_specs/yaml`.
3. Due to a [bug in the PHP OpenAPI generator](https://github.com/OpenAPITools/openapi-generator/issues/3136), we need to [dereference `$ref` pointers](https://github.com/APIDevTools/json-schema-ref-parser) using the `npm` script below. This calls the `api_specs/utilities/dereference-json.js` script, which recursively dereferences all `$ref` pointers in each JSON OpenAPI spec. The final JSON specs are saved to `api_specs`:

```
npm run dereference-json
```

4. Finally we can generate client code for each of the APIs using the [OpenAPI Generator](https://openapi-generator.tech):

```
openapi-generator generate -g php-nextgen \
  -o src/api/administration/ \
  -i api_specs/administration.json \
  --openapi-normalizer REF_AS_PARENT_IN_ALLOF=true,REFACTOR_ALLOF_WITH_PROPERTIES_ONLY=true,REMOVE_ANYOF_ONEOF_AND_KEEP_PROPERTIES_ONLY=true \
  --invoker-package="JackWH\\NylasV3\\Administration" \
  --additional-properties=composerPackageName="jackwh/nylas-v3-api-php",variableNamingConvention="snake_case"
```

```
openapi-generator generate -g php-nextgen \
  -o src/api/email-calendar/ \
  -i api_specs/email-calendar.json \
  --openapi-normalizer REF_AS_PARENT_IN_ALLOF=true,REFACTOR_ALLOF_WITH_PROPERTIES_ONLY=true,REMOVE_ANYOF_ONEOF_AND_KEEP_PROPERTIES_ONLY=true \
  --invoker-package="JackWH\\NylasV3\\EmailCalendar" \
  --additional-properties=composerPackageName="jackwh/nylas-v3-api-php",variableNamingConvention="snake_case"
```

```
openapi-generator generate -g php-nextgen \
  -o src/api/scheduler/ \
  -i api_specs/scheduler.json \
  --openapi-normalizer REF_AS_PARENT_IN_ALLOF=true,REFACTOR_ALLOF_WITH_PROPERTIES_ONLY=true,REMOVE_ANYOF_ONEOF_AND_KEEP_PROPERTIES_ONLY=true \
  --invoker-package="JackWH\\NylasV3\\Scheduler" \
  --additional-properties=composerPackageName="jackwh/nylas-v3-api-php",variableNamingConvention="snake_case"
```

Changes to the OpenAPI spec
---------------------------

[](#changes-to-the-openapi-spec)

Any small changes I've made to the OpenAPI specs since first generating the clients are detailed below:

- `email-calendar.yaml`:
    - Remove `"minItems": *"` constraints from Event `participants` and Draft `to` arrays, as the generated client was throwing `InvalidArgumentException`s when trying to serialize these objects. (I assume this was an error from the original spec.)

###  Health Score

17

—

LowBetter than 6% of packages

Maintenance29

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity19

Early-stage or recently created project

 Bus Factor1

Top contributor holds 86.4% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/5b8ec2c075b03ebbc09b01c81dce1be2527833035ffa4bb3365b0962337c77d9?d=identicon)[JackWH](/maintainers/JackWH)

---

Top Contributors

[![jackwh](https://avatars.githubusercontent.com/u/627533?v=4)](https://github.com/jackwh "jackwh (19 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (3 commits)")

### Embed Badge

![Health badge](/badges/jackwh-nylas-v3-api-php/health.svg)

```
[![Health](https://phpackages.com/badges/jackwh-nylas-v3-api-php/health.svg)](https://phpackages.com/packages/jackwh-nylas-v3-api-php)
```

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M480](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[facebook/php-business-sdk

PHP SDK for Facebook Business

90821.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

74513.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

265103.1M454](/packages/google-gax)[google/common-protos

Google API Common Protos for PHP

173103.7M50](/packages/google-common-protos)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
