npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@msg91comm/react-native-hello-sdk

v2.0.0

Published

Hello Chat Widget SDK for react native application.

Downloads

3

Readme

React Native Chat Widget by MSG91 # HelloSDK

Getting started

Login or create account at MSG91 to use Hello SDK service.

After login at MSG91 follow below steps to get your hello chat widget configuration.

  • From navigation drawer expand Manage > Inboxes > Select Inbox as Chat > Edit Widget.
  • Configure your widget and copy the helloConfig object.

Installation

npm install @msg91comm/react-native-hello-sdk
  • Note - Please mention these dependencies in your package.json under dependencies.
 "cobrowse-sdk-react-native": "^2.13.0",
 "react-native-webview": "^11.23.1"

Example

"dependencies": {
    "react": "18.1.0",
    "react-native": "0.70.5",
    "@msg91comm/react-native-hello-sdk": "^1.0.0",
    "cobrowse-sdk-react-native": "^2.13.0",
    "react-native-webview": "^11.23.1"
  }

Usage

Widget Setup:

Import package in your Navigation container file or Screen:

import ChatWidget from '@msg91comm/react-native-hello-sdk';

Store your config object in a variable:

var helloConfig = {
    widgetToken: "XXXXX",
    unique_id: <unique_id>, 
    name: <name>,  
    number: <number>,
    mail: <mail>
    }

Note: Ensure that helloConfig object does not contain any key with null or undefined value, else it will show loader or malfunction.

Place the ChatWidget component at the bottom inside your Navigation container or Screen:

return (
  <NavigationContainer>
    {/* Other Screens or Navigation Stacks... */}
    <ChatWidget
       preLoaded={true}
       widgetColor={'#FFFF00'}
       helloConfig={helloConfig}
    />
  </NavigationContainer>
  );

Note: This widget is optimized for positioning using the position: 'absolute' style property, allowing it to seamlessly overlay your entire app interface.

To ensure optimal visual integration and prevent interference with other absolute elements, we strongly recommend placing the chat widget within your navigation container. Position it at the bottom of the navigation container/screen, this will ensure that the chat widget remains easily accessible without obstructing other absolute elements in your app.

Invoke Widget:

You can invoke this widget from anywhere in your app:

Just import DeviceEventEmitter from react-native

  import { DeviceEventEmitter } from 'react-native';

and

  <Button title="Chat with us"
    onPress={() => DeviceEventEmitter.emit("showHelloWidget", { status: true })}
  />

The Button onPress will launch the widget, and a Close Button is provided inside the widget for easy closure. When the widget is closed, it retains its current state, allowing it to be relaunched from the same state if the app is not killed.

Properties

| Prop | Type | value | Description | | ---------------------------- | ----------------- | ------- | --------------------------------------------------------------------- | | helloConfig | object (Required) | { widgetToken: "XXXXX", ...} | Configuration object from Hello dashboard | | widgetColor | string (Required) | 'hex-color-code' | Sets StatusBar color and widget's background color | | statusBarStyle | string | 'light-content', 'dark-content' | Changes status bar content color | | preLoaded | boolean | true, false | true pre-loads widget content and keeps it ready to launch. On false, widget content loads when it is invoked |


Another Example

If the widget is applied in a particular screen:

Import ChatWidget and DeviceEventEmitter in your Screen:

import { DeviceEventEmitter } from 'react-native';
import ChatWidget from '@msg91comm/react-native-hello-sdk';

Store your config object in a variable:

var helloConfig = {
    widgetToken: "XXXXX",
    unique_id: <unique_id>, 
    name: <name>,  
    number: <number>,
    mail: <mail>
    }

Place the ChatWidget component at the bottom of your Screen code:

return (
  <SafeAreaView>
    {/* Your Screen Code... */}
    <Button title="Chat with us"
      onPress={() => DeviceEventEmitter.emit("showHelloWidget", { status: true })}
    />
    {/* Your Screen Code... */}
    <ChatWidget
       preLoaded={true} 
       widgetColor={'#FFFF00'}
       helloConfig={helloConfig}
    />
  </SafeAreaView>
  );

License

Copyright 2022 MSG91
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.