zkPass
Website↗Github↗Twitter↗Discord↗
  • 🤝Get Started
  • User Guidelines
  • Overview
    • Introduction
    • Technical Overview V2.0
    • Use Cases
      • zkKYC
      • On-chain Achievements
      • Finance(DeFi&CeFi)
      • Governance and Voting
      • Gaming
      • Medical and Healthcare
      • Social Networking
      • Education and Research
      • Experience Checks
      • Eligible Access
      • Insurance Claim
  • developer guides
    • JS-SDK
      • How It Works
      • Quick Start
      • Generate proof and verify the result
        • EVM
        • Solana
        • Ton
      • Schema
        • Custom Schema
        • Quick Start for Creating Custom Schema
      • API References
      • Error Handling
      • References
    • Integration on Intract Quest
  • supports
    • FAQ
    • Roadmap
    • Terms & Conditions
    • Privacy Policy
Powered by GitBook

Feel free to contact us if you have any ideas

On this page
  • Register and Config the Project in zkPass DevHub
  • Integrate TransGate JS-SDK
  • Validate the result
  1. developer guides
  2. JS-SDK

Quick Start

PreviousHow It WorksNextGenerate proof and verify the result

Last updated 21 days ago

You can read before start to integrate zkPass TransGate-JS-SDK.

Register and Config the Project in zkPass DevHub


Login , 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


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)
    // The schema id of the project
    const schemaId = "516a720e-29a4-4307-ae7b-5aec286e446e"

    // Launch the process of verification
    // When running the TransGate SDK on a PC, if the user has not installed TransGate,
    // a QR code will pop up. The user can scan it using the TransGate App on their 
    // phone to complete verification (iOS users can directly use the system scanner)
    // or install TransGate from the Google Play Store. On mobile DApps, 
    // TransGate will automatically invoke the TransGate App.
    // If it is not installed, the user will be prompted to install it.
    const res = await connector.launch(schemaId)
    
    //If you want to bind the user's address with the proof, the `launch` function
    //also accepts a second parameter, which is the user's wallet address.
    const address = "0xD038048D1AE4c04dF2759F33BFda969999999641"
    const responseWithAddress = await connector.launch(schemaId, address)

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

TransGate download link is https://chromewebstore.google.com/detail/zkpass-transgate/afkoofjocpbclhnldmmaphappihehpma

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.

Developers can install the package using either or

You can refer to and for more information.

NPM
Yarn
A Comprehensive Guide to Verifying Private Data with zkPass
zkPass DevHub
Generate proof and verify the result
API References