relysia-sdk
v1.1.1
Published
vaionex authorization button
Downloads
6
Readme
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: '[email protected]',
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: '[email protected]',
amount: 500,
oauthToken: 'YourOauthToken',
walletid: 'YourWalletId'
})