Programmatically Issue a Credential
General steps to implement based on events in applications and onchain
Last updated
General steps to implement based on events in applications and onchain
Last updated
Programmatically Issue Verifiable Credentials (VCs)
Issue Verifiable Credentials (VCs) programmatically when certain events occur, such as when a user completes specific actions, swaps a token, completes a level in a game, or mints an NFT. VCs can be issued to a user's ETH address or DID. The options are endless and only bound by your imagination!
Generate a did:web to ensure credentials are signed with keys that you control
Select event(s) that will result in credential issuance
Leverage our API endpoint and set up logic in your platform to issue credentials
Determine conditions for issuing credentials to a users
Send POST requests to the API to issue the credentials
User receives credentials
Generate and return a signed Credential. This will also write the Credential the recipient's data backpack in Disco's Verifiable Data Registry. The JSON body should contain required Credential values for the schema type used. Available schemas and their specifications can be found at https://github.com/discoxyz/disco-schemas.
/v1/credential
The URL of the verifiable crednetial schema. Available schemas can be found at https://github.com/discoxyz/disco-schemas
https://raw.githubusercontent.com/discoxyz/disco-schemas/main/json/MembershipCredential/1-0-0.json
The DID address of the credential's claimant
did:3:Example987xyz
The fields and values for the credential (based on its schema)
{
"memberId": "Goldstar Member",
"membershipDescription": "Demo membership to showcase Disco API",
"membershipLevel": "Permanent",
"membershipType": "Developer",
"organization": "Disco.xyz"
}
The date for the credential to expire for the claimant. Leave empty if there's no expiration.
Optional - supported values are "JWT" and "712".
The DID address of the credential's issuer.
did:web:api.disco.xyz/v1/disco
To sign or not to sign - hint you should sign! Either leave out or assign false.
false