PHPackages                             unicodeveloper/novu - 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. [Mail &amp; Notifications](/categories/mail)
4. /
5. unicodeveloper/novu

AbandonedArchivedLibrary[Mail &amp; Notifications](/categories/mail)

unicodeveloper/novu
===================

The Novu PHP SDK

1.2.0(2y ago)84266.9k—2.9%24[8 PRs](https://github.com/novuhq/novu-php/pulls)1MITPHPPHP ^7.2|^8.0

Since Jan 9Pushed 2y ago8 watchersCompare

[ Source](https://github.com/novuhq/novu-php)[ Packagist](https://packagist.org/packages/unicodeveloper/novu)[ RSS](/packages/unicodeveloper-novu/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (9)Dependencies (5)Versions (19)Used By (1)

 [   ![Logo](https://user-images.githubusercontent.com/2233092/213641043-3bbb3f21-3c53-4e67-afe5-755aeb222159.png)  ](https://novu.co)

PHP SDK
=======

[](#php-sdk)

[![Latest Stable Version](https://camo.githubusercontent.com/cf076b2b7f2e951a13af5cb48601c5b39cf1c780a44c26daa6ca828ddf7edd83/68747470733a2f2f706f7365722e707567782e6f72672f756e69636f646576656c6f7065722f6e6f76752f762f737461626c652e737667)](https://packagist.org/packages/unicodeveloper/novu)[![License](https://camo.githubusercontent.com/cb39d148eefc0deca73c290bda26a400bdc86740e0b05774f63b5be354d64b99/68747470733a2f2f706f7365722e707567782e6f72672f756e69636f646576656c6f7065722f6e6f76752f6c6963656e73652e737667)](LICENSE.md)[![Total Downloads](https://camo.githubusercontent.com/e74b20f581f9da37ebadf0e1dec10c5206b5211c80fc65f9d88cd6c2222dbddd/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f756e69636f646576656c6f7065722f6e6f76752e737667)](https://packagist.org/packages/unicodeveloper/novu)

> The [PHP Novu](https://novu.co) SDK and package provides a fluent and expressive interface for interacting with Novu's API and managing notifications.

Installation
------------

[](#installation)

[PHP](https://php.net) 7.2+ and [Composer](https://getcomposer.org) are required.

To get the latest version of Novu PHP SDK, simply require it:

```
composer require unicodeveloper/novu
```

Contents
--------

[](#contents)

- [Installation](#installation)
- [Usage](#usage)
    - [Novu API Reference](https://docs.novu.co/api-reference/)
    - [Events](#events)
    - [Subscribers](#subscribers)
    - [Topics](#topics)
    - [Activity](#activity)
    - [Integrations](#integrations)
    - [Notifications](#notifications)
    - [Notification Templates](#notification-templates)
    - [Notification Groups](#notification-groups)
    - [Changes](#changes)
    - [Environments](#environments)
    - [Feeds](#feeds)
    - [Messages](#messages)
    - [Execution Details](#execution-details)
    - [Tenants](#tenants)
    - [Validate the MX Record setup for Inbound Parse functionality](#validate-the-mx-record-setup-for-inbound-parse-functionality)
- [License](#license)

Usage
-----

[](#usage)

To interact with the **Novu SDK**, you can instantiate it with either just an API key or with a configuration array that includes the API key and a custom base URI.

### Using just the API key:

[](#using-just-the-api-key)

```
use Novu\SDK\Novu;

$novu = new Novu('YOUR_API_KEY_HERE');

// Sign up on https://web.novu.co and grab your API key from https://web.novu.co/settings
```

### Using a configuration array:

[](#using-a-configuration-array)

If you need to specify a custom base URI (e.g., if you are pointing to a staging environment or a local development setup), you can pass an array with the `apiKey` and `baseUri`:

```
use Novu\SDK\Novu;

$config = [
    'apiKey' => 'YOUR_API_KEY_HERE',
    'baseUri' => 'https://custom-api-url.com/v1/'
];

$novu = new Novu($config);

// Get started with self-hosted Novu here https://docs.novu.co/overview/docker-deploy
```

Once the `Novu` instance is created, you can use it to perform all the actions that Novu's API provides.

EVENTS
------

[](#events)

**Trigger** an event - send notification to subscribers:

```
$response = $novu->triggerEvent([
    'name' => '',
    'payload' => ['customVariables' => 'Hello'],
    'to' => [
        'subscriberId' => '',
        'phone' => '07983882186'
    ]
])->toArray();
```

**Bulk Trigger** events:

```
$response = $novu->bulkTriggerEvent([
    [
        'name' => '',
        'to' => '',
        'payload' => ['customVariables' => 'Hello']
    ],
    [
        'name' => '',
        'to' => '',
        'payload' => ['customVariables' => 'World']
    ],
    [
        'name' => '',
        'to' => '',
        'payload' => ['customVariables' => 'Again']
    ]
])->toArray();
```

**Trigger** an event - [send notification to topics](https://docs.novu.co/platform/topics#sending-a-notification-to-a-topic)

```
$response = $novu->triggerEvent([
    'name' => '',
    'payload' => ['customVariables' => 'Hello'],
    'to' => [
        [
            'type' => 'Topic',
            'topicKey' => $topicKey
        ],
        [
            'type' => 'Topic',
            'topicKey' => $topicSecondKey
        ]
    ]
])->toArray();
```

**Broadcast** event to all existing subscribers:

```
$response = $novu->broadcastEvent([
    'name' => '',
    'payload' => ['customVariables' => 'Hello'],
    'transactionId' => ''
])->toArray();
```

**Cancel** triggered event. Using a previously generated transactionId during the event trigger, this action will cancel any active or pending workflows:

```
$response = $novu->cancelEvent($transactionId);
```

SUBSCRIBERS
-----------

[](#subscribers)

```
// Get list of subscribers
$subscribers  = $novu->getSubscriberList();

// Create subscriber & get the details of the recently created subscriber returned.
$subscriber = $novu->createSubscriber([
    'subscriberId' => 'YOUR_SYSTEM_USER_ID>',
    'email' => '', // optional
    'firstName' => '', // optional
    'lastName' => '', // optional
    'phone' => '', //optional
    'avatar' => '', // optional
])->toArray();

// Bulk create subscribers
$response = $novu->bulkCreateSubscribers([
    [
        'subscriberId' => 'SUBSCRIBER_IDENTIFIER>',
        'email' => '', // optional
        'firstName' => '', // optional
        'lastName' => '', // optional
        'avatar' => '', // optional
    ],
    [
        'subscriberId' => 'SUBSCRIBER_IDENTIFIER>',
        'email' => '', // optional
        'firstName' => '', // optional
        'lastName' => '', // optional
        'avatar' => '', // optional
    ],
]);

// Get subscriber
$subscriber = $novu->getSubscriber($subscriberId)->toArray();

// Update subscriber
$subscriber = $novu->updateSubscriber($subscriberId, [
    'email' => '', // optional
    'firstName' => '', // optional
    'lastName' => '', // optional
    'phone' => '', //optional
    'avatar' => '', // optional
])->toArray();

// Delete subscriber
$novu->deleteSubscriber($subscriberId);

// Update subscriber credentials
$response = $novu->updateSubscriberCredentials($subscriberId, [
    'providerId'  => '',
    'credentials' => ''
])->toArray();

// Update subscriber online status
$isOnlineStatus = true; // or false
$response = $novu->updateSubscriberOnlineStatus($subscriberId, $isOnlineStatus)->toArray();

// Get subscriber preferences
$preferences = $novu->getSubscriberPreferences($subscriberId)->toArray();

// Update subscriber preference
$novu->updateSubscriberPreference($subscriberId, $templateId, [
    'channel' => 'insert-channel',
    'enabled' => 'insert-boolean-value' // optional
]);

// Get a notification feed for a particular subscriber
$feed = $novu->getNotificationFeedForSubscriber($subscriberId);

// Get the unseen notification count for subscribers feed
$count = $novu->getUnseenNotificationCountForSubscriber($subscriberId);

// Mark a subscriber feed message as seen
$novu->markSubscriberFeedMessageAsSeen($subscriberId, $messageId, []);

// Mark message action as seen
$novu->markSubscriberMessageActionAsSeen($subscriberId, $messageId, $type, []);
```

TOPICS
------

[](#topics)

```
// Create a Topic
$novu->createTopic([
  'key'  => 'frontend-users',
  'name' => 'All frontend users'
]);

// Fetch all topics
$novu->getTopics();

// Get a topic
$novu->topic($topicKey);

// Add subscribers to a topic
$subscribers = [
    '63e271488c028c44fd3a64e7',
    '3445'
];
$novu->topic($topicKey)->addSubscribers($subscribers);

// Remove subscribers from a topic
$subscribers = [
    '63e271488c028c44fd3a64e7',
    '3445'
];
$novu->topic($topicKey)->removeSubscribers($subscribers);

// Rename a topic
$novu->topic($topicKey)->rename($topicName);
```

ACTIVITY
--------

[](#activity)

```
// Get activity feed
$feed = $novu->getActivityFeed();

// Get activity statistics
$stats = $novu->getActivityStatistics()->toArray();

// Get activity graph statistics
$graphStats = $novu->getActivityGraphStatistics()->toArray();
```

INTEGRATIONS
------------

[](#integrations)

```
// Get integrations
$novu->getIntegrations()->toArray();

// Create integration
$novu->createIntegration([
    'providerId' => 'provider->id>',
    'channel' => 'channel>',
    'credentials' => [
        // insert all the fields
    ],
    'active' => true,
    'check' => true
])->toArray();

// Get active integrations
$novu->getActiveIntegrations()->toArray();

// Get webhook support status for provider
$novu->getWebhookSupportStatusForProvider($providerId)->toArray();

// Update integration
$novu->updateIntegration($integrationId, [
    'active' => true,
    'credentials' => [
        // insert all the fields
    ],
    'check' => true
])->toArray();

// Delete integration
$novu->deleteIntegration($integrationId);
```

LAYOUTS
-------

[](#layouts)

```
// filter layouts
$novu->filterLayouts(['pageSize' => 1])->toArray();

// Create layout
$novu->createLayout([
    'name' => '',
    'identifier' => '',
    'content' => '',
])->toArray();

// Get a layout
$novu->getLayout('')->toArray();

// Set Layout as default
$novu->setLayoutAsDefault('');

// Update layout
$novu->updateLayout('', [
    'name' => '',
    'identifier' => '',
    'content' => '',
])->toArray();

// Delete layout
$novu->deleteLayout('');
```

NOTIFICATIONS
-------------

[](#notifications)

```
// Get all notifications
$novu->getNotifications()->toArray();

// Get all notifications with query parameters
$queryParams = [
    'page' => 3
];
$novu->getNotifications($queryParams)->toArray();

// Get one notification
$novu->getNotification($notificationId)->toArray();

// Get notification stats
$novu->getNotificationStats()->toArray();

// Get Notification graph stats
$novu->getNotificationGraphStats()->toArray();

// Get Notification graph stats with query parameters
$queryParams = [
    'days' => 5
];
$novu->getNotificationGraphStats($queryParams)->toArray();
```

NOTIFICATION TEMPLATES
----------------------

[](#notification-templates)

```
// Get notification templates
$novu->getNotificationTemplates()->toArray();

// Create notification template
$novu->createNotificationTemplate([
  "name" => "name",
  "notificationGroupId" => "notificationGroupId",
  "tags" => ["tags"],
  "description" => "description",
  "steps" => ["steps"],
  "active" => true,
  "draft" => true,
  "critical" => true,
  "preferenceSettings" => preferenceSettings
])->toArray();

// Update notification template
$novu->updateNotificationTemplate($templateId, [
  "name" => "name",
  "tags" => ["tags"],
  "description" => "description",
  "identifier" => "identifier",
  "steps" => ["steps"],
  "notificationGroupId" => "notificationGroupId",
  "active" => true,
  "critical" => true,
  "preferenceSettings" => preferenceSettings
])->toArray();

// Delete notification template
$novu->deleteNotificationTemplate($templateId);

// Get notification template
$novu->getANotificationTemplate($templateId);

// Update notification template status
$novu->updateNotificationTemplateStatus($templateId, [
    'active' => true
])
```

NOTIFICATION GROUPS
-------------------

[](#notification-groups)

```
// Create Notification group
$novu->createNotificationGroup([
    'name' => ''
]);

// Get Notification groups
$novu->getNotificationGroups()->toArray();
```

CHANGES
-------

[](#changes)

```
// Get changes
$novu->getChanges();

// Get changes count
$novu->getChangesCount()->toArray();

// Apply changes
$novu->applyBulkChanges([
    'changeIds' = [
        ''
    ]
])->toArray();

// Apply change
$novu->applyChange($changeId, []);
```

ENVIRONMENTS
------------

[](#environments)

```
// Get current environment
$novu->getCurrentEnvironment()->toArray();

// Create environment
$novu->createEnvironment([
    'name' => '',
    'parentId' => '' // optional
])->toArray();

// Get environments
$novu->getEnvironments()->toArray();

// Update environment by id
$novu->updateEnvironment($envId, [
  "name" => "name",
  "identifier" => "identifier",
  "parentId" => "parentId"
]);

// Get API KEYS
$novu->getEnvironmentsAPIKeys()->toArray();

// Regenerate API KEYS
$key = $novu->regenerateEnvironmentsAPIKeys()->toArray();

// Update Widget Settings
$novu->updateWidgetSettings([
    'notificationCenterEncryption' => true
]);
```

FEEDS
-----

[](#feeds)

```
// Create feed
$novu->createFeed([
    'name' => ''
]);

// Get feeds
$novu->getFeeds()->toArray();

// Delete feed
$novu->deleteFeed();
```

MESSAGES
--------

[](#messages)

```
// Get messages
$novu->getMessages([
    'page' => 1,
    'channel' => [''],
]);

// Delete message
$novu->deleteMessage();
```

EXECUTION DETAILS
-----------------

[](#execution-details)

```
// Get execution details
$novu->getExecutionDetails([
    'notificationId' => '',
    'subscriberId'   => ''
])->toArray();
```

TENANTS
-------

[](#tenants)

```
// Create tenant
$novu->createTenant([
    'identifier' => '',
    'name' => '',
]);

// Get tenants
$novu->getTenants()->toArray();
```

Validate the MX Record setup for Inbound Parse functionality
------------------------------------------------------------

[](#validate-the-mx-record-setup-for-inbound-parse-functionality)

```
// Validate MX Record for Inbound Parse
$novu->validateMXRecordForInboundParse()->toArray();
```

### For more information about these methods and their parameters, see the [API documentation](https://docs.novu.co/api-reference/overview).

[](#for-more-information-about-these-methods-and-their-parameters-see-the-api-documentation)

Contributing
------------

[](#contributing)

Feature requests, bug reports and pull requests are welcome. Please create an [issue](https://github.com/novuhq/novu-php/issues).

Support and Feedback
--------------------

[](#support-and-feedback)

Be sure to visit the Novu official [documentation website](https://docs.novu.co/docs) for additional information about our SDK. If you need additional assistance, join our Discord server [here](https://discord.novu.co).

License
-------

[](#license)

**Novu PHP SDK** was created by **[Prosper Otemuyiwa](https://twitter.com/unicodeveloper)** under the **[MIT license](https://opensource.org/licenses/MIT)**.

###  Health Score

42

—

FairBetter than 90% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity50

Moderate usage in the ecosystem

Community26

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 73.2% 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.

###  Release Activity

Cadence

Every ~36 days

Recently: every ~69 days

Total

11

Last Release

861d ago

Major Versions

1.0.2 → v2.x-dev2023-02-17

### Community

Maintainers

![](https://www.gravatar.com/avatar/ae318eb1f5f21579ddee07834130c1169ae6a0771044c3de671dfb02cd79c59f?d=identicon)[unicodeveloper](/maintainers/unicodeveloper)

---

Top Contributors

[![unicodeveloper](https://avatars.githubusercontent.com/u/2946769?v=4)](https://github.com/unicodeveloper "unicodeveloper (104 commits)")[![Eazybright](https://avatars.githubusercontent.com/u/30163347?v=4)](https://github.com/Eazybright "Eazybright (10 commits)")[![stacksharebot](https://avatars.githubusercontent.com/u/16847878?v=4)](https://github.com/stacksharebot "stacksharebot (6 commits)")[![2002Bishwajeet](https://avatars.githubusercontent.com/u/62933155?v=4)](https://github.com/2002Bishwajeet "2002Bishwajeet (5 commits)")[![ogunsakin01](https://avatars.githubusercontent.com/u/33791201?v=4)](https://github.com/ogunsakin01 "ogunsakin01 (3 commits)")[![Atharva1723](https://avatars.githubusercontent.com/u/87201444?v=4)](https://github.com/Atharva1723 "Atharva1723 (3 commits)")[![Lekso-Surameli](https://avatars.githubusercontent.com/u/73339978?v=4)](https://github.com/Lekso-Surameli "Lekso-Surameli (2 commits)")[![sumitsaurabh927](https://avatars.githubusercontent.com/u/62152915?v=4)](https://github.com/sumitsaurabh927 "sumitsaurabh927 (2 commits)")[![TheAbhishekIN](https://avatars.githubusercontent.com/u/52767864?v=4)](https://github.com/TheAbhishekIN "TheAbhishekIN (2 commits)")[![isaiahdahl](https://avatars.githubusercontent.com/u/23046374?v=4)](https://github.com/isaiahdahl "isaiahdahl (2 commits)")[![kraynel](https://avatars.githubusercontent.com/u/4620699?v=4)](https://github.com/kraynel "kraynel (2 commits)")[![fadkeabhi](https://avatars.githubusercontent.com/u/31249309?v=4)](https://github.com/fadkeabhi "fadkeabhi (1 commits)")

---

Tags

hacktoberfesthacktoberfest-acceptedhacktoberfest2023in-app-notificationsnotification-servicenotificationsnotifications-apinotifications-pluginnovunovu-apiphpphpnotificationsinfrastructurenovu

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/unicodeveloper-novu/health.svg)

```
[![Health](https://phpackages.com/badges/unicodeveloper-novu/health.svg)](https://phpackages.com/packages/unicodeveloper-novu)
```

###  Alternatives

[minishlink/web-push

Web Push library for PHP

1.9k12.0M53](/packages/minishlink-web-push)[paragraph1/php-fcm

PHP application server for google firebase cloud messaging (FCM)

1991.2M10](/packages/paragraph1-php-fcm)[redjanym/php-firebase-cloud-messaging

PHP SDK for Firebase Cloud Messaging from Google

39847.9k1](/packages/redjanym-php-firebase-cloud-messaging)[novu/novu-laravel

Novu for Laravel

12204.3k](/packages/novu-novu-laravel)[tomatophp/filament-accounts

Manage your multi accounts inside your app using 1 table with multi auth and a lot of integrations

748.3k7](/packages/tomatophp-filament-accounts)[usamamuneerchaudhary/filament-notifier

A powerful notification system for FilamentPHP that handles multi-channel notifications with template management, scheduling, and real-time delivery. Built for developers who need enterprise-grade notifications without the complexity.

321.1k](/packages/usamamuneerchaudhary-filament-notifier)

PHPackages © 2026

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