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

okra-react-native-official

v0.1.4

Published

This package provides a set of functions for integrating the Okra API into your React Native applications. Okra is a financial technology company that enables seamless access to banking and financial services data through secure APIs.

Downloads

27

Readme

Okra Widget React Native SDK

alt text

React Native SDK for implementing the Okra widget - Okra is a safe and secure web drop-in module and this library provides a front-end web (also available in iOS, Android, and JavaScript) SDK for account authentication and payment initiation for each bank that Okra supports.

Try the demo

Checkout the widget flow to view how the Okra Widget works.

Before getting started

  • Checkout our get started guide to create your developer account and retrieve your Client Token, API Keys, and Private Keys.
  • Create a sandbox customer, so you can get connecting immediately.

Bonus Points

Getting Started

This library would help you add Okra widget to your hybrid android/ios application in no time. All you need to do is ...

Install

npm install okra-react-native-official

Usage

import React, { Component } from 'react';
import {
  Okra,
  OkraOptionsProps,
  OkraUrlProps,
} from 'okra-react-native-official';
import { Button, StyleSheet, View } from 'react-native';
import { NavigationContainer } from '@react-navigation/native';
import { createStackNavigator } from '@react-navigation/stack';

const Stack = createStackNavigator();

// Build with options
let okraOptions: OkraOptionsProps = {
  okraOptions: {
    callback_url: 'https://webhook.site/ded54b3f-f4f5-4fa1-86c3-0def6098fb4d',
    clientName: 'client',
    color: '#953ab7',
    connectMessage: 'Which account do you want to connect with?',
    currency: 'NGN',
    env: 'production-sandbox', // for sandbox use production-sandbox
    filters: {
      banks: ['access-bank', 'guaranty-trust-bank'],
      industry_type: 'all',
    },
    meta: "Any data type",
    options: {
      name: "Client Name"
    },
    isCorporate: false,
    key: 'Enter Key here',
    token: 'Enter token here',
    limit: 24,
    logo: 'https://cdn.okra.ng/images/icon.svg',
    products: ['auth', 'balance', 'identity', 'transactions'],
    widget_failed: '',
    widget_success: 'Your account was successfully linked to Okra, Inc',
  },
  onError: (error) => {
    console.log(error);
  },
  onSuccess: (data) => {
    console.log(data);
  },
  onClose: () => {
    console.log('on close');
  },
  onBeforeClose: () => {
    console.log('on before close');
  },
};

//OR
//Build With ShortUrl
let okraUrl: OkraUrlProps = {
  shortUrl: 'bc_kWKf2l',
  onError: (error) => {
    console.log(error);
  },
  onSuccess: (data) => {
    console.log(data);
  },
  onClose: () => {
    console.log('on close');
  },
  onBeforeClose: () => {
    console.log('on before close');
  },
};


function HomeScreen({ navigation }) {
  const goToOptions = () => {
    navigation.navigate('WithOptions');
  };

  const goToShortUrl = () => {
    navigation.navigate('WithShortUrl');
  };

  return (
    // @ts-ignore
    <View style={styles.container}>
      <Button title="Build With Options" onPress={goToOptions} />
      <View style={{ marginVertical: 10 }} />
      <Button title="Build With ShortUrl" onPress={goToShortUrl} />
    </View>
  );
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    alignItems: 'center',
    justifyContent: 'center',
  },
});

// Build With Options
function OkraOptionsScreen() {
  return Okra.buildWithOptions(okraOptions);
}

//Build With ShortUrl
function OkraShortUrlScreen() {
  return Okra.buildWithShortUrl(okraUrl);
}

export default class App extends Component {
  render() {
    return (
      <NavigationContainer>
        <Stack.Navigator>
          <Stack.Screen name="Home" component={HomeScreen} />
          <Stack.Screen name="WithOptions" component={OkraOptionsScreen} />
          <Stack.Screen name="WithShortUrl" component={OkraShortUrlScreen} />
        </Stack.Navigator>
      </NavigationContainer>
    );
  }
}

Okra.buildWithOptions Options

| Name | Type | Required | Default Value | Description | |------------------|---------------|----------|---------------------|-------------------------------------------------------------------------------------| | app_id | String | true | | Your app id from your Okra Dashboard. | | okraKey | String | true | | Your public key from your Okra Dashboard. | | token | String | true | | Your token from your Okra Dashboard. | | env | String | false | production | production(live)/production-sandbox (test) | | products | Array | true | ['Auth'] | The Okra products you want to use with the widget. | | payment | Booelan | false | | Whether you want to initiate a payment (https://docs.okra.ng/docs/payments) | | charge | Object | false | | Payment charge opject (https://docs.okra.ng/docs/widget-properties#set-up-payments) | | products | Array | true | ['Auth'] | The Okra products you want to use with the widget. | | logo | String(URL) | false | Okra's Logo | | | name | String | false | Your Company's name | Name on the widget | | color | HEX | false | #3AB795 | Theme on the widget | | limit | Number | false | 24 | Statement length | | filter | Object | false | | Filter for widget | | isCorporate | Boolen | false | false | Corporate or Individual account | | connectMessage | String | false | | Instruction to connnect account | | widget_success | String | false | | Widget Success Message | | widget_failed | String | false | | Widget Failed Message | | callback_url | String(Url) | false | | | | currency | String | false | NGN | Wallet to bill | | exp | Date | false | Won't expire | Expirary date of widget | | options | Object | false | | You can pass a object custom values eg id | | onSuccess | Function | false | | Action to perform after widget is successful | | onClose | Function | false | | Action to perform if widget is closed | | onError | Function | false | | Action to perform on widget Error | | BeforeClose | Function | false | | Action to perform before widget close | | onEvent | Function | false | | Action to perform on widget event |

View a complete list of customizable options here

Okra.buildWithShortUrl Options

| Name | Type | Required | Description | |---------------|------------|----------|--------------------------------------------------------------------------------------------| | short_url | String | true | Your generated url from our App builder. | | onSuccess | Function | false | Action to perform after widget is successful | | onClose | Function | false | Action to perform if widget is closed | | onError | Function | false | Action to perform on widget Error | | BeforeClose | Function | false | Action to perform before widget close | | onEvent | Function | false | | Action to perform on widget event

Done connecting?

Checkout our API Overiview and see how to use the data you've received and other products you can use to create more personalized experiences for your customers!

Not a developer?

Get started without writing a single line of code, Try our App Builder! Click here to get started

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT


Made with create-react-native-library

Other information

For enquires and questions, contact