Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@pinwheel/react-native-pinwheel

Package Overview
Dependencies
Maintainers
16
Versions
62
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pinwheel/react-native-pinwheel

Pinwheel React Native SDK

  • 0.0.2
  • npm
  • Socket score

Version published
Weekly downloads
1.2K
decreased by-61.03%
Maintainers
16
Weekly downloads
 
Created
Source

react-native-pinwheel

Pinwheel SDK for React Native

Installation

  1. Install react-native-webview peer dependency.
$ npm install --save react-native-webview
$ cd ios && pod install
  1. Install Pinwheel React Native SDK
$ npm install --save @pinwheel/react-native-pinwheel

Usage

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 15 minutes, 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 "react-native-pinwheel";

<PinwheelLink
  linkToken={response.data.token}
  onSuccess={onSuccess}
  onExit={onExit}
  onEvent={onEvent}
/>;

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. Upon a successful authorization, the onSuccess callback will be called. onExit will be called when it is time to close the dialog, and you should remove the PinwheelLink component from your view hierarchy.

Props

linkToken

The link token retrieved using the create link token endpoint.

TypeRequired
stringYes

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.

TypeRequired
functionNo

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.

TypeRequired
functionYes

onEvent

Callback whenever a user interacts with the modal (e.g. clicks something or types something). The eventName can be used to gain insight into what the user is doing.

TypeRequired
functionNo

Example App

See example app readme

FAQs

Package last updated on 11 Nov 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc