/
githubmirror
/
novu
Обзор
Документация
Войти
/
githubmirror
/
novu
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
next
docs/platform/sdks/server/php.mdx
120 строк
3 KB
mintlify[bot]
docs(docs): Apply SEO and metadata best practices (#11903)
13 июл 2026, 11:22
Не верифицирован
13 июл 2026, 11:22
01f36ae
Код
Авторство
О чём код?
--- title: 'PHP SDK' description: "Connect a PHP application to Novu with the official server SDK to trigger workflows, manage subscribers, and send notifications from PHP code." --- Novu's PHP SDK provides simple, yet comprehensive notification management, and delivery capabilities through multiple channels that you can implement using code that integrates seamlessly with your PHP application. [Explore the source code on GitHub](https://github.com/novuhq/php-novu) ## Installation The SDK relies on [Composer](https://getcomposer.org/) to manage its dependencies. To install the SDK and add it as a dependency to an existing composer.json file: ```bash composer require "novuhq/novu" ``` ## Usage <Tabs> <Tab title="US Region"> ```php declare(strict_types=1); require 'vendor/autoload.php'; use novu; use novu\Models\Components; $sdk = novu\Novu::builder() ->setSecurity( '<YOUR_SECRET_KEY_HERE>' ) ->build(); $triggerEventRequestDto = new Components\TriggerEventRequestDto( workflowId: 'workflow_identifier', to: new Components\SubscriberPayloadDto( subscriberId: 'subscriber_unique_identifier', firstName: 'Albert', lastName: 'Einstein', email: 'albert@einstein.com', ), payload: [ 'comment_id' => 'string', 'post' => [ 'text' => 'string', ], ], overrides: [ 'email' => [ 'bcc' => 'no-reply@novu.co', ], ], ); $response = $sdk->trigger( triggerEventRequestDto: $triggerEventRequestDto, idempotencyKey: '<value>' ); if ($response->triggerEventResponseDto !== null) { // handle response } ``` </Tab> <Tab title="EU Region"> ```php declare(strict_types=1); require 'vendor/autoload.php'; use novu; use novu\Models\Components; $sdk = novu\Novu::builder() ->setServerURL('https://eu.api.novu.co') ->setSecurity( '<YOUR_SECRET_KEY_HERE>' ) ->build(); $triggerEventRequestDto = new Components\TriggerEventRequestDto( workflowId: 'workflow_identifier', to: new Components\SubscriberPayloadDto( subscriberId: 'subscriber_unique_identifier', firstName: 'Albert', lastName: 'Einstein', email: 'albert@einstein.com', ), payload: [ 'comment_id' => 'string', 'post' => [ 'text' => 'string', ], ], overrides: [ 'email' => [ 'bcc' => 'no-reply@novu.co', ], ], ); $response = $sdk->trigger( triggerEventRequestDto: $triggerEventRequestDto, idempotencyKey: '<value>' ); if ($response->triggerEventResponseDto !== null) { // handle response } ```` </Tab> </Tabs>