Giter VIP home page Giter VIP logo

react-dojah's People

Contributors

cjayprime avatar sanchezqb avatar yemmyfolayan avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

react-dojah's Issues

Cannot GET /https:/identity.dojah.io

I'm having issues setting up this SDK. it returns this Cannot GET /https:/identity.dojah.io on a white page
localhost_3000_settings(Laptop 14')

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;


React dojah is not compatible with React 18.2.0

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

Typescript Support

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 containingdeclare module 'react-dojah';ts(7016)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.