---
title: Initializing the Embed SDK
description: Learn how to initialize the PostNitro Embed SDK in your web application to start creating and editing carousels seamlessly.
canonical: https://postnitro.ai/docs/embed/sdk/initialization
---

# Initialization

Before using the Postnitro Embed functionality, you need to initialize the editor instance.

#### Module Initialization
```typescript
const editor = createEditor({
    apiKey: "your-api-key",
});
```

#### Script Initialization
When using the script, the editor is available as a global variable:

```typescript
const editor = window.postnitroEmbed.createEditor({
    apiKey: "your-api-key",
});
```

Replace `your-api-key` with your actual API key provided by Postnitro.

#### Default Headshot
You can set a default headshot for the editor by passing the `defaultHeadshot` option:

```typescript
const editor = createEditor({
    apiKey,
    defaultHeadshot: {
        name: 'PostNitro.ai',
        logo: 'https://postnitro.ai/embed/embed-loader.svg',
        handle: 'Create Carousels in seconds',
    }
});
```

> **Note:** The `defaultHeadshot` is used as the headshot for new users who don't have a headshot set.
