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

@bottomline/mobile-native-utils

v1.0.0

Published

Native mobile utilities for JavaScript

Downloads

2

Readme

Mobile Native Utils

Conventional Commits Commitizen friendly

Mobile JavaScript utilities for native applications

Overview

In a hybrid app, biometric authentication is achieved via round trip communication between the Web/JavaScript (WJS) layer and the mobile-native-utils module (UTIL). To obtain information and invoke functionality, WJS calls the UTIL methods and UTIL methods fulfill or reject the promise.

Contents

Data

API

Development

Publishing

Data

Integrity

Objects passed as parameters to the UTIL methods are run through JSON.stringify(), encrypted, and stored on the device.

Objects stored on device are decrypted and returned as JSON.

Promise Response - Structure

Promise response returns JSON, containing two objects (data and error).

Fulfilled will contain populated data object

{
	"data": {
		"key1": "Value 1",
		"keyTwo": "Value for keyTwo"
	},
	"error": null
}

Rejected will contain populated error object

{
	"data": {},
	"error": {
		"type": "errorType",
		"message": "Error description"
	},
}

API

INITIALIZATION

getNativeParams()

Native params contain OS, Device, and Platform information.

Note: this information is also available in the window.BOTTOMLINE.NATIVE_PARAMS object on page request/load.

WJS can use this information to determine that the page has been requested/loaded by a mobile app user.

Values

osType: "iOS", 								// iOS or Android
osVersion: "13.3.1", 						// device OS version
deviceModel: "iPhone XR", 					// device hardware model
deviceName: "Bottomline iPhone XR", 		// device name or "Unavailable" if not set
deviceId: "ASDF38-ADK27-38SDK8",			// device ID or "Unavailable" if not set
platformBuild: "19", 						// the App build number
platformVersion: "5.5.0", 					// the App version number
platformId: "com.domain.identifer"			// the unique App identifier

STATUS

getStatusInformation()

UTIL will fulfill promise with information regarding device biometric capability and data storage or reject with error.

Parameters: None

Fulfilled will contain populated data object

{
	"data": {
		"biometricCapability": "touchID",			// values -> none, touchID, faceID, fingerprint 
		"sdkContainsSecureData": false,				// Bool
		"sdkContainsBiometricsSecureData": true		// Bool
	},
	"error": null
}

Rejected will contain populated error object

{
	"data": {},
	"error": {
		"type": "touchID",		// error enum
		"message": false,		// error description
	}
}

SECURE STORAGE

setSecureData(object)

UTIL will JSON.stringify(), encrypt and store the object securely on the device.

getSecureData()

Calling this method will prompt the SDK to decrypt and return the stored object in the promise response.

deleteSecureData()

Calling this method will prompt the UTIL to delete the stored object.

SECURE STORAGE - BIOMETRIC

setBiometricSecureData(object)

UTIL will JSON.stringify(), encrypt and store the object securely on the device.

getBiometricSecureData()

Initiates biometric authentication of user. Upon successful authentication, SDK will decrypt and return the stored object in the promise response.

  • Parameters : None
  • Return values: See Promise Response – Data Structure

deleteBiometricSecureData()

Deletes the stored biometrics secure data. Resets biometric status.

Development

Local development is broken into two parts (ideally using two tabs).

First, run rollup to watch your src/ module and automatically recompile it into dist/ whenever you make changes.

npm start # runs rollup with watch flag

The second part will be running the example/ create-react-app that's linked to the local version of your module.

# (in another tab)
cd example
npm start # runs create-react-app dev server

Now, anytime you make a change to your library in src/ or to the example app's example/src, create-react-app will live-reload your local dev server so you can iterate on your component in real-time.

Publishing to npm

npm publish

This builds cjs, es, and umd versions of your module to dist/ and then publishes your module to npm.

Make sure that any npm modules you want as peer dependencies are properly marked as peerDependencies in package.json. The rollup config will automatically recognize them as peers and not try to bundle them in your module.