> ## Documentation Index
> Fetch the complete documentation index at: https://docs.beyondwords.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Pugpig

Integrate [Pugpig Bolt](https://www.pugpig.com/) with BeyondWords to generate [audio](https://docs.beyondwords.io/docs-and-guides/content/audio.md) and/or [video](https://docs.beyondwords.io/docs-and-guides/content/video.md) from your articles and distribute them through Pugpig apps. BeyondWords is the AI text-to-speech provider; Pugpig communicates with BeyondWords via the [API](https://docs.beyondwords.io/docs-and-guides/integrations/api-overview.md) and [player API](https://docs.beyondwords.io/api-reference/player/show-2.md), streaming the same audio URLs you use on the web.

Pugpig also maintains integration documentation at [BeyondWords text to speech (Pugpig docs)](https://docs.pugpig.com/audio/beyondwords). This guide covers the BeyondWords side of the setup.

> [!TIP]
>
> Pugpig needs your BeyondWords **Project ID** to get started. Find it in **Settings → Integrations → API** in your project dashboard.

## How it works

There are two common ways content reaches BeyondWords from Pugpig. Most publishers use one or both, depending on how their Bolt edition is configured.

| Path | How content flows | BeyondWords setup |
| - | - | - |
| [**Pugpig feed**](#pugpig-feed-path) (most common) | BeyondWords polls your Pugpig edition feed and imports articles | [RSS Feed Importer](https://docs.beyondwords.io/docs-and-guides/integrations/rss-feed-importer.md) → **JSON (Pugpig)** |
| [**Pugpig Express API**](#pugpig-express-api-path) | Pugpig calls the BeyondWords API whenever a post is created or updated | Text-to-Speech plugin in Pugpig Express + [webhook](#configure-the-webhook) |

For **native app playback**, both paths typically need a [webhook](https://docs.beyondwords.io/docs-and-guides/integrations/webhooks.md). When BeyondWords finishes processing an article, it notifies Pugpig. Pugpig then fetches the generated audio via the [player API](https://docs.beyondwords.io/api-reference/player/show-2.md) and includes it in the app feed.

```mermaid theme={null}
sequenceDiagram
    participant Pugpig as Pugpig Express / Bolt
    participant BW as BeyondWords
    participant App as Pugpig app

    Pugpig->>BW: Create or update content (API or feed import)
    BW->>BW: Generate audio/video
    BW->>Pugpig: Webhook (audio.updated)
    Pugpig->>BW: Player API — fetch audio URLs
    Pugpig->>App: narration_url + audio_meta_data in feed
```

## How Pugpig uses your audio

Once audio is available, the Pugpig Bolt Text-to-Speech plugin (via Pugpig Express) distributes it as follows—see [Pugpig's integration doc](https://docs.pugpig.com/audio/beyondwords) for full detail:

* `narration_url`—added to the `content.html` page in the app edition
* `audio_meta_data`—title and image URL added to the atom feed

Pugpig calls the BeyondWords player API and uses the `audio` array from the response. It uses the entry with `content_type: audio/mpeg` (the `.mp3` file) and ignores the `application/x-mpegURL` stream (`.m3u8`).

> [!NOTE]
>
> If audio has not finished generating when Pugpig first fetches the player API, the `audio` array may be empty. Pugpig can fetch again when the article is subsequently updated, or once the [`audio.updated`](https://docs.beyondwords.io/docs-and-guides/integrations/webhooks#audioupdated) webhook fires and Pugpig re-queries the API.

## Choose your integration path

### Pugpig feed path

Use this when your Pugpig edition exposes a **JSON (Pugpig)** feed—the most common setup for Bolt clients.

1. Set up the [RSS Feed Importer](https://docs.beyondwords.io/docs-and-guides/integrations/rss-feed-importer.md) with feed type **JSON (Pugpig)**
2. Configure [page extraction](https://docs.beyondwords.io/docs-and-guides/integrations/rss-feed-importer.md#how-does-page-extraction-work) and field mapping as needed
3. Optionally enable **Restrict to articles marked for audio in Bolt CMS** to import only stories with `BeyondwordsCreateAudio` set in `custom_analytics`
4. Configure the [webhook](#configure-the-webhook) so Pugpig apps receive audio when generation completes

### Pugpig Express API path

Use this when Pugpig sends content directly to BeyondWords through the **Text-to-Speech plugin** in Pugpig Express—rather than (or in addition to) the feed importer.

Follow the steps below, then configure the [webhook](#configure-the-webhook).

## Pugpig Express API path

**1. Copy your project ID**

Go to **Settings → Integrations → API** in your project dashboard and copy the **Project ID**.

**2. Share your project ID with Pugpig**

Open the **Text-to-Speech** plugin in Pugpig Express and paste your BeyondWords **Project ID** into the relevant field.

Pugpig will call the BeyondWords API each time a post is created or updated. See [Pugpig's setup guide](https://docs.pugpig.com/audio/beyondwords#what-do-we-need-from-you-to-get-set-up) for plugin-specific steps.

**3. Configure the webhook**

See [Configure the webhook](#configure-the-webhook) below — required for Pugpig to know when audio generation is complete.

**4. Publish as normal**

Publish or update articles in Pugpig as normal. BeyondWords generates audio/video as per your project settings. Once processing completes, Pugpig is notified via webhook and fetches the audio URLs from the player API.

## Configure the webhook

Pugpig Express exposes a webhook endpoint that listens for BeyondWords notifications and updates app content once audio is ready.

**1. Get your Pugpig webhook URL**

Your Pugpig Express site provides a webhook URL in this format:

```text theme={null}
https://{your-site}.express.pugpig.com/wp-json/pugpig/beyondwords/webhook/audio-update/
```

Replace `{your-site}` with your Express site subdomain. Pugpig documents this endpoint in their [webhook configuration guide](https://docs.pugpig.com/audio/beyondwords#configure-webhook-endpoint-in-beyondwords).

**2. Add the webhook in BeyondWords**

Go to **Settings → Webhooks** in your BeyondWords project dashboard.

Click **+ Webhook** and paste your Pugpig webhook URL into **Webhook URL**.

Toggle **Enabled** on, then click **Save changes**.

BeyondWords sends an [`audio.updated`](https://docs.beyondwords.io/docs-and-guides/integrations/webhooks#audioupdated) event when generation completes successfully.

**3. Add request headers (optional)**

If Pugpig's webhook endpoint requires authentication, add the required **Header name** and **Header value** pairs in the webhook settings.

**4. Enable static IP (optional)**

If Pugpig's endpoint requires IP allowlisting, enable **Static IP** on the webhook and allowlist the displayed address in Pugpig's firewall configuration.

> [!NOTE]
>
> Webhook requests are sent from `20.234.8.180` when static IP is enabled.

## Fine-tuning

* [Content extraction](https://docs.beyondwords.io/docs-and-guides/integrations/content-extraction.md)—when using the [Pugpig feed path](#pugpig-feed-path), [content filters](https://docs.beyondwords.io/docs-and-guides/integrations/content-extraction.md#filters) apply to imported HTML
* [Data attributes](https://docs.beyondwords.io/docs-and-guides/integrations/data-attributes.md)—per-article metadata and segment control in HTML
* [Voices](https://docs.beyondwords.io/docs-and-guides/voices/overview.md) and [player settings](https://docs.beyondwords.io/docs-and-guides/distribution/player/player-settings.md)—project defaults in the BeyondWords dashboard
* [Web player](https://docs.beyondwords.io/docs-and-guides/distribution/player/installation/javascript-sdk.md)—install separately on your website if you want web playback in addition to the Pugpig app

## FAQs

> [accordion] Should I use the Pugpig feed or the Express API?
>
> **Pugpig feed** (via the [RSS Feed Importer](https://docs.beyondwords.io/docs-and-guides/integrations/rss-feed-importer.md)) is the most common path for Bolt edition clients. **Pugpig Express API** (Text-to-Speech plugin) is used when Pugpig pushes content directly on post create/update. Some publishers use both. Either way, configure a [webhook](#configure-the-webhook) for native app distribution.

> [accordion] Does audio appear immediately after publishing?
>
> Not always. Generation typically takes a few minutes. If Pugpig queries the player API before audio is ready, the `audio` array may be empty — a [known behaviour documented by Pugpig](https://docs.pugpig.com/audio/beyondwords#known-issues). Once the webhook fires or the article is updated again, Pugpig can fetch the completed audio.

> [accordion] Can I restrict which articles get audio?
>
> Yes. For the **Pugpig feed** path, enable **Restrict to articles marked for audio in Bolt CMS** in the [RSS Feed Importer](https://docs.beyondwords.io/docs-and-guides/integrations/rss-feed-importer.md) page extraction settings. BeyondWords only imports  stories where `custom_analytics.BeyondwordsCreateAudio` is set in the Pugpig feed.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.