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

@remitly/react-native-remitly-cesdk

v1.4.4

Published

SDK for Remitly's connected experiences

Downloads

5

Readme

Connected Experiences SDK for React Native

Remitly Connected Experiences enables businesses to offer cross border money transfers to their customers through a simple and lightweight integration.

Key Components

RemitlyCeConfig is your app's Remittance project configuration. Populate it as follows:

  • appId: <string> - required - Unique identifier for your app. Get this from your Remitly contact
  • languageCode?: <string> - optional - 2 letter language code. The Remitly UI will render in this language if it is supported. By default it will render in the set device language.
  • customerEmail?: <string> - optional - a string containing the customer's email. Used to prepopulate the login/signup form.
  • defaultSendCountry?: <string> - optional - 3 letter country code for the default country of origin. Used to prepopulate the signup form.
  • defaultReceiveCountry?: <string> - optional - 3 letter country code for the default country a customer wants to send money to. Used to prepopulate the signup form.

RemitlyCE is a container for methods for invoking the Remitly UX:

configure(configuration: RemitlyCeConfig) Accepts a RemitlyCeConfig and must be called prior to presenting the Remitly UX.

present(props: { transferSubmittedHandler?: () => void; userActivityHandler?: () => void; }) Accepts event callback handler methods, and presents the Remitly UX atop your app in a full-screen modal. await this async method to determine when the user has dismissed the Remitly UX.

  • transferSubmittedHandler if supplied, will be called when the user submits a transaction to send money

  • userActivityHandler if supplied, will be called frequently as the user interacts with the Remitly UX

  • errorHandler if supplied, will be called when the user encounters an error

dismiss(logout: boolean = false) is an idempotent API to hide any presented Remitly UX and optionally log the user out of Remitly. This must be called (passing logout: true) whenever the user logs out of your app.

Integration Instructions

1. Obtain SDK package from your Remitly Contact

You will be provided with a yarn package from your Remitly contact. This pacakge will be a Tarball to install in your project.

2. Install in your project

Install in your project with the following command:

$ yarn add file:<path-to-tarball>/react-native-remitly-cesdk-<version>.tgz

Gotcha

If using a tarball to install the SDK, your example projects will cache the .tgz. If the name doesnt change, then the cached pacakge will be used instead of the new local version.

yarn cache clean will fix this problem.

3. Ensure peer dependencies are met

Check package.json for peer dependencies. If any are not met (e.g. react-native-webview), yarn install them.

4. Setup RemittanceUI Inputs

Initialize your app

import React, { useCallback, useEffect } from "react";
import { Button, SafeAreaView } from "react-native";
import { RemitlyCE } from "@remitly/react-native-remitly-cesdk";

export default function ConnectedExperiencesTestHarness() {

    useEffect(() => {
        RemitlyCE.configure({
            appId: "passbook",
            defaultSendCountry: "USA",
            defaultReceiveCountry: "PHL",
        });
    }, [])

Setup event handlers:

const onTransferSubmitted = useCallback(() => {
    console.log("onTransferSubmitted");
}, []);

const onUserActivity = useCallback(() => {
    console.log("onUserActivity");
}, []);

const onError = useCallback((err: RemitlyCeError) => {
    console.log("onError", err);
}, []);

5. Present the Remitly UX in response to a user interaction

const onSendMoney = useCallback(async () => {
    console.log("Presenting Remitly UX");
    await RemitlyCE.present({
        transferSubmittedHandler: onTransferSubmitted,
        userActivityHandler: onUserActivity,
    });
    console.log("Remitly UX dismissed");
}, [onTransferSubmitted, onUserActivity]);

return (
    <SafeAreaView>
        <Button title="Send Money" onPress={onSendMoney} />
    </SafeAreaView>
);