1.1.1 • Published 3 years ago

relysia-sdk v1.1.1

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

Introduction

relysia-sdk is a helper package for OAuth login. This package provides a react component which will help to initiate the login process and receive response with credential after successful login.

Install

npm i relysia-sdk

How to use

Use Custom Component

import React from 'react';
import ReactDOM from 'react-dom';
import RelysiaLogin from 'relysia-sdk';

const responseRelysia = (response) => {
  console.log(response);
}

ReactDOM.render(
  <RelysiaLogin
    clientKey="61bfb74d-a25c-43d1-b8ab-520ffb5c5ffe"
    clientSecret="KTeUGSPDSaXQGfaUfKXIVSAZOcNBRCMOVaGFfbdHWRDKWVPbIQWLbUAOUBHYOa"
    onSuccess={responseRelysia}
    onError={responseRelysia}
    customComponent={<button>RelysiaLogin</button>}
  />,
  document.getElementById('root')
);

Use Button Text

import React from 'react';
import ReactDOM from 'react-dom';
import RelysiaLogin from 'relysia-sdk';

const responseRelysia = (response) => {
  console.log(response);
}

ReactDOM.render(
  <RelysiaLogin
    clientKey="61bfb74d-a25c-43d1-b8ab-520ffb5c5ffe"
    clientSecret="KTeUGSPDSaXQGfaUfKXIVSAZOcNBRCMOVaGFfbdHWRDKWVPbIQWLbUAOUBHYOa"
    onSuccess={responseRelysia}
    onError={responseRelysia}
    buttonText={"RelysiaLogin"}
  />,
  document.getElementById('root')
);

How to get all your wallets

You can import a method from the package relysia-sdk inside your program name getWallets. This method accept one object as arguments and the arguments format will be,

{
  oauthToken: 'The token you got from the oauth login'
}

This method will return all your wallets with walletId. Full example will be,

import {getWallets} from 'relysia-sdk';
const resp = await getWallets({oauthToken: 'YourOauthToken'});

How to pay

You can import a method from the package relysia-sdk inside your program name pay. This method accept one object as arguments and the arguments format will be,

{
  paymailAddress: 'adityapanther@handcash.io',
  amount: 500,
  oauthToken: 'YourOauthToken',
  walletid: 'YourWalletId'
}

This method will make the payment. Full example will be,

import {pay} from 'relysia-sdk';
const resp = await pay({
  paymailAddress: 'adityapanther@handcash.io',
  amount: 500,
  oauthToken: 'YourOauthToken',
  walletid: 'YourWalletId'
})
1.1.1

3 years ago

1.1.0

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago