Socket
Socket
Sign inDemoInstall

angular8-okra

Package Overview
Dependencies
Maintainers
4
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

angular8-okra

Okra widget for angular 2+


Version published
Weekly downloads
13
increased by8.33%
Maintainers
4
Weekly downloads
 
Created
Source

okra-angular

This is an angular module that abstracts the complexity of using okra with Angular2+.

USAGE

1. Install the module

npm install --save angular8-okra

2. Import the module

In your app.module.ts or any module where the component or directive would be used like so:

import { NgModule } from '@angular/core';

import { Angular8OkraModule } from 'angular8-okra';
...

@NgModule({
  imports: [
    Angular8OkraModule.forRoot('public_key_xxxxxxxxxxxxxxxxxxxxxxxx'),
  ]
})

export class AppModule {}

3. Implement in your project

There are two available options

  • AngularOkraComponent: Renders a button which when clicked loads okra Inline

      <okra-button
        [customStyle]="{'font-size.px':14, 'color' : 'green', 'background-color' : 'coral'}"
        [clientName]="'bassey'" 
        [env]="'sandbox'" 
        [callback_url]="'www.my-webhook.com'"
        [products]="['auth', 'transactions', 'balance', 'income', 'identity']" (onClose)="okraCancel()"
        (onSuccess)="okraDone()">
        Open Okra
      </okra-button>
    
  • AngularOkraDirective: A directive that loads okra inline when clicked

  <button
    okraButton
    [customStyle]="{'font-size.px':14, 'color' : 'green', 'background-color' : 'coral'}"
      [clientName]="'bassey'" 
      [env]="'sandbox'" 
      [callback_url]="'www.my-webhook.com'"
      [products]="['auth', 'transactions', 'balance', 'income', 'identity']" (onClose)="okraCancel()"
      (onSuccess)="okraDone()">
    Open okra
  </button>

And then in your component.ts

  import { Component, OnInit } from '@angular/core';

  @Component({
    selector: 'app-root',
    templateUrl: './app.component.html',
    styleUrls: ['./app.component.css']
  })
  export class AppComponent implements OnInit {
    reference = '';
    constructor() {}

    okraInit() {
      console.log('Okra initialized');
    }

    okraDone(ref: any) {
      this.title = 'Okra successfull';
      console.log(this.title, ref);
    }

    okraCancel() {
      console.log('Okra cancelled');
    }
  }
  

OkraOptions

NameTypeRequiredDefault ValueDescription
callback_url stringtrueundefinedThis is your webhook to which okra sends the clients data to.
key StringfalseundefinedYour public key from Okra.
productsArrayList<Enums.Product>trueundefinedThe Okra products you want to use with the widget. list of products include: 'auth', 'transactions', 'balance', 'income', 'identity'
envEnums.Environmenttrueundefined
clientNameStringtrueundefinedName of the customer using the widget on the application
userobjectfalseundefinedThis contains some information of the user using the okra widget {fullname: 'USER_FULL_NAME',email: 'USER_EMAIL', bvn: 'USER_BVN'}

For more information checkout okra's documentation

Contributing

Please feel free to fork this package and contribute by submitting a pull request to enhance the functionalities.

License

The MIT License (MIT). Please see License File for more information.

Keywords

FAQs

Package last updated on 07 May 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc