# Developer Platform

<h2 align="center">🚀 Quick Start Guide – Akowe Template SDK</h2>

<p align="center"><a href="https://issuance.akowe.app/auth/create-account" class="button primary">Sign up</a> <a href="https://issuance.akowe.app/auth/login" class="button secondary">Log in</a></p>

***

The **Akowe Template SDK** lets you build and edit certificate templates with a drag-and-drop editor inside your own app.

***

### 1. Include the SDK

Add the SDK script to your page:

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

***

### 2. Initialize the SDK

```html
<script>
  const certApp = new CertificateSDK({
    onCreateCompleted: (data) => {
      console.log("Template created:", data);
      // send to Template Create API
    },
    onEditCompleted: (data) => {
      console.log("Template edited:", data);
      // send to Template Edit API
    },
    onError: (err) => {
      console.error("SDK Error:", err);
    },
    onClose: () => {
      console.log("User closed the modal");
    },
  });
</script>
```

***

### 3. Create a Template

```html
<button onclick="certApp.createTemplate()">Create Template</button>
```

👉 Opens the drag-and-drop editor.\
👉 Returns template JSON via `onCreateCompleted`.

***

### 4. Edit a Template

```html
<script>
  const existingTemplate = {
    id: "demo-id-123",
    name: "Demo Template",
    imageUrl: "https://cdn.example.com/demo-bg.jpg",
    fields: [
      { type: "name", text: "Full Name", x: 50, y: 40, fontSize: 16 },
      { type: "date", text: "Issue Date", x: 50, y: 60, fontSize: 16 }
    ],
    dimensions: { width: 1920, height: 1080 }
  };
</script>

<button onclick="certApp.editTemplate(existingTemplate)">Edit Template</button>
```

👉 Loads an existing template.\
👉 Returns updated JSON via `onEditCompleted`.

***

### 5. Close the Modal

```html
<button onclick="certApp.close()">Close Editor</button>
```

***

### 6. Send Data to API

Once you get the template JSON from the SDK, send it to the API:

```bash
# Create Template
curl --location 'https://issuance.akowe.app/api/template' \
--header 'x-api-key: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
  "name": "My Template",
  "imageUrl": "https://cdn.example.com/bg.jpg",
  "fields": [ ... ]
}'
```

***

✅ That’s it! In just a few lines, you can **create, edit, and manage templates** inside your own app.

***

<a href="https://issuance.akowe.app/auth/create-account" class="button primary" data-icon="rocket-launch">Get Your API Key</a> <a href="https://documentation.akowe.app/api-reference" class="button secondary" data-icon="terminal">API reference</a>
