Skip to content

Latest commit

 

History

History
58 lines (42 loc) · 2.36 KB

DEPLOYMENT.md

File metadata and controls

58 lines (42 loc) · 2.36 KB

Deployment

Cella makes it easy to deploy on Render (backend, frontend and tus). Probably more options will become available over time.

Deploy services to render.com

Go to blueprints and select the repo by clicking Connect.

Speed up the process by using the existing render.yaml file in the root.

Enable Novu Slack notification

Gide by Novu. At first, create App in Slack so you can obtain the App ID, Client ID, and Client Secret.

Then, create Novu Workflow and select 'Blank workflow'.

The next step is creating the Slack integration. Create a Slack provider and add the App ID, Client ID, and Client Secret obtained from the first step. It's important not to forget to activate it. Now, in the workflow, add the 'Chat (Slack)' option to your workflow trigger and configure the message content. Pass variables that you want to use within double curly braces as example {{usersMessage}}.

Also we need to add incoming webhook.

Now, let's create the backend. Install the package.

pnpm install @novu/node

Create notification sender

import { Novu, ChatProviderIdEnum } from '@novu/node';

const notification = (message: string) => {
    const novu = new Novu(env.NOVU_API_KEY);

    // Identify the subscriber, an entity designed to receive notifications. If there is no subscriber with such an ID, create one; otherwise, use the existing one.
    await novu.subscribers.identify('Subscriber identifier', {
        firstName: 'John',
        lastName: 'Bridgenton',
        email: '[email protected]',
    });

    // Set's notification to chosen channel
      await novu.subscribers.setCredentials('Subscriber identifier', ChatProviderIdEnum.Slack, {
        webhookUrl: 'Webhook that you have created',
      });

    // Send the notification 
    novu.trigger('Your workflow name(default 'untitled')', {
        to: {
        subscriberId: 'Subscriber identifier',
        },

        // In the payload, you need to include the variables that you declared in the workflow trigger's message content.
        payload: {
            usersMessage: message,
        },
    });
}