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

react-native-forage-beta

v0.5.5

Published

This SDK provides a library of utilities to allow the connection of your application to Forage Analytics (_www.forage-analytics.com_).

Downloads

45

Readme

Forage Analytics

This SDK provides a library of utilities to allow the connection of your application to Forage Analytics (www.forage-analytics.com).

Installation

To add Forage to your project, run the following command:

(Please note, Forage uses peer dependencies of other well-known packages in order to give you the best experience)
yarn add react-native-forage-beta @react-native-async-storage/async-storage @react-native-community/netinfo react-native-device-info react-native-localize
// If you use npm instead of yarn
npm i react-native-forage-beta @react-native-async-storage/async-storage @react-native-community/netinfo react-native-device-info react-native-localize

If you are using a React Native version lower than 0.60:

react-native link @react-native-async-storage/async-storage @react-native-community/netinfo

Integration

Obtaining an app key

To obtain a unique app key, simply sign-up at app.forage-analytics.com.

Call Forage.start

Once you have obtained an app key, you can connect your application to Forage and start tracking events via the start method, passing in your app key and the React Native AppState API.

// Import package and dependency    
import Forage from 'react-native-forage-beta';    
import { AppState } from 'react-native';

// Call Forage.start with your unique app key
// TIP: Don’t forget to pass in AppState    
Forage.start(YOUR_APP_KEY_HERE, AppState);

Forage SDK - Optional Methods

The Forage SDK consists of 5 additional methods;

Forage.setUserId(userId: string)

Sets a unique User ID for a session.

Example:

Forage.setUserId('User1');

Forage.trackEvent(eventName: string, properties?: string | number | boolean | object)

Send up any data of any size. Properties are optional.

Examples:

trackEvent('Customer Checkout Press');
trackEvent(‘Item Added to Basket’, {
  label: 'Dining Room Chair',
  currency: '£',
  cost: ‘99.99’,
  discount: ‘10%’,
  total: ‘90.00’
});

Forage.trackScreen(screenName: string)

Track screen changes inside of your application.

Examples:

trackScreen('Product A - View');
trackScreen('Checkout Screen');    

Forage.addTimer(label: string) & Forage.endTimer(label: string)

These can be used together to allow you to track the time that a particular event or action took to complete.

Examples:

startTimer('API X Called');
const data = await callApi();
endTimer('API X Called');