2.1.0 • Published 3 years ago
npm-okrajs v2.1.0
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
Name | Type | Required | Default Value | Description |
---|---|---|---|---|
app_id | String | true | Your app id from your Okra Dashboard. | |
key | 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. |
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 |
Okra.buildWithShortUrl Options
Name | Type | Required | Description |
---|---|---|---|
short_url | String | true | Your generated url from link 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 |
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