Quick Start

Register and Config the Project in zkPass Dev Center


Login zkPass dev center , connect the wallet.

Create a new project, enter project information.

After "Create", a project is created with an appid.

Click on 'Add Schema' and choose the schema category.

Choose a base schema (the base schema is a default template of schema without assertions).

Config the assertions based on the requirements.

After 'Submit', a schema is created automatically with an unique schemaId for the project.

Developers can add multiple schemas for the project.

Once the schema is successfully created, it cannot be modified but can be deleted. Please carefully review before submitting.

Integrate TransGate JS-SDK


Developers can install the package using either NPM or Yarn

Using NPM

npm install @zkpass/transgate-js-sdk

Using Yarn

yarn add @zkpass/transgate-js-sdk

Integrate the TransGate JS-SDK with your project

const verify = async () => {
  try {
    // The appid of the project created in dev center
    const appid = "8fb9d43c-2f24-424e-a98d-7ba34a5532f5"

    // Create the connector instance
    const connector = new TransgateConnect(appid)

    // Check if the TransGate extension is installed
    // If it returns false, please prompt to install it from chrome web store
    const isAvailable = await connector.isTransgateAvailable()

    if (isAvailable) {
      // The schema id of the project
      const schemaId = "516a720e-29a4-4307-ae7b-5aec286e446e"

      // Launch the process of verification
      // This method can be invoked in a loop when dealing with multiple schemas
      const res = await connector.launch(schemaId)

      // verifiy the res onchain/offchain based on the requirement     
      
    } else {
      console.log('Please install TransGate')
    }
  } catch (error) {
    console.log('transgate error', error)
  }
}

Please make sure the domain of DApp matches the configuration of the project in dev center.

Validate the result


After receiving the verification result(resin code block), developers should validate it.

You can refer to API References and How to Verify the Result for more information.

Last updated

Feel free to contact us if you have any ideas