Run the Local Studio
dev
command is your go-to command whenever you want to build and preview your changes before syncing to cloud. By default, it will start a secure tunnel that our durable cloud workflow engine will
be able to communicate with, and the Local Studio web service listening on http://localhost:2022
Install Packages
@novu/framework
SDK PackageAdd the NovuModule to your application
NovuModule
is a NestJS module that registers the Novu Endpoint in your application.The following example does not support NestJS dependency injection. If you need to @Injectable
dependencies in your workflow definition, see Advanced Usage.Add a Novu Secret Key Environment Variable
NOVU_SECRET_KEY
environment variable to your .env
Create your workflow definition
novu
folder in your src
folder as such src/novu/workflows.ts
that will contain your workflow definitions.Start your application
4000
port, restart the npx novu dev
command with the port:Test your workflow
http://localhost:2022
by running the npx novu dev
command on the first step.The onboarding guide will guide you to send the newly created sample workflow to your e-mail address.Deploy your application
registerAsync
method.
Add the NovuModule
using the registerAsync
method to your AppModule
.
UserService
is available below with hardcoded values, but in a real-world application you might use a database or an external API to fetch the user’s name.
NotificationService
to use the injected UserService
.