Skip to content

Scripts Host

The Scripts Host service provides centralized hosting and delivery of Sesamy JavaScript libraries with vendor-specific configuration and version control.

Overview

The Scripts Host service allows you to easily integrate Sesamy functionality into your website by serving pre-configured JavaScript bundles. This eliminates the need for manual script installation and configuration management.

Key Features

  • Version Control: Serve specific versions (stable, latest, or version numbers) of Sesamy libraries
  • Vendor Configuration: Automatic bundling of vendor-specific settings and customizations
  • CDN Delivery: Fast, reliable delivery through Cloudflare's global CDN
  • Automatic Updates: Easy migration to new versions without code changes

Script URLs

Sesamy JS Bundle

The easiest way to add Sesamy JS to your website:

html
<script src="https://scripts.sesamy.com/s/YOUR_VENDOR_ID/bundle/stable"></script>

Replace YOUR_VENDOR_ID with your vendor identifier provided by Sesamy.

Individual Scripts

You can also load individual components:

html
<!-- Sesamy JS Library -->
<script src="https://scripts.sesamy.com/s/YOUR_VENDOR_ID/sesamy-js/stable"></script>

<!-- Sesamy Components -->
<script src="https://scripts.sesamy.com/s/YOUR_VENDOR_ID/sesamy-components/stable"></script>

Configuration

The Scripts Host automatically includes your vendor's configuration, eliminating the need for manual setup. Your configuration includes:

  • Content selectors for paywalls and articles
  • Authentication settings
  • Custom transformations
  • Analytics integrations

Version Management

Available Versions

  • stable - The latest stable release (recommended for production)
  • latest - The most recent release (may include breaking changes)
  • Specific version - e.g., 1.2.3 for exact version control

Version Examples

html
<!-- Use stable version -->
<script src="https://scripts.sesamy.com/s/YOUR_VENDOR_ID/bundle/stable"></script>

<!-- Use specific version -->
<script src="https://scripts.sesamy.com/s/YOUR_VENDOR_ID/bundle/1.2.3"></script>

<!-- Use latest (development only) -->
<script src="https://scripts.sesamy.com/s/YOUR_VENDOR_ID/bundle/latest"></script>

Integration Examples

Basic Setup

html
<!DOCTYPE html>
<html>
  <head>
    <title>My Website</title>
    <!-- Load Sesamy JS Bundle -->
    <script src="https://scripts.sesamy.com/s/YOUR_VENDOR_ID/bundle/stable"></script>
  </head>
  <body>
    <h1>Premium Content</h1>
    <div data-sesamy-paywall="article-123">
      <p>This content requires payment...</p>
    </div>

    <script>
      // Sesamy JS is automatically initialized with your vendor configuration
      window.addEventListener('sesamyJsReady', () => {
        console.log('Sesamy JS ready!');
      });
    </script>
  </body>
</html>

Custom Configuration

If you need additional customization beyond your vendor defaults:

html
<!DOCTYPE html>
<html>
  <head>
    <title>My Website</title>
    <script src="https://scripts.sesamy.com/s/YOUR_VENDOR_ID/bundle/stable"></script>
    <script type="application/json" id="sesamy-js">
      {
        "customSetting": "value"
      }
    </script>
  </head>
  <body>
    <!-- Your content -->
  </body>
</html>

Benefits Over Manual Installation

FeatureScripts HostManual Installation
ConfigurationAutomaticManual setup required
UpdatesAutomaticManual version management
CDNGlobal Cloudflare CDNYour own hosting
MaintenanceZero maintenanceVersion conflicts possible
CustomizationVendor-specific bundlesCustom build process

API Reference

Endpoints

  • GET /s/:vendorId/bundle/:tag - Complete bundle with configuration
  • GET /s/:vendorId/sesamy-js/:tag - Sesamy JS library only
  • GET /s/:vendorId/sesamy-components/:tag - Components library only

Parameters

  • vendorId: Your unique vendor identifier
  • tag: Version tag (stable, latest, or specific version)

Response Headers

  • Cache-Control: Appropriate caching headers for CDN optimization
  • Content-Type: application/javascript

Troubleshooting

Script Not Loading

  1. Verify your vendorId is correct
  2. Check that your vendor account is active
  3. Ensure the version tag exists

Configuration Issues

  1. Contact Sesamy support if your vendor configuration needs updates
  2. Check browser console for JavaScript errors
  3. Verify your website's Content Security Policy allows the scripts domain

Version Conflicts

If you experience issues after updates:

  1. Temporarily use a specific version number instead of stable
  2. Check the changelog for breaking changes
  3. Update your integration code if necessary

Support

For issues with the Scripts Host service:

  • Check your vendor configuration in the Sesamy dashboard
  • Review the browser console for error messages
  • Contact Sesamy support with your vendor ID and specific error details

Released under the MIT License.