This package has been deprecated

Author message:

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

@fyno/inapp

1.0.4 • Public • Published

@fyno/inapp

React SDK for Fyno's inapp notification center

NPM JavaScript Style Guide

Fyno: Fire your notifications

Install

npm install --save @fyno/inapp

Usage

Before installing Inapp Notification Center make sure you have generated HMAC signature in the backend by following the below process

import crypto from "crypto";
const computedUserHmac = crypto
  .createHmac("sha256", "WSID"+"INTEGRATION_TOKEN")
  .update("USER_ID")
  .digest("hex");
import {FynoInappCenter} from '@fyno/inapp'

class Example extends Component {
  const config = {
    userId: 'USER_ID',
    workspaceId: 'WSID',
    signature: 'computedUserHmac'
    themeConfig: {
      logo: 'LINK_TO_BRAND_LOGO',
      primary: 'PRIMARY_COLOR',
      lightBackground: 'LIGHT_THEME_BACKGROUND_COLOR',
      darkBackground: 'DARK_THEME_BACKGROUND_COLOR'
    }, //optional
    notificationSettings: {
      sound: 'LINK_TO_NOTIFICATION_SOUND'
    } //optional
  }
  render() {
    return <FynoInappCenter {...config}/>
  }
}

OR

import {FynoInApp} from '@fyno/inapp'

class Example extends Component {

  const themeConfig: {
      logo: 'LINK_TO_BRAND_LOGO',
      primary: 'PRIMARY_COLOR',
      lightBackground: 'LIGHT_THEME_BACKGROUND_COLOR',
      darkBackground: 'DARK_THEME_BACKGROUND_COLOR'
  }
  const notificationSettings = {
    sound: 'LINK_TO_NOTIFICATION_SOUND'
  }
  render() {  
    return <FynoInappCenter user="{userid}" workspace="{workspace_id}" signature="{signature generated from backend}" themeConfig={themeConfig} notificationSettings={notificationSettings}/>
  }
}

Package Sidebar

Install

npm i @fyno/inapp

Weekly Downloads

0

Version

1.0.4

License

MIT

Unpacked Size

298 kB

Total Files

8

Last publish

Collaborators

  • pranavbadami
  • saivinod
  • ashishag86
  • ashwin-agarwal