Novu Node Setup

Hi @all, i am new to Novu, and i want to setup novu with express, i followed the step mentioned in the quickstart for express, but after i ran the npx novu studio command it opens the studio with onboarding page, and if i hit the test workflow option there, it says api key not found, but i have included the api key the env file, please anyone help me, will mean a lot, i am stuck from past 2 days
8 Replies
Pawan Jain
Pawan Jain3w ago
@Sachin Goyal Can you please check if env variables are loaded correctly before
app.use(express.json()); // Required for Novu POST requests
app.use( "/api/novu", serve({ workflows: [testWorkflow] }) );
app.use(express.json()); // Required for Novu POST requests
app.use( "/api/novu", serve({ workflows: [testWorkflow] }) );
Sachin Goyal
Sachin Goyal3w ago
@Pawan Jain in this file we have to load the env variable? and if yess can you pleas tell how. Also i have few doubts regarding Novu if we can connect on a call please
Pawan Jain
Pawan Jain3w ago
make sure you have this .env variable in .env file NOVU_SECRET_KEY use dotenv before these lines so that NOVU_SECRET_KEY env variable is loaded before app.use( "/api/novu", serve({ workflows: [testWorkflow] }) ); >> Also i have few doubts regarding Novu Feel free to share all your questions here
Sachin Goyal
Sachin Goyal3w ago
@Pawan Jain , so my first doubt is like can we create a separate node js app for creating whatever workflows we have? and make an api for trigger function to be used in the react app? @Pawan Jain also when we run the npx run novu dev command it opens up a studio and there we have to manually sync the worflows to be visible in the novu dashboard. So can this manual sync process be avoided?
Sachin Goyal
Sachin Goyal3w ago
@Pawan Jain see i have dotenv, but still gettign api key not found issue in novu studio
No description
Novu_Bot
Novu_Bot3w ago
@Sachin Goyal, you just advanced to level 1!
Pawan Jain
Pawan Jain3w ago
@Sachin Goyal
so my first doubt is like can we create a separate node js app for creating whatever workflows we have? and make an api for trigger function to be used in the react app?
yes you can create separate app for this.
also when we run the npx run novu dev command it opens up a studio and there we have to manually sync the worflows to be visible in the novu dashboard. So can this manual sync process be avoided
You can use CLI method https://docs.novu.co/deployment/cli
see i have dotenv, but still getting api key not found issue in novu studio
Can you please check if NOVU_SECRET_KEY value is valid and the same as you see Secret Key value here https://dashboard.novu.co/api-keys Try adding console.log(process.env.NOVU_SECRET_KEY) statement after dotenv to check if env variable is loaded
Sachin Goyal
Sachin Goyal2w ago
Hi @Pawan Jain , while triggering the workflow it says api key not found but i have that in .env file
Want results from more Discord servers?
Add your server