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

react-native-okra-webview

v0.1.1

Published

Official Okra SDK for React Native/Expo applications. Don't forget to star ✨

Downloads

3

Readme

React-Native-Okra-Webview

Official Okra SDK for React Native/Expo applications. Don't forget to star ✨

About Okra

Okra’s API empowers companies and developers to build products with seamless access to inclusive financial data and secure payments.

alt text

React Native SDK for implementing the OkraJS widget - OkraJS is a safe and secure web drop-in module and this library provides a front-end web (also available in iOS and Android) 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. Click "See How it 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.

buildWithShortURL

  • If you are using the buildWithShortURL version, you will first need to create a link on your dashboard, and use the short url returend at the end of the creation flow.

Bonus Points

Installing

Using npm:

$ npm install react-native-okra-webview

Using yarn:

$ yarn add react-native-okra-webview

you'll also need to install react-native-webview, to install run ;

$ yarn add react-native-webview

Usuage

For React Native based application import it and use

/**
 * Sample React Native App
 * https://github.com/facebook/react-native
 *
 * Generated with the TypeScript template
 * https://github.com/react-native-community/react-native-template-typescript
 *
 * @format
 */

import React from 'react';
import {
  Alert,
  SafeAreaView,
  StatusBar,
  useColorScheme,
  View,
} from 'react-native';

import { Okra } from 'react-native-okra-webview';

const App = () => {
  const isDarkMode = useColorScheme() === 'dark';

  return (
    <SafeAreaView style={{flex:1}}>
      <StatusBar barStyle={isDarkMode ? 'light-content' : 'dark-content'} />
      <View  style={{flex:1}}>

        <Okra.BuildWithShortUrl
          short_url={'your-shourt-url'}
          onSuccess={(response: any) => {
            Alert.alert('Success!', JSON.stringify(response))
          }}
          onClose={(response: any) => {
            Alert.alert('error!', JSON.stringify(response))
          }}
        />

      </View>
    </SafeAreaView>
  );
};

export default App;

For others, just use

 /**
 * Sample React Native App
 * https://github.com/facebook/react-native
 *
 * Generated with the TypeScript template
 * https://github.com/react-native-community/react-native-template-typescript
 *
 * @format
 */

 import React, { useState } from 'react';
 import {
   Alert,
   SafeAreaView,
   StatusBar,
   useColorScheme,
   View,
 } from 'react-native';

import { Okra } from 'react-native-okra-webview';

 const App = () => {
   const isDarkMode = useColorScheme() === 'dark';

   return (
     <SafeAreaView style={{flex:1}}>
       <StatusBar barStyle={isDarkMode ? 'light-content' : 'dark-content'} />
       <View style={[style().container, style().flex]}>
         <Okra.BuildWithOptions
           env="<your-env-value>"
           name="<your-name-value>"
           token="<your-token-value>"
           okraKey="<your-key-value>"
           products={['auth', 'identity', 'balance', 'transactions' ]}
           onSuccess={(response: any) => {
             Alert.alert('Success!', JSON.stringify(response))
           }}
           onClose={(response: any) => {
             Alert.alert('error!', JSON.stringify(response))
           }}
         />
       </View>
     </SafeAreaView>
   );
 };

 export default App;

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/creating-a-charge) | 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

Huge Thanks & Credits

(Bob)[https://github.com/callstack/react-native-builder-bob]