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

@nitrique/react-native-helpscout-beacon

v0.6.0

Published

Integrate Helpscout Beacon in to your React Native app

Downloads

9

Readme

react-native-helpscout-beacon

npm version

Integrate the Helpscout Beacon into your React Native app.

This library is compatible with and supported for React Native v0.60+.

Installation

React Native 0.60 and above:

  1. $ yarn add react-native-helpscout-beacon
  2. Add pod 'Beacon' to your Podfile

For React Native 0.59 and below linking will be necessary (not tested): $ react-native link react-native-helpscout-beacon

Update Helpscout SDK

iOS

Can be updated in your main project directory by running

cd ios/ && pod update Beacon

Please create an issue in this repo in case it doesn't work as expected.

Android

Has to be updated in this module's android/build.gradle, i.e. the version in the following line has to be adapted

implementation "com.helpscout:beacon:4.1.0"

Usage example

import HelpscoutBeacon from 'react-native-helpscout-beacon';

// init has to be called first
HelpscoutBeacon.init('my_helpscout_id');
// Login into your helpscout account
HelpscoutBeacon.login(
  '[email protected]',
  'John Smith',
  'user_id_of_john_smith'
);
// Open the helpscout beacon (using a cryptographic signature)
HelpscoutBeacon.open('mySignature');

Method description

Generally, please refer to the official docs for ios and android for documentation on the following methods.

Not all methods of the SDKs are implemented so far.

Methods

init

Initialize the Helpscout beacon library - has to be called before any other Helpscout method.

HelpscoutBeacon.init('my_helpscout_id');

identify

Identify a helpscout user with email (and optional name)

HelpscoutBeacon.identify('[email protected]', 'John Smith');

logout

Logout user from the Helpscout Beacon.

HelpscoutBeacon.logout();

addAttributeWithKey

Used to add an user attribute represented as a key / value pair. There is a limit of 30 attributes per user.

HelpscoutBeacon.addAttributeWithKey('some_key', 'some_value');

open

Opens the Helpscout Beacon with Help Center articles. The init and login methods will need to have been called before this will work.

May be used without arguments or with an optional signature (secure mode).

HelpscoutBeacon.open('my_signature');

openArticle

Opens the Helpscout Beacon at a specific Help Center article. (Helpscout docs integration has to be enabled)

HelpscoutBeacon.openArticle('some_article_id', 'my_signature');

suggestArticles

The suggestArticles method allows you to change the default list of suggested articles. Article IDs can be found in Help Scout by navigating to the article and copying the article ID from the URL. The URL is structured like this: https://secure.helpscout.net/docs/[COLLECTION ID]/article/[ARTICLE ID]/. Custom suggestions will only get loaded when the Beacon is opened. If the Beacon is not present, loading the custom suggestion data will get queued up for the next Beacon display.

Notes:

  • There is a limit of 5 article IDs. If the list is larger than 5 the additional articles will be ignored.
  • The Helpscout docs integration has to be enabled for this method to work.
const articleIDList = ['id1', 'id2', 'id3'];
HelpscoutBeacon.suggestArticles(articleIDList);

resetSuggestions

Reset any suggested articles set by suggestArticles back to Helpscouts own default suggestions.

HelpscoutBeacon.resetSuggestions();

navigate

Display a specific page in the Helpscout beacon. On Android, these paths are supported:

  • "/ask/message/"
  • "/ask/chat/"
  • "/answers/"

iOS supports additional paths e.g. "/" which displays the initial state of the beacon. Find supported path values here.

HelpscoutBeacon.navigate('/ask/message');

Additional convenience methods

These methods are not part of the original SDKs but have proven to be useful.

login

Convenience method to identify the user via setting an attribute with key userId.

HelpscoutBeacon.login(
  '[email protected]',
  'John Smith',
  'user_id_of_john_smith'
);

It is equivalent to

HelpscoutBeacon.identify('[email protected]', 'John Smith');
HelpscoutBeacon.addAttributeWithKey('userId', 'user_id_of_john_smith');

loginAndOpen

Convenience method to login via setting an attribute with key userId and opening the Helpscout beacon (with optional signature).

HelpscoutBeacon.loginAndOpen(
  '[email protected]',
  'John Smith',
  'user_id_of_john_smith',
  'mySignature'
);