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 🙏

© 2025 – Pkg Stats / Ryan Hefner

cryptid-react-native

v0.0.6

Published

javascript react-native client for cryptid analytics

Readme

cryptid-react-native

Javascript react-native client to cryptid analytics.

This library should be used to integrate Cryptid Analytics into react-native applications.

For browser-based javascript projects (including React, Vue, etc.), use cryptid, which will gather browser information rather than device information.

Install

First, install the package to your React Native project

npm install cryptid-react-native --save

This should install the module along with its main dependency, react-native-device-info. You'll then need to follow the configuration instructions of react-native-device-info, available at the preceding link but reproduced here.

react-native link react-native-device-info

Note: The above command works for recent versions of RN. If you need to deal with an older version of the framework or if you desire to manually link the dependency into your application, please follow the directions here.

Configure

Create a new Tracker using the trackerId of the property you're tracking.

import Tracker from 'cryptid-react-native';

const tracker = new Tracker('mobile|C8BB8D97-CA6E-49B7-89A3-56EB0A671480');

You may also supply additional options as a second argument. These will be passed through to the underlying fetch call.

There are also two callbacks you may define: beforeFetch, which is passed the url and options that will be used in the fetch, and afterFetch which is passed the response.

import Tracker from 'cryptid-react-native';

const tracker = new Tracker('mobile|C8BB8D97-CA6E-49B7-89A3-56EB0A671480', {
  beforeFetch: (url, options) => console.log('before', url, options),
  afterFetch: (response) => console.log('response', response),
});

Use

Tracker has one method: send, which is used to send an event to the cryptid service. When you call send the library gathers device metadata to include with the event data you supply. All of this metadata may be overridden by fields you include on the event object (see the Events section below.)

Simple example:

tracker.send({eventValue: 'login-successful'});

More complex:

tracker.send({
  eventCategory: 'authentication',
  eventAction: 'signup',
  eventLabel: 'signup-method',
  eventValue: 'facebook',
  timezone: '',
  latitude: '',
  logintude: '',
  elevation: ''
});

Events

List of fields that can be included in the event object.

| Field | Description | Required? | Example | |-------|-------------|-----------|---------| | eventCategory | Category of the event | No | authentication | | eventAction | Action or workflow the event occured during | No | login | | eventLabel | Label of the event | No | form-submission | | eventValue | Value of the event | Yes | button-click or enter-key | | customField_1 | Custom data | No | | | customField_2 | Custom data | No | | | customField_3 | Custom data | No | | | customField_4 | Custom data | No | | | customField_5 | Custom data | No | | | timezone | Timezone the device resides in | No | America/Chicago | | latitude | Latitude of the device | No | 43.0731 | | longitude | Longitude of the device | No | 89.4012 | | elevation | Elevation of the device | No | 741 |

You may use the Category, Action, Label and Value event fields any way that you'd like in your application; they exist merely to allow for an event taxonomy that works for you. The simplest way to use them is to only supply an event value such as login-successful. If you don't need anything more complicated, you may omit the rest of the fields.

Likewise, the customField values are there to log supplemental application information that may bes useful to you, but are not required by the send event or the service.

Note that the geospatial data is NOT collected automatically by the library. This is because different platforms require specific permission to be given to collect such information, and it's not up to cryptid whether you enable the collection (and thus user opt-in) for this data. Therefore, if you already have these permissions or choose to enable them then this data can be included in the event payload.

List of device metadata fields that are automatically collected and may be overridden by including them in the event object:

| Field | Description | Exammple | |-------|-------------|----------| | deviceManufacturer | Device manufacturer | Apple | | deviceBrand | Device brand | Apple, htc, Xiaomi | | deviceModel | Device model | iPhone 6 | | deviceId | Device ID | iPhone7,2 | | deviceLocale | Device locale | en-US | | deviceCountry | Device country | US | | deviceName | Device name | Zach's iPhone 6 | | systemName | System name | iPhone OS | | systemVersion | System version | 9.0 | | bundleId | Bundle ID | com.cardiganapp | | buildNumber | Build number | 89 | | appVersion | Applicatino version | 1.1.0 | | appVersionReadable | Application version | 1.1.0.89 | | appInstanceId | Application instance ID | (Android only) | | userAgent | User agent | Dalvik/2.1.0 (Linux; U; Android 5.1; Google Nexus 4 - 5.1.0 - API 22 - 768x1280 Build/LMY47D) | | isEmulator | Is the app running in an emulator? | true | | isTablet | Is the app running on a tablet | false |