Web Integration

Add audio to any website

Add the Everlit audio player to your website with a simple HTML snippet. Works with any CMS or custom site, with built-in support for popular platforms.

Overview

The everlitAutoAudio.js script enables automatic audio conversion and playback for your web content. Simply add two HTML elements to your page and the script handles everything else.

Works Everywhere: Add Everlit to any website, CMS, or web application. No server-side changes required.

How It Works

1. Content Detection

Script automatically extracts article content from your page

2. Audio Check

Checks if audio already exists for this URL

3. Conversion

Creates audio if needed (typically 30-180 seconds)

4. Player Display

Injects the audio player when ready

Basic Implementation

Add these two elements to your article pages:

<!-- 1. The widget container -->
<div
  id="everlit-auto-audio-widget"
  data-publication-id="YOUR-PUBLICATION-ID"
  style="height: 136px; width: 100%;"
  hidden
><a href="https://everlit.audio/" rel="nofollow">Listen to this article &mdash; audio by Everlit</a></div>

<!-- 2. The script -->
<script
  defer
  src="https://cdn.everlit.audio/libs/everlitAutoAudio.js"
  type="text/javascript"
></script>
That's it! The script automatically detects your article content and displays the audio player when ready.

Where to Place It

Place the widget container where you want the audio player to appear—typically at the top of the article, below the headline, or in a sidebar. The script tag can go anywhere (we recommend before </body>).

Required Attributes

Attribute Description
id="everlit-auto-audio-widget" Required. The script looks for this exact ID.
data-publication-id Your Everlit publication ID (found in your dashboard).

CMS Support

The Everlit script works with any CMS or custom website. It automatically detects article content from popular platforms and falls back to standard HTML patterns for others.

Customizable CMS Support

The Everlit Auto Audio JS can be customized to support any CMS or custom website. Here are a few platforms that are automatically detected with optimized content extraction:

Arc / Fusion

Auto-extracts from Fusion.globalContent. Captures headlines, body text, authors, tags, and sections.

Brightspot

Detects via brightspot.contentId meta tag. Extracts from article body classes and LD+JSON schema.

Next.js

Reads from __NEXT_DATA__ script. Full support for Next.js sites.

Other CMS Platforms

For all platforms (Navigator, Drupal, Ghost, custom sites, etc.), the script uses standard and customizable content detection patterns:

  • Looks for class's containing likely article data
  • Extracts text from <p>, <div>, and various other tags within the article
  • Identifies the article by the canonical URL and leverages any Open Graph or other meta tags to enrich the article
Tip: If automatic detection doesn't find your content, use the Auto Audio API to pass the article URL and content explicitly.
Need More? Need full customization? Use the Auto Audio API directly.

Configuration Options

The widget reads the attributes below. The article URL, title, and content are detected automatically from the page (see CMS Support).

Attribute Required Description
data-publication-id Yes Your Everlit publication ID
data-everlit-access No Per-visitor paywall signal. Only used when the audio paywall is enabled for your publication (see below).
Need more control? Per-article options such as voice selection or passing content explicitly are handled at the publication level or through the Auto Audio API.

Paywall Access Signal

If your publication has the audio paywall enabled, set data-everlit-access to the current visitor's access status (for example, from the subscription check you run when rendering the page). When the visitor is blocked, the widget shows a blurred player with a subscribe call-to-action instead of generating or playing audio.

These values are treated as blocked (case-insensitive): blocked, false, 0, no, gated, locked. Any other value—or omitting the attribute—is treated as allowed. The attribute has no effect unless the paywall is enabled for your publication.

<!-- Blocked visitor: widget shows the blurred paywall placeholder -->
<div
  id="everlit-auto-audio-widget"
  data-publication-id="YOUR-PUBLICATION-ID"
  data-everlit-access="blocked"
  style="height: 136px; width: 100%;"
  hidden
></div>

Styling

The widget container should have a minimum height of 136px. The player will appear inside this container when audio is ready. You can style the container to match your site design.

<style>
  #everlit-auto-audio-widget {
    height: 136px;
    width: 100%;
    margin: 20px 0;
    border-radius: 8px;
    overflow: hidden;
  }

  #everlit-audio-embed-container iframe {
    width: 100%;
    border: none;
  }
</style>

JavaScript Events

The widget dispatches custom events on document (they bubble, so window listeners work too). Listen for these to respond to conversion and player state:

Event When it fires event.detail
everlit:processing Audio conversion has started for this URL { processing, url }
everlit:ready The audio player has been injected and is ready { embed, element, articleId, metadata }
everlit:clickToCreate A "click to create" placeholder is shown (audio not yet generated) { clickToCreate, processing, element }
everlit:error An error occurred during the check, conversion, or setup { error, reason }

Example: Listening for Events

<script>
  document.addEventListener('everlit:ready', function (e) {
    console.log('Audio player is ready', e.detail);
  });

  document.addEventListener('everlit:processing', function (e) {
    console.log('Conversion started for', e.detail.url);
  });

  document.addEventListener('everlit:error', function (e) {
    console.error('Everlit error:', e.detail.reason);
  });
</script>

Player Events

Network tier and above. Player Events are available on the Network plan and higher. Contact support@everlit.audio or your account manager to enable them for your account.

Once enabled, the Everlit player posts realtime playback events from its iframe to your page via window.postMessage. Use them for on-page activation—fire your own analytics events, enrich them with your visitor's identity or subscription data, or trigger a prompt when a listener finishes an episode. They work wherever the player is embedded: the auto audio widget, playlist embeds, or a direct iframe.

Message Format

{
  "type": "everlit:event",
  "event": "play",          // "play" | "pause" | "complete"
  "articleId": "artl_...",  // the article being played
  "eut": "..."              // the end-user tag for this listener
}
Event When it fires
play Playback starts or resumes
pause The listener pauses playback
complete The listener crosses 95% of the audio—the same completion definition used in your Everlit analytics, so your counts reconcile with your dashboard. Fires at most once per track.

Events describe content playback only—ad breaks never emit events. In playlist embeds, articleId always reflects the track currently playing.

Example: Listening for Player Events

<script>
  window.addEventListener('message', function (e) {
    if (e.data?.type !== 'everlit:event') return;

    // Enrich with your own visitor data and forward to your analytics
    yourAnalytics.track('audio_' + e.data.event, {
      articleId: e.data.articleId,
      everlitListenerId: e.data.eut,
      userId: yourCurrentUser.id
    });
  });
</script>

Correlating with Everlit Analytics

The eut (end-user tag) is the same pseudonymous listener identifier that appears as client_user_tag in your Everlit metric exports and BigQuery data. Store it alongside your own user ID to join realtime on-page events with the full listening history in your exports. If you already pass your own identifier into the player via the eut parameter, events echo that value back.

Note: Player Events are a realtime activation signal for the page the listener is on—they only fire on pages where your listener code runs. For reporting and analysis, use your scheduled metric exports, which remain the canonical record of listening activity.

Troubleshooting

Common Issues

Issue Possible Cause Solution
Widget not appearing Missing or incorrect publication ID Verify data-publication-id matches your dashboard
Content not detected Non-standard page structure Add class="articleBody" to your content container, or use the API directly
"Click to create" shows repeatedly URL changes between page loads Add a stable <link rel="canonical"> tag so the widget reports a consistent URL
Audio not playing Browser autoplay restrictions User must interact with page first; this is expected browser behavior
Wrong content extracted Multiple article-like sections on page Use the API with explicit extractedText parameter

Debug Mode

Check the browser console for debug information. The script logs key events during initialization.

Need Help? Contact support@everlit.audio with your publication ID and the URL where you're seeing issues.

Next Steps