0.1.10 • Published 10 months ago

caas_sdk_web v0.1.10

Weekly downloads
-
License
ISC
Repository
github
Last release
10 months 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

10 months ago

0.1.8

10 months ago

0.1.7

10 months ago

0.1.9

10 months ago

0.1.6

10 months ago

0.1.0

11 months ago

0.1.2

11 months ago

0.1.1

11 months ago

0.1.4

11 months ago

0.1.3

11 months ago

0.1.5

11 months ago

0.0.24

1 year ago

0.0.23

1 year ago

0.0.22

1 year ago

0.0.21

1 year ago

0.0.20

1 year ago

0.0.19

1 year ago

0.0.18

1 year ago

0.0.17

1 year ago

0.0.16

1 year ago

0.0.15

1 year ago

0.0.14

1 year ago

0.0.13

1 year ago

0.0.12

1 year ago

0.0.11

1 year ago

0.0.10

1 year ago

0.0.9

1 year ago

0.0.8

1 year ago

0.0.7

1 year ago

0.0.6

1 year ago

0.0.5

1 year ago

0.0.4

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago