Download the PHP package novuhq/novu without Composer
On this page you can find all versions of the php package novuhq/novu. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package novu
The <Inbox /> infrastructure for modern products
The notification platform that turns complex multi-channel delivery into a single component. Built for developers, designed for growth, powered by open source.
Novu PHP SDK
The PHP Novu SDK and package provides a fluent and expressive interface for interacting with Novu's API and managing notifications.
Developer-friendly & type-safe Php SDK specifically catered to leverage novuhq/novu API.
[!IMPORTANT] This SDK is not yet ready for production use. To complete setup please follow the steps outlined in your workspace. Delete this section before > publishing to a package manager.
Summary
Novu API: Novu REST API. Please see https://docs.novu.co/api-reference for more details.
For more information about the API: Novu Documentation
Table of Contents
- Novu PHP SDK
- SDK Installation
- SDK Example Usage
- Authentication
- Available Resources and Operations
- Retries
- Error Handling
- Server Selection
- Development
- Maturity
- Contributions
SDK Installation
The SDK relies on Composer to manage its dependencies.
To install the SDK and add it as a dependency to an existing composer.json file:
SDK Example Usage
Trigger Notification Event
Cancel Triggered Event
Broadcast Event to All
Trigger Notification Events in Bulk
Send an agent reply
Authentication
Per-Client Security Schemes
This SDK supports the following security scheme globally:
| Name | Type | Scheme |
|---|---|---|
secretKey |
apiKey | API key |
To authenticate with the API the secretKey parameter must be set when initializing the SDK. For example:
Available Resources and Operations
Available methods
### [Novu SDK](docs/sdks/novu/README.md) * [trigger](docs/sdks/novu/README.md#trigger) - Trigger event * [cancel](docs/sdks/novu/README.md#cancel) - Cancel triggered event * [triggerBroadcast](docs/sdks/novu/README.md#triggerbroadcast) - Broadcast event to all * [triggerBulk](docs/sdks/novu/README.md#triggerbulk) - Bulk trigger event ### [Activity](docs/sdks/activity/README.md) * [track](docs/sdks/activity/README.md#track) - Track provider activity and engagement events ### [Agents](docs/sdks/agents/README.md) * [create](docs/sdks/agents/README.md#create) - Create an agent * [list](docs/sdks/agents/README.md#list) - List all agents * [sendReply](docs/sdks/agents/README.md#sendreply) - Send an agent reply * [retrieve](docs/sdks/agents/README.md#retrieve) - Retrieve an agent * [update](docs/sdks/agents/README.md#update) - Update an agent * [delete](docs/sdks/agents/README.md#delete) - Delete an agent * [updateBridge](docs/sdks/agents/README.md#updatebridge) - Update an agent bridge #### [Agents.Integrations](docs/sdks/novuintegrations/README.md) * [create](docs/sdks/novuintegrations/README.md#create) - Create an agent integration * [list](docs/sdks/novuintegrations/README.md#list) - List agent integrations * [update](docs/sdks/novuintegrations/README.md#update) - Update an agent integration * [delete](docs/sdks/novuintegrations/README.md#delete) - Delete an agent integration ### [ChannelConnections](docs/sdks/channelconnections/README.md) * [list](docs/sdks/channelconnections/README.md#list) - List all channel connections * [create](docs/sdks/channelconnections/README.md#create) - Create a channel connection * [retrieve](docs/sdks/channelconnections/README.md#retrieve) - Retrieve a channel connection * [update](docs/sdks/channelconnections/README.md#update) - Update a channel connection * [delete](docs/sdks/channelconnections/README.md#delete) - Delete a channel connection ### [ChannelEndpoints](docs/sdks/channelendpoints/README.md) * [list](docs/sdks/channelendpoints/README.md#list) - List all channel endpoints * [create](docs/sdks/channelendpoints/README.md#create) - Create a channel endpoint * [retrieve](docs/sdks/channelendpoints/README.md#retrieve) - Retrieve a channel endpoint * [update](docs/sdks/channelendpoints/README.md#update) - Update a channel endpoint * [delete](docs/sdks/channelendpoints/README.md#delete) - Delete a channel endpoint ### [Contexts](docs/sdks/contexts/README.md) * [create](docs/sdks/contexts/README.md#create) - Create a context * [list](docs/sdks/contexts/README.md#list) - List all contexts * [update](docs/sdks/contexts/README.md#update) - Update a context * [retrieve](docs/sdks/contexts/README.md#retrieve) - Retrieve a context * [delete](docs/sdks/contexts/README.md#delete) - Delete a context ### [Domains](docs/sdks/domains/README.md) * [list](docs/sdks/domains/README.md#list) - List domains for an environment * [create](docs/sdks/domains/README.md#create) - Create a domain * [retrieve](docs/sdks/domains/README.md#retrieve) - Retrieve a domain by name * [update](docs/sdks/domains/README.md#update) - Update a domain * [delete](docs/sdks/domains/README.md#delete) - Delete a domain * [diagnose](docs/sdks/domains/README.md#diagnose) - Diagnose inbound DNS for a domain * [verify](docs/sdks/domains/README.md#verify) - Verify a domain #### [Domains.AutoConfigure](docs/sdks/autoconfigure/README.md) * [retrieve](docs/sdks/autoconfigure/README.md#retrieve) - Retrieve auto-configuration availability * [start](docs/sdks/autoconfigure/README.md#start) - Start DNS auto-configuration #### [Domains.Routes](docs/sdks/routes/README.md) * [list](docs/sdks/routes/README.md#list) - List routes for a domain * [create](docs/sdks/routes/README.md#create) - Create a route * [retrieve](docs/sdks/routes/README.md#retrieve) - Retrieve a route by address * [update](docs/sdks/routes/README.md#update) - Update a route * [delete](docs/sdks/routes/README.md#delete) - Delete a route * [test](docs/sdks/routes/README.md#test) - Test an inbound route ### [EnvironmentVariables](docs/sdks/environmentvariables/README.md) * [list](docs/sdks/environmentvariables/README.md#list) - List all variables * [create](docs/sdks/environmentvariables/README.md#create) - Create a variable * [retrieve](docs/sdks/environmentvariables/README.md#retrieve) - Get environment variable * [update](docs/sdks/environmentvariables/README.md#update) - Update a variable * [delete](docs/sdks/environmentvariables/README.md#delete) - Delete environment variable * [usage](docs/sdks/environmentvariables/README.md#usage) - Retrieve a variable usage ### [Environments](docs/sdks/environments/README.md) * [getTags](docs/sdks/environments/README.md#gettags) - List environment tags * [diff](docs/sdks/environments/README.md#diff) - Compare resources between environments * [publish](docs/sdks/environments/README.md#publish) - Publish resources to target environment * [create](docs/sdks/environments/README.md#create) - Create an environment * [list](docs/sdks/environments/README.md#list) - List all environments * [update](docs/sdks/environments/README.md#update) - Update an environment * [delete](docs/sdks/environments/README.md#delete) - Delete an environment ### [Integrations](docs/sdks/integrations/README.md) * [list](docs/sdks/integrations/README.md#list) - List all integrations * [create](docs/sdks/integrations/README.md#create) - Create an integration * [update](docs/sdks/integrations/README.md#update) - Update an integration * [delete](docs/sdks/integrations/README.md#delete) - Delete an integration * [integrationsControllerAutoConfigureIntegration](docs/sdks/integrations/README.md#integrationscontrollerautoconfigureintegration) - Auto-configure an integration for inbound webhooks * [setAsPrimary](docs/sdks/integrations/README.md#setasprimary) - Update integration as primary * [createMobileLink](docs/sdks/integrations/README.md#createmobilelink) - Issue a short-lived mobile setup link for an existing integration * [integrationsControllerConfigureIntegrationWebhook](docs/sdks/integrations/README.md#integrationscontrollerconfigureintegrationwebhook) - Configure a chat integration webhook * [listActive](docs/sdks/integrations/README.md#listactive) - List active integrations * [generateConnectOAuthUrl](docs/sdks/integrations/README.md#generateconnectoauthurl) - Generate OAuth URL for a workspace/tenant connection * [linkChannelEndpoint](docs/sdks/integrations/README.md#linkchannelendpoint) - Issue a URL to link a subscriber chat identity * [generateLinkUserOAuthUrl](docs/sdks/integrations/README.md#generatelinkuseroauthurl) - Generate OAuth URL to link a subscriber user identity * [~~generateChatOAuthUrl~~](docs/sdks/integrations/README.md#generatechatoauthurl) - Generate chat OAuth URL :warning: **Deprecated** ### [Layouts](docs/sdks/layouts/README.md) * [create](docs/sdks/layouts/README.md#create) - Create a layout * [list](docs/sdks/layouts/README.md#list) - List all layouts * [update](docs/sdks/layouts/README.md#update) - Update a layout * [retrieve](docs/sdks/layouts/README.md#retrieve) - Retrieve a layout * [delete](docs/sdks/layouts/README.md#delete) - Delete a layout * [duplicate](docs/sdks/layouts/README.md#duplicate) - Duplicate a layout * [generatePreview](docs/sdks/layouts/README.md#generatepreview) - Generate layout preview * [usage](docs/sdks/layouts/README.md#usage) - Get layout usage ### [Messages](docs/sdks/messages/README.md) * [get](docs/sdks/messages/README.md#get) - List all messages * [delete](docs/sdks/messages/README.md#delete) - Delete a message * [deleteByTransactionId](docs/sdks/messages/README.md#deletebytransactionid) - Delete messages by transactionId ### [Notifications](docs/sdks/notifications/README.md) * [list](docs/sdks/notifications/README.md#list) - List all events * [get](docs/sdks/notifications/README.md#get) - Retrieve an event ### [Subscribers](docs/sdks/subscribers/README.md) * [search](docs/sdks/subscribers/README.md#search) - Search subscribers * [create](docs/sdks/subscribers/README.md#create) - Create a subscriber * [get](docs/sdks/subscribers/README.md#get) - Retrieve a subscriber * [patch](docs/sdks/subscribers/README.md#patch) - Update a subscriber * [delete](docs/sdks/subscribers/README.md#delete) - Delete a subscriber * [createBulk](docs/sdks/subscribers/README.md#createbulk) - Bulk create subscribers * [updatePreferences](docs/sdks/subscribers/README.md#updatepreferences) - Update subscriber preferences * [updateCredentials](docs/sdks/subscribers/README.md#updatecredentials) - Update provider credentials * [updateOnlineStatus](docs/sdks/subscribers/README.md#updateonlinestatus) - Update subscriber online status #### [Subscribers.Notifications](docs/sdks/novunotifications/README.md) * [list](docs/sdks/novunotifications/README.md#list) - Retrieve subscriber notifications * [delete](docs/sdks/novunotifications/README.md#delete) - Delete a notification * [completeAction](docs/sdks/novunotifications/README.md#completeaction) - Complete a notification action * [revertAction](docs/sdks/novunotifications/README.md#revertaction) - Revert a notification action * [archive](docs/sdks/novunotifications/README.md#archive) - Archive a notification * [markAsRead](docs/sdks/novunotifications/README.md#markasread) - Mark a notification as read * [snooze](docs/sdks/novunotifications/README.md#snooze) - Snooze a notification * [unarchive](docs/sdks/novunotifications/README.md#unarchive) - Unarchive a notification * [markAsUnread](docs/sdks/novunotifications/README.md#markasunread) - Mark a notification as unread * [unsnooze](docs/sdks/novunotifications/README.md#unsnooze) - Unsnooze a notification * [archiveAll](docs/sdks/novunotifications/README.md#archiveall) - Archive all notifications * [count](docs/sdks/novunotifications/README.md#count) - Retrieve subscriber notifications count * [deleteAll](docs/sdks/novunotifications/README.md#deleteall) - Delete all notifications * [markAllAsRead](docs/sdks/novunotifications/README.md#markallasread) - Mark all notifications as read * [archiveAllRead](docs/sdks/novunotifications/README.md#archiveallread) - Archive all read notifications * [markAsSeen](docs/sdks/novunotifications/README.md#markasseen) - Mark notifications as seen * [~~getFeed~~](docs/sdks/novunotifications/README.md#getfeed) - Retrieve subscriber notifications :warning: **Deprecated** #### [Subscribers.Preferences](docs/sdks/preferences/README.md) * [bulkUpdate](docs/sdks/preferences/README.md#bulkupdate) - Bulk update subscriber preferences #### [Subscribers.Topics](docs/sdks/novutopics/README.md) * [list](docs/sdks/novutopics/README.md#list) - Retrieve subscriber subscriptions ### [~~Subscribers.Messages~~](docs/sdks/novumessages/README.md) * [~~updateAsSeen~~](docs/sdks/novumessages/README.md#updateasseen) - Update notification action status :warning: **Deprecated** * [~~markAllAs~~](docs/sdks/novumessages/README.md#markallas) - Update notifications state :warning: **Deprecated** ### [SubscribersCredentials](docs/sdks/subscriberscredentials/README.md) * [append](docs/sdks/subscriberscredentials/README.md#append) - Upsert provider credentials * [deleteProvider](docs/sdks/subscriberscredentials/README.md#deleteprovider) - Delete provider credentials ### [~~SubscribersMessages~~](docs/sdks/subscribersmessages/README.md) * [~~markAll~~](docs/sdks/subscribersmessages/README.md#markall) - Update all notifications state :warning: **Deprecated** ### [~~SubscribersNotifications~~](docs/sdks/subscribersnotifications/README.md) * [~~getUnseenCount~~](docs/sdks/subscribersnotifications/README.md#getunseencount) - Retrieve unseen notifications count :warning: **Deprecated** ### [SubscribersPreferences](docs/sdks/subscriberspreferences/README.md) * [list](docs/sdks/subscriberspreferences/README.md#list) - Retrieve subscriber preferences ### [Topics](docs/sdks/topics/README.md) * [list](docs/sdks/topics/README.md#list) - List all topics * [create](docs/sdks/topics/README.md#create) - Create a topic * [get](docs/sdks/topics/README.md#get) - Retrieve a topic * [update](docs/sdks/topics/README.md#update) - Update a topic * [delete](docs/sdks/topics/README.md#delete) - Delete a topic #### [Topics.Subscriptions](docs/sdks/subscriptions/README.md) * [list](docs/sdks/subscriptions/README.md#list) - List topic subscriptions * [create](docs/sdks/subscriptions/README.md#create) - Create topic subscriptions * [delete](docs/sdks/subscriptions/README.md#delete) - Delete topic subscriptions * [getSubscription](docs/sdks/subscriptions/README.md#getsubscription) - Retrieve a topic subscription * [update](docs/sdks/subscriptions/README.md#update) - Update a topic subscription ### [TopicsSubscribers](docs/sdks/topicssubscribers/README.md) * [check](docs/sdks/topicssubscribers/README.md#check) - Check topic subscriber ### [Translations](docs/sdks/translations/README.md) * [create](docs/sdks/translations/README.md#create) - Create a translation * [retrieve](docs/sdks/translations/README.md#retrieve) - Retrieve a translation * [delete](docs/sdks/translations/README.md#delete) - Delete a translation * [upload](docs/sdks/translations/README.md#upload) - Upload translation files #### [Translations.Groups](docs/sdks/groups/README.md) * [delete](docs/sdks/groups/README.md#delete) - Delete a translation group * [retrieve](docs/sdks/groups/README.md#retrieve) - Retrieve a translation group #### [Translations.Master](docs/sdks/master/README.md) * [retrieve](docs/sdks/master/README.md#retrieve) - Retrieve master translations JSON * [import](docs/sdks/master/README.md#import) - Import master translations JSON * [upload](docs/sdks/master/README.md#upload) - Upload master translations JSON file ### [Workflows](docs/sdks/workflows/README.md) * [create](docs/sdks/workflows/README.md#create) - Create a workflow * [list](docs/sdks/workflows/README.md#list) - List all workflows * [update](docs/sdks/workflows/README.md#update) - Update a workflow * [get](docs/sdks/workflows/README.md#get) - Retrieve a workflow * [delete](docs/sdks/workflows/README.md#delete) - Delete a workflow * [patch](docs/sdks/workflows/README.md#patch) - Update a workflow * [sync](docs/sdks/workflows/README.md#sync) - Sync a workflow #### [Workflows.Steps](docs/sdks/steps/README.md) * [generatePreview](docs/sdks/steps/README.md#generatepreview) - Generate a step preview * [retrieve](docs/sdks/steps/README.md#retrieve) - Retrieve workflow stepRetries
Some of the endpoints in this SDK support retries. If you use the SDK without any configuration, it will fall back to the default retry strategy provided by the API. However, the default retry strategy can be overridden on a per-operation basis, or across the entire SDK.
To change the default retry strategy for a single API call, simply provide an Options object built with a RetryConfig object to the call:
If you'd like to override the default retry strategy for all operations that support retries, you can pass a RetryConfig object to the SDKBuilder->setRetryConfig function when initializing the SDK:
Error Handling
Handling errors in this SDK should largely match your expectations. All operations return a response object or throw an exception.
By default an API error will raise a Errors\APIException exception, which has the following properties:
| Property | Type | Description |
|---|---|---|
$message |
string | The error message |
$statusCode |
int | The HTTP status code |
$rawResponse |
?\Psr\Http\Message\ResponseInterface | The raw HTTP response |
$body |
string | The response content |
When custom error responses are specified for an operation, the SDK may also throw their associated exception. You can refer to respective Errors tables in SDK docs for more details on possible exception types for each operation. For example, the trigger method throws the following exceptions:
| Error Type | Status Code | Content Type |
|---|---|---|
| Errors\PayloadValidationExceptionDto | 400 | application/json |
| Errors\ErrorDto | 414 | application/json |
| Errors\ErrorDto | 401, 403, 404, 405, 409, 413, 415 | application/json |
| Errors\ValidationErrorDto | 422 | application/json |
| Errors\ErrorDto | 500 | application/json |
| Errors\APIException | 4XX, 5XX | */* |
Example
Server Selection
Select Server by Index
You can override the default server globally using the setServerIndex(int $serverIdx) builder method when initializing the SDK client instance. The selected server will then be used as the default on the operations that use it. This table lists the indexes associated with the available servers:
| # | Server | Description |
|---|---|---|
| 0 | https://api.novu.co |
|
| 1 | https://eu.api.novu.co |
Example
Override Server URL Per-Client
The default server can also be overridden globally using the setServerUrl(string $serverUrl) builder method when initializing the SDK client instance. For example:
Development
Maturity
This SDK is in beta, and there may be breaking changes between versions without a major version update. Therefore, we recommend pinning usage to a specific package version. This way, you can install the same version each time without breaking changes unless you are intentionally looking for the latest version.
Contributions
While we value open-source contributions to this SDK, this library is generated programmatically. Any manual changes added to internal files will be overwritten on the next generation. We look forward to hearing your feedback. Feel free to open a PR or an issue with a proof of concept and we'll do our best to include it in a future release.
SDK Created by Speakeasy
All versions of novu with dependencies
galbar/jsonpath Version >=3.0
guzzlehttp/guzzle Version ^7.12.1
speakeasy/serializer Version ^4.0.3
brick/date-time Version >=0.7.0
phpdocumentor/type-resolver Version >=1.8
brick/math Version >=0.12.1