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

@pinwheel/react-native-pinwheel

v3.0.5

Published

Pinwheel React Native SDK

Downloads

8,199

Readme

react-native-pinwheel

Pinwheel SDK for React Native

Running The Example App Locally

You may want to run the example app locally to get started.

Dependencies

  • Node 16.7.0 (check with node -v and upgrade versions using nvm if needed)
  • iPhone 14 simulator (open your Simulator app and check the available versions)
  • iOS 16 running on the simulator (open your Simulator app and check the available versions)
  • pod version 1.11.3 (check with pod --version)
  • Add your pinwheel secret to example/env.js (create this file) with export default "<YOUR PINWHEEL SECRET>".

Directions

  • npm run dev

Troubleshooting

An error was encountered processing the command (domain=com.apple.CoreSimulator.SimError, code=405)
  • Click Apple > About This Mac > Storage > Manage > Developer
  • Delete Xcode cache
  • Delete Project Build and indexes
Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 65
  • Try downloading Xcode 14.2 from https://developer.apple.com/download/all/?q=xcode
Failed to locate 'git', requesting installation of command line developer tools

For this or other errors related to command line developer tools:

  • Make sure you have Command Line Tools for Xcode 14.2 installed
  • Open Xcode > Click Xcode in the app menu > Settings > Locations > Command Line Tools dropdown and set the correct location

Installation

  1. Install Pinwheel React Native SDK
$ npm install --save @pinwheel/react-native-pinwheel

Usage

Link Token

To initialize Link Modal, a short-lived link token will need to be generated first. Your server can generate the link token by sending a POST request to the /v1/link_tokens endpoint. DO NOT ever send this request from the client side and publicly expose your api_secret.

The link token returned is valid for one hour, after which it expires and can no longer be used to initialize Link. The expiration time is returned as a unix timestamp.

Pinwheel Component

The PinwheelLink component is a view that you can integrate into your app's flow like so:

import PinwheelLink from "@pinwheel/react-native-pinwheel";

<PinwheelLink
  linkToken={response.data.token}
  onLogin={result => { /* ... */ }}
  onError={error => { /* ... */ }}
  onSuccess={result => { /* ... */ }}
  onExit={error => { /* ... */ }}
  onEvent={(eventName, payload) => { /* ... */ }}
/>;

With the PinwheelLink component, end-users can select their employer, authenticate with their payroll platform login credentials, and authorize the direct deposit change. Throughout the authorization process, events will be emitted to the onEvent callback and any errors (both user errors such as invalid parameters and any system errors which arise) will be emitted to the onError callback. Upon a successful login, onLogin will be called and once the full flow is complete the onSuccess callback will be called. onExit will be called when the Pinwheel modal is closed, and you should remove the PinwheelLink component from your view hierarchy.

Props

linkToken

The link token retrieved using the create link token endpoint.

| Type | Required | | ------ | -------- | | string | Yes |

onLogin

Callback when a user successfully signs in to their payroll account.

| Type | Required | | -------- | -------- | | function | No |

onError

Callback whenever an error occurs during the modal flow. This does not necessarily mean that the flow cannot still complete successfully. These include such retryable events as the user inputting an incorrect password or MFA code and needs to reattempt it. Error codes can be seen here.

| Type | Required | | -------- | -------- | | function | No |

onSuccess

Callback whenever a user completes a modal flow successfully. Note: This is simply a front end callback only. If a user begins a job, closes the app, and the job completes successfully this callback will not be called.

| Type | Required | | -------- | -------- | | function | No |

onExit

Callback whenever a user exits the modal either explicitly or if an error occurred that crashed the modal. Error codes can be seen here. Will pass back an error result if the modal either crashed due to an error or if the user exited while in an error state (e.g. invalid credentials).

| Type | Required | | -------- | -------- | | function | No |

onEvent

Callback for all significant events that happen during the modal flow. See all possible event types.

| Type | Required | | -------- | -------- | | function | No |