Before starting, note that the Gateway Widget Issue can only be used for issuing PDAs by an organization. Make sure you already have an Organization and a Data Models.

⚠️ Only organizations can create widget sessions



Generate a Session

Now you can insert the required information into the API call body found below:

const sessionProps = JSON.stringify({
  organizationId: "YOUR-ORGANIZATION-ID",
  dataSourceId: "YOUR-DATA-SOURCE-ID",
  callbackUrl: "YOUR-SUCCESS-URL",
  claim: {
    title: "Title example",
    /*Example - End*/
  image: "", // add an image URL
  title: "PDA-TITLE", // optional
  description: "PDA-DESCRIPTION", // optional
  referenceId: "REFERENCE-ID", // optional

async function generateSession() {
  const response = await fetch(
      method: "POST",
      body: sessionProps,

  const {
    data: { session },
  } = await response.json();
  window.location.href = session.url;

const generateButton = document.getElementById("generateSession");
generateButton.addEventListener("click", generateSession);

The claim fields are in JSON format. For example, a string would be "teststring": "value".


Call the API

Generate a session for the user based on the parameters you have passed.


Get the link from the response and send to user

The response that you should receive is something like this:

  "session": {
    "url": "",
    "sessionId": "cc348d85-c723-4183-b174-8424793d481f"

You can now pass the url to the user to complete the PDA issuance process.

A session can be used only once. Each call to the generate-session API creates a different session, even if the PDA data is the same.

Video Tutorial