November 5, 2021

322 words 2 mins read

notifirehq/notifire

notifirehq/notifire

Open-source notification infrastructure for products

repo name notifirehq/notifire
repo link https://github.com/notifirehq/notifire
homepage https://notifire.co
language TypeScript
size (curr.) 5070 kB
stars (curr.) 2580
created 2021-08-26
license MIT License

⭐️ Why

Building a notification system is hard, at first it seems like just sending an email but in reality it’s just the beginning. In today’s world users expect multi channel communication experience over email, sms, push, direct and more… An ever growing list of providers are popping up each day, and notifications are spread around the code. Notifire’s goal is to simplify notifications and provide developers the tools to create meaningful communication between the system and it’s users.

✨ Features

  • 🌈 Single API for all messaging providers (Email, SMS, Push, Direct)
  • πŸ’… Easily manage notification over multiple channels
  • πŸš€ Equipped with a templating engine for advanced layouts and designs
  • πŸ›‘ Built-in protection for missing variables
  • πŸ“¦ Easy to set up and integrate
  • πŸ›‘ Written in TypeScript with predictable static types.
  • πŸ‘¨β€πŸ’» Community driven

πŸ“¦ Install

npm install @notifire/core
yarn add @notifire/core

πŸ”¨ Usage

import { Notifire, ChannelTypeEnum } from '@notifire/core';
import { SendgridEmailProvider } from '@notifire/sendgrid';

const notifire = new Notifire();

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

const passwordResetTemplate = await notifire.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 notifire.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

Notifire provides a single API to manage providers across multiple channels with a single to use interface.

πŸ’Œ Email

πŸ“ž SMS

πŸ“± Push (Coming Soon…)

  • Pushwoosh
  • SNS

πŸ‘‡ Direct (Coming Soon…)

  • Slack
  • MS Teams
  • Discord
  • Mattermost

πŸ“± In-App (Coming Soon…)

  • Notifire
  • MagicBell

Other (Coming Soon…)

  • PagerDuty
comments powered by Disqus