Connect PHP backend to local NOVU

Hello, I was able to connect my react frontend but how can i connect my php (laravel) backend to trigger events to my local novu?
7 Replies
Zac Clifton
Zac Clifton13mo ago
@unicodeveloper
Prosper
Prosper13mo ago
Are you using the self-hosted version of Novu? The dockerized one
Charles Derrick
Charles DerrickOP13mo ago
I forked the repo, cloned it with https and ran npm run setup:project I ran the server with npm run start:web
Mei
Mei13mo ago
Use the novu php api wrapper composer require unicodeveloper/novu And give it a base url pointing to your self-hosted instance
$config = [
'apiKey' => 'YOUR_API_KEY_HERE',
'baseUri' => 'https://custom-api-url.com/v1/'
];

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

$novu = new Novu($config);
Prosper
Prosper13mo ago
Thanks @Mei
Prosper
Prosper13mo ago
You can learn how to run your self-hosted instance here https://docs.novu.co/community/run-in-local-machine
Novu
Run Novu in local machine - Novu
Prerequisites and steps to run Novu in local machine. Learn how to set up Novu on your local environment for testing and development.
Pawan Jain
Pawan Jain2mo ago
@Mei We are working on our new php sdk and looking for early testers. Would you be interested in helping us in testing the SDK before it is available to use for all? cc: @Emil Pearce @Charles Derrick let me know if you are also interested

Did you find this page helpful?