Available Functions

These functions can be used within the mapping object when signing the credential using the verifiable-credentials lib. For details on issuance, you checkout this guide.

A list of functions with their correct syntax to be used in the mapping object below:

UUID

<uuid> to get a unique identifier.

Subject Did

<subjectDid> to get the recipient's DID once the credential gets claimed.

Issuer DID

<issuerDid> to get the subject did.

Timestamp

<timestamp> to get the current timestamp in ISO 8601 format YYYY-MM-DDThh:mm:ss.sssZ

Timestamp Seconds

<timestamp-seconds> to get the Unix timestamp.

Timestamp In

<timestamp-in:duration> to get a future date by providing the duration as an argument (e.g., "timestamp-in:365d" for one year from now). Returned timestamp will be in ISO 8601 format YYYY-MM-DDThh:mm:ss.sssZ

Timestamp In Seconds

<timestamp-in-seconds:duration> to get a future date by providing the duration as an argument (e.g., " timestamp-in-seconds:365d" for one year from now). Returned will be a Unix timestamp.

Timestamp Before

<timestamp-before:duration> to get a date in the past by providing the duration as an argument (e.g., " timestamp-before:365d" for one year ago from now). The returned timestamp will be in ISO 8601 format YYYY-MM-DDThh:mm: ss.sssZ

Timestamp Before Seconds

<timestamp-before-seconds:duration> to get a date in the past by providing the duration as an argument (e.g., " timestamp-before-seconds:365d" for one year ago from now). The returned value will be a Unix timestamp.

Webhook

<webhook:url> to make a request to a specific URL. It will insert the response of the request as a plain text string. The webhook URL is provided as an argument (e.g., "webhook:https://example.com").

Webhook JSON

<webhook-json:url> to make a request to a specific URL. It will insert the response body as a nested JSON object. The webhook URL is provided as an argument (e.g., "webhook-json:https://example.com").