Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot GET /https:/identity.dojah.io #5

Open
AugustBemsen opened this issue Dec 14, 2022 · 0 comments
Open

Cannot GET /https:/identity.dojah.io #5

AugustBemsen opened this issue Dec 14, 2022 · 0 comments

Comments

@AugustBemsen
Copy link

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;


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant