0.1.10 • Published 2 years ago

caas_sdk_web v0.1.10

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

Caas Web SDK lets you integrate crypto onRamp, offRamp, KYC module provided by mudrex. Let's get started!

🏠 Homepage

🏠 Homepage

Install

Simply go to the command line and run this command.

npm i caas_sdk_web

Add the folllowing scrip tag in you index.html file

<script  src="https://hv-camera-web-sg.s3-ap-southeast-1.amazonaws.com/hyperverge-web-sdk@6.1.2/src/sdk.min.js"></script>

Usage

React Native Design System uses a centralized theme to provide consistency across all the components.

Step 1. Implement Signature API in backend that will create a signature for SDK.

Step 2. Implement the Init Function which needs to be passed to SDK.

const  init  =  async () => {
	let  myHeaders  =  new  Headers();
	myHeaders.append("X-USER-ID", "04bc7ef7-6cdf-4b1a-a4cc-93ed058a9a7c");
	myHeaders.append("X-CLIENT-ID", "18e963ea-39fd-4a1b-b1e6-decbfe791d31");
	myHeaders.append("X-AUTH-TOKEN", "clientId");

	let  requestOptions  = {
		method: "GET",
		headers: myHeaders,
		redirect: "follow",
	};

	let  result  =  await  fetch("https://staging.mudrex.com/api/v1/user/create_client_user_secret", requestOptions)
	.then((response) =>  response.text())
	.then((result) => {
		return  result;
	})
	.catch((error) => {});

	let  res  =  JSON.parse(result);
	return {
		signature: res?.secret,
		timestamp: res?.timestamp,
		userId: res?.user_id,
		clientId: res?.client_id,
		hv_token: res?.hv_token,
	};
};

Step 3. Initialise the SDK

//your root component
import { Caas } from "caas_sdk_web";

function App() {
  return (
    <div className="App">
      <Caas
        init={init}
        onSuccess={() => {
          console.log("Success");
        }}
        sdkConfiguration={{ steps: ["kyc"], kycEnabled: true }}
        onKYCSuccessCallback={() => {}}
        offRampSuccessCallback={() => {}}
      />
    </div>
  );
}
0.1.10

2 years ago

0.1.8

2 years ago

0.1.7

2 years ago

0.1.9

2 years ago

0.1.6

2 years ago

0.1.0

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.4

2 years ago

0.1.3

2 years ago

0.1.5

2 years ago

0.0.24

2 years ago

0.0.23

2 years ago

0.0.22

2 years ago

0.0.21

2 years ago

0.0.20

2 years ago

0.0.19

2 years ago

0.0.18

2 years ago

0.0.17

2 years ago

0.0.16

2 years ago

0.0.15

2 years ago

0.0.14

2 years ago

0.0.13

2 years ago

0.0.12

2 years ago

0.0.11

2 years ago

0.0.10

2 years ago

0.0.9

2 years ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago