cjayprime / react-dojah Goto Github PK
View Code? Open in Web Editor NEWThis is a react.js library for implementing the dojah widget gateway.
Home Page: https://www.npmjs.com/package/react-dojah
License: MIT License
This is a react.js library for implementing the dojah widget gateway.
Home Page: https://www.npmjs.com/package/react-dojah
License: MIT License
I'm having issues setting up this SDK. it returns this Cannot GET /https:/identity.dojah.io
on a white page
Here is my setup
import React from "react";
import Dojah from "react-dojah";
const DojahComponent = () => {
const appID = process.env.NEXT_PUBLIC_DOJAH_APP_ID;
const publicKey = process.env.NEXT_PUBLIC_DOJAH_PUBLIC_KEY;
const type = process.env.NEXT_PUBLIC_DOJAH_LINK;
/**
* These are the configuration options
* available to you are:
* {debug: BOOL, pages: ARRAY[page: STRING, config: OBJECT]}
*
* The config object is as defined below
*
* NOTE: The
>
> OTP and selfie options are only
* Available to the `verification` widget
*/
const config = {
debug: true,
pages: [
{
page: "government-data",
config: {
bvn: true,
nin: false,
dl: false,
mobile: false,
otp: false,
selfie: false,
},
},
{ page: "selfie" },
{ page: "id", config: { passport: false, dl: true } },
],
};
/**
* These are the user's data to verify, options
* available to you possible options are:
* {first_name: STRING, last_name: STRING, dob: DATE STRING}
*
* NOTE: Passing all the values will automatically skip
* the user-data page (thus the commented out `last_name`)
*/
const userData = {
first_name: "Chijioke",
last_name: "", // 'Nna'
dob: "2022-05-01",
};
/**
* These are the metadata options
* You can pass any values within the object
*/
const metadata = {
user_id: "121",
};
const response = (type, data) => {
console.log(type, data);
if (type === "success") {
console.log("success");
} else if (type === "error") {
console.log("error");
} else if (type === "close") {
console.log("close");
} else if (type === "begin") {
console.log("begin");
} else if (type === "loading") {
console.log("loading");
}
};
// The Doja library accepts 3 props and
// initializes the doja widget and connect process
return (
<Dojah
response={response}
appID={appID}
publicKey={publicKey}
type={type}
config={config}
userData={userData}
metadata={metadata}
/>
);
};
export default DojahComponent;
When installing I get this error
npm ERR! Found: [email protected]
npm ERR! node_modules/react
npm ERR! react@"^18.2.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^16.0.0" from [email protected]
npm ERR! node_modules/react-dojah
npm ERR! react-dojah@"^1.1.0" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
I don't want to resolve issue by using --force
or --legacy-peer-deps
Could not find a declaration file for module 'react-dojah'. 'LINK-TO-PROJECT/.yarn/__virtual__/react-dojah-virtual-9a5d565b35/0/cache/react-dojah-npm-1.1.0-0a05fe67da-4c06de8f2f.zip/node_modules/react-dojah/dist/index.js' implicitly has an 'any' type. Try
npm i --save-dev @types/react-dojahif it exists or add a new declaration (.d.ts) file containing
declare module 'react-dojah';ts(7016)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.