2.1.0 • Published 3 years ago

npm-okrajs v2.1.0

Weekly downloads
130
License
MIT
Repository
-
Last release
3 years ago

THIS PROJECT IS DEPRECATED

Package is not maintained anymore. All the versions are not affected, they are still compatible with the Okra widget.

We have moved to okra-js

Here is the doc for okra-js

Okra JS

JS library for implementing Okra widget

Installing

Using npm:

$ npm install okra-js

Using yarn:

$ yarn add okra-js

Using CDN:

<script src="https://cdn.okra.ng/v2/bundle.js"></script>

Usuage

For JS frameworks import it and use

import Okra from 'okra-js'

For others, just use

Okra.buildWithOptions({
    name: 'Peter the Builder',
    env: 'production-sandbox',
    app_id: ''// app_id from your app builder
    key: '', // Your key from the Okra dashboard
    token: '', // Your token from the okra dashboard
    products: ['auth','identity','balance','transactions', 'income'], //in lowercase
    onSuccess: function(data){
        console.log('options success', data)
    },
    onClose: function(){
        console.log('options close')
    }
})

// OR

Okra.buildWithShortUrl({
    short_url: '', //Your short url from the link builder
    onSuccess: function(data){
        console.log('options success', data)
    },
    onClose: function(){
        console.log('options close')
    }
})

Okra.buildWithOptions Options

NameTypeRequiredDefault ValueDescription
app_idStringtrueYour app id from your Okra Dashboard.
keyStringtrueYour public key from your Okra Dashboard.
tokenStringtrueYour token from your Okra Dashboard.
envStringfalseproductionproduction(live)/production-sandbox (test)
productsArraytrue['Auth']The Okra products you want to use with the widget.
logoString(URL)falseOkra's Logo
nameStringfalseYour Company's nameName on the widget
colorHEXfalse#3AB795Theme on the widget
limitNumberfalse24Statement length
filterObjectfalseFilter for widget
isCorporateBoolenfalsefalseCorporate or Individual account
connectMessageStringfalseInstruction to connnect account
widget_successStringfalseWidget Success Message
widget_failedStringfalseWidget Failed Message
callback_urlString(Url)false
currencyStringfalseNGNWallet to bill
expDatefalseWon't expireExpirary date of widget
optionsObjectfalseYou can pass a object custom values eg id
onSuccessFunctionfalseAction to perform after widget is successful
onCloseFunctionfalseAction to perform if widget is closed
onErrorFunctionfalseAction to perform on widget Error
BeforeCloseFunctionfalseAction to perform before widget close

Okra.buildWithShortUrl Options

NameTypeRequiredDescription
short_urlStringtrueYour generated url from link builder.
onSuccessFunctionfalseAction to perform after widget is successful
onCloseFunctionfalseAction to perform if widget is closed
onErrorFunctionfalseAction to perform on widget Error
BeforeCloseFunctionfalseAction to perform before widget close

Need more options?

Try our App Builder! Click here to get started

Other information

For enquires and questions, contact

2.1.0

3 years ago

2.0.9

3 years ago

2.0.8

3 years ago

2.0.7

3 years ago

2.0.6

4 years ago

2.0.5

4 years ago

2.0.3

4 years ago

2.0.4

4 years ago

1.1.0

4 years ago

2.0.2

4 years ago

2.0.1

4 years ago

2.0.0

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago