# HowdyGo SDK

> Install the HowdyGo SDK with a publishable key, identify viewers by email and external user ID, personalize demos, and control embedded playback.

The HowdyGo SDK lets your website or app identify demo viewers, personalize content, open pop-up demos, and control playback. Its keyed [Tracking Script](https://docs.howdygo.com/distribute/sdk/tracking-script) can also capture visitor information from the sources you enable, including forms, CRM cookies, and analytics tools.

## Add the SDK to your page

Create a publishable SDK key in **Settings > Integrations > Tracking Script**, then copy the generated snippet into your website's `<head>`, before any SDK calls. An Admin on a Pro or Enterprise plan can create and configure keys.

The example below uses a placeholder. Replace `hgk_your_publishable_key` with your own key, or use the complete snippet from settings.

```html
<script>
window.HOWDYGO_CONFIG = { config: { key: "hgk_your_publishable_key" } };
</script>
<script src="https://app.howdygo.com/sdk/snippet.js"></script>
```

The snippet creates `window.howdygo` immediately and loads the SDK in the background. Add it once per page. For Google Tag Manager, use the generated **Google Tag Manager** snippet in a Custom HTML tag; see the [installation instructions](https://docs.howdygo.com/distribute/sdk/tracking-script#create-and-install-a-key).

> [!TIP]
> Keyless installations are deprecated and log a console warning once per SDK
> instance. Existing manual identification, personalization, modal, and player
> control calls continue to work. Automatic visitor tracking requires a key.

## Identify the current viewer

Use `externalUserId` for your application's stable user ID and `email` for the viewer's email address. Both are optional, and you can supply either one or both.

```javascript
howdygo.identify({
  externalUserId: "customer-123",
  email: "jane@example.com",
  name: "Jane Smith",
  company: "Acme Corp",
});
```

For profile updates, personalization, and how these values appear in analytics, read [Identification & Personalization](https://docs.howdygo.com/distribute/sdk/identify).

## Choose an API

- [Tracking Script](https://docs.howdygo.com/distribute/sdk/tracking-script)
- [Identification & Personalization](https://docs.howdygo.com/distribute/sdk/identify)
- [Pop-up Modal Embeds](https://docs.howdygo.com/distribute/sdk/modal)
- [Player Control](https://docs.howdygo.com/distribute/sdk/player-control)

## Calls made before a demo loads

Once the snippet has run, calls such as `identify()`, `personalize()`, and `openModal()` can be queued while the SDK loads. If you load the snippet itself with an asynchronous script tag, wait for that script before making any calls.

The SDK discovers HowdyGo iframes and sends the current stored identity to demos that load later. Partial identity updates are retained across page navigation while browser storage is available.

Methods that return values, such as `getStoredIdentity()` and `control()`, need the initialized SDK. The loading snippet only queues calls; it cannot return stored data or a player controller. Once you have a controller with an explicit demo ID, its commands can wait for that iframe to register.

For identity from CRM cookies, forms, query parameters, or existing analytics tools, install the keyed [Tracking Script](https://docs.howdygo.com/distribute/sdk/tracking-script).
