hand-waveSDK Documentation


The Akowe Template SDK allows you to design and edit certificate templates directly in your application using a drag-and-drop editor. Once a template is created or edited, you can easily pass the resulting data to the Template Create or Template Edit API endpoints.


1. Installation

Include the SDK script in your HTML file:

<script src="https://issuance.akowe.app/sdk"></script>

2. Initialize the SDK

Create a new instance of CertificateSDK with lifecycle callbacks for handling events.

<script>
  const certApp = new CertificateSDK({
    onLoad: (res) => {
      console.log("SDK Loaded:", res);
    },
    onCreateCompleted: (data) => {
      console.log("New template created:", data);
      // Send this `data` to your Template Create API
    },
    onEditCompleted: (data) => {
      console.log("Template edited:", data);
      // Send this `data` to your Template Edit API
    },
    onClose: () => {
      console.log("Modal closed");
      // Call this when after a successful request to template Create or Edit endpoint
    },
    onError: (err) => {
      console.error("SDK error:", err);
    }
  });
</script>

3. Create a New Template

To allow a user to design a new certificate template, call the createTemplate() method. This will open the drag-and-drop editor in a modal.

✅ When the user saves the design, the onCreateCompleted callback returns the final template JSON.

Example output:

You can then send this JSON to the Template Create API endpoint.


4. Edit an Existing Template

To load and edit a previously saved template, call editTemplate(templateObject) with the template JSON you want to edit. You can get templates by utilizing the Get Template endpoint

Example demoTemplate:

✅ When editing is complete, the onEditCompleted callback provides the updated template JSON. You can then send this to the Template Edit API endpoint.


5. Closing the Modal

You can programmatically close the editor modal with:

The onClose callback will be triggered when the modal is closed.


6. Typical Workflow

  1. User clicks Create Template → designs template → result JSON returned via onCreateCompleted.

  2. You send the result JSON to your backend via the Template Create API.

  3. Later, user clicks Edit Template → loads existing template JSON → edits and saves → updated JSON returned via onEditCompleted.

  4. You send the updated JSON to the Template Edit API.


7. Error Handling

The SDK may throw errors (e.g., missing container, invalid template object). Always handle them with the onError callback:


8. Full Example


Last updated