DICE Developer Docs
  • Developer Docs
    • DICE Test Drive
      • Sign-up for Issuer Portal
      • Issue Credentials
      • Verify Credentials
    • Key Concepts
      • DID & Verifiable Credentials
      • DICE ID Architecture
    • Platform Console
      • Dashboard
      • Customers
        • Onboard Customer
      • Credentials
        • Issue Credentials to New Customer
      • Schema
      • Batch Issuance
        • Batch Issuance - Useful Tips
      • Verifications
        • Verification Template
      • Templates
        • Certificate Template
          • Create Template
          • Manage Template
        • Email Template
          • Create Template
          • Manage Template
      • Organization
      • Departments
      • Organization Users
      • API Access
      • Callback Configuration
      • Tutorials
        • Credential Issuance from DICE ID Console
        • Credential Issuance using DICE ID APIs
        • Credential Verification using QR code
        • Credential Verification from DICE ID console
        • Batch Credential Issuance from DICE ID Console
    • Integrations
      • Auth0 Integration
        • Login using OIDC (First Factor Authentication)
        • Custom MFA Rule (For 2FA)
    • DICE ID SDK
      • DICE ID
        • DID & Verifiable Credentials
        • DICE ID Architecture
      • SDK Functionalities
      • Create Wallet
      • Create Connection
      • Creating a Schema
      • Issue a Credential
      • Send Presentation Request
      • Get Verification State
      • Configuration and Customization
      • Error Handling & Troubleshooting
      • Conclusion
      • Additional Resources
  • Getting Started with DICE ID Skill Credentials
    • Building Trust Ecosystems Powered by Credentials
    • DICE ID Integration for Issuers
    • DICE ID Integration for Verifiers
    • DICE ID Brand Usage Guidelines
    • DICE ID Onboarding Confirmation
    • Helpful Q&A
    • Troubleshooting Guide
Powered by GitBook
On this page
  1. Developer Docs
  2. DICE ID SDK

Send Presentation Request

Initiating the process of presenting credentials for verification

sampleSendPresentationRequest

The sampleSendPresentationRequest function demonstrates how to send a presentation request using the DiceID SDK. It uses the sendPresentationRequest API to send a presentation request to the specified verifier connection.

API Elements:

  1. diceidsdk.verifier.sendPresentationRequest(): Sends a presentation request to the specified verifier connection using the provided parameters.

    • VERIFIER_CONNECTION_ID: The ID of the verifier connection.

    • VERIFIER_TEMPLATE_ID: The ID of the presentation template associated with the verifier.

function sampleSendPresentationRequest() {
  console.log(VERIFIER_CONNECTION_ID);
  console.log(VERIFIER_TEMPLATE_ID);
    diceidsdk.verifier.sendPresentationRequest(VERIFIER_CONNECTION_ID, VERIFIER_TEMPLATE_ID)
    .then(resp => console.log("Presentation request sent"))
    .catch(err => console.log("Error:", err));
}

Running the Code

Step 1: Add the sampleSendPresentationRequest function to your code. Copy the function code provided and paste it after importing the diceidsdk module.

Step 2: Run the function by invoking it in your code. For example:

node sampleSendPresentationRequest.js

The function will use the sendPresentationRequest API to send a presentation request to the specified verifier connection. The response from the API will be logged to the console as "Presentation request sent".

PreviousIssue a CredentialNextGet Verification State

Last updated 1 year ago