stateless-custom
TypeScript icon, indicating that this package has built-in type declarations

0.1.0 • Public • Published

📦 Install

npm install @novu/stateless
yarn add @novu/stateless

🔨 Usage

import { NovuStateless, ChannelTypeEnum } from '@novu/stateless';
import { SendgridEmailProvider } from '@novu/sendgrid';

const novu = new NovuStateless();

await novu.registerProvider(
  new SendgridEmailProvider({
    apiKey: process.env.SENDGRID_API_KEY,
    from: 'sender@mail.com',
  })
);

const passwordResetTemplate = await novu.registerTemplate({
  id: 'password-reset',
  messages: [
    {
      subject: 'Your password reset request',
      channel: ChannelTypeEnum.EMAIL,
      template: `
          Hi {{firstName}}!
          
          To reset your password click <a href="{{resetLink}}">here.</a>
          
          {{#if organization}}
            <img src="{{organization.logo}}" />
          {{/if}}
      `,
    },
  ],
});

await novu.trigger('<REPLACE_WITH_EVENT_NAME>', {
  $user_id: '<USER IDENTIFIER>',
  $email: 'test@email.com',
  firstName: 'John',
  lastName: 'Doe',
  organization: {
    logo: 'https://evilcorp.com/logo.png',
  },
});

Providers

Novu provides a single API to manage providers across multiple channels with a simple-to-use interface.

💌 Email

📞 SMS

📱 Push

👇 Chat

📱 In-App

  • [x] Novu
  • [ ] MagicBell

Other (Coming Soon...)

  • [ ] PagerDuty

🔗 Links

Dependencies (3)

Dev Dependencies (15)

Package Sidebar

Install

npm i stateless-custom

Weekly Downloads

0

Version

0.1.0

License

MIT

Unpacked Size

138 kB

Total Files

93

Last publish

Collaborators

  • djain07