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

@moneylion/react-native-engine-sdk

v0.5.8

Published

React Native components for the Engine by MoneyLion Mobile SDK

Downloads

223

Readme

react-native-engine-sdk

React Native components for Engine by MoneyLion. This implements a turnkey flow for gathering user information and submitting them to the Engine service to find financial products.

Getting Started

Request an api token and api endpoint from Engine.

Run yarn add @moneylion/react-native-engine-sdk

import { EngineSdk } from "@moneylion/react-native-engine-sdk";

// In your app
<EngineSdk
	bearer={authentication_token}
	endpoint={api_endpoint}
	prefilledData={prefilledData}
	primaryColor="#FF0000"
	secondaryColor="#00FF00"
	onExit={() => { /* handle user intention to exit */ }}
	onInitialize={() => { /* handle initialize callback */ }}
	onCreate={() => { /* handle lead creation callback */ }}
	onUpdate={() => { /* handle lead update callback */ }}
	onNavigate={() => { /* handle flow navigation callback */ }}
	onSubmit={() => { /* handle lead submission callback */ }}
/>

Props

  • bearer - the authentication token
  • endpoint - the Engine API endpoint
  • prefilledData - Any data you already have collected and don't want the flow to ask for again
  • primaryColor - An alternative primary color for branding purposes
  • secondaryColor - An alternative accent color for branding purposes
  • onExit - A callback invoked when the user tries to exit the flow
  • onInitialize - A callback invoked when the SDK has finished initializing
  • onCreate - A callback invoked when a lead is first created
  • onUpdate - A callback invoked when a lead is updated
  • onNavigate - A callback invoked when the user navigates to a new screen in the flow
  • onSubmit - A callback invoked when the user submits their data to receive a rate table

Development workflow

This project is managed using Yarn workspaces. It contains the following packages:

  • The library package in this directory.
  • An example app in the example/ directory.

To get started with the project, run yarn in this directory to install the required dependencies for each package:

yarn

Since the project relies on Yarn workspaces, you cannot use npm for development.

The example app demonstrates usage of the library. You need to run it to test any changes you make.

It is configured to use the local version of the library, so any changes you make to the library's source code will be reflected in the example app. Changes to the library's JavaScript code will be reflected in the example app without a rebuild, but native code changes will require a rebuild of the example app.

You can use various commands from this directory to work with the project.

To start the packager:

yarn example start

To run the example app on Android:

yarn example android

To run the example app on iOS:

yarn example ios

To run the example app on Web:

yarn example web

Make sure your code passes TypeScript and ESLint. Run the following to verify:

yarn typecheck
yarn lint

To fix formatting errors, run the following:

yarn lint:fix

Remember to add tests for your change if possible. Run the unit tests by:

yarn test

Scripts

The package.json file contains various scripts for common tasks:

  • yarn: setup project by installing dependencies.
  • yarn typecheck: type-check files with TypeScript.
  • yarn lint: lint files with ESLint.
  • yarn test: run unit tests with Jest.
  • yarn example start: start the Metro server for the example app.
  • yarn example android: run the example app on Android.
  • yarn example ios: run the example app on iOS.

Made with create-react-native-library

Publishing to NPM

Run the following steps to publish the SDK to NPM.

  1. Update the version number in package.json and src/engine_sdk.tsx. Commit this change.
  2. yarn prepare - This will build the SDK.
  3. npm publish --access=public - This will publish the SDK to NPM.

Troubleshooting

If you're testing the release build on Android and you find you are getting an error like this:

Error: adb: failed to install /home/dwt/moneylion/engine/ui-library-react-native/example/android/app/build/outputs/apk/debug/app-debug.apk: Failure [INSTALL_FAILED_UPDATE_INCOMPATIBLE: Existing package com.engine.sdk.example signatures do not match newer version; ignoring!]

Run the following command to remove the release build from your emulator or device:

adb uninstall 'com.engine.sdk.example'

"Unable to boot simulator"

Sometimes you might encounter a problem where the iOS simulator refuses to start. This can present with an error message like Failed to start launchd_sim: could not bind to session, launchd_sim may have crashed or quit responding.

You might be able to fix it by clearing the simulator caches. Navigate to ~/Library/Developer/CoreSimulator/Caches and remove the files in there.