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:
<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:
<!-- 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.3for exact version control
Version Examples
<!-- 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
<!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:
<!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
| Feature | Scripts Host | Manual Installation |
|---|---|---|
| Configuration | Automatic | Manual setup required |
| Updates | Automatic | Manual version management |
| CDN | Global Cloudflare CDN | Your own hosting |
| Maintenance | Zero maintenance | Version conflicts possible |
| Customization | Vendor-specific bundles | Custom build process |
API Reference
Endpoints
GET /s/:vendorId/bundle/:tag- Complete bundle with configurationGET /s/:vendorId/sesamy-js/:tag- Sesamy JS library onlyGET /s/:vendorId/sesamy-components/:tag- Components library only
Parameters
vendorId: Your unique vendor identifiertag: Version tag (stable,latest, or specific version)
Response Headers
Cache-Control: Appropriate caching headers for CDN optimizationContent-Type:application/javascript
Troubleshooting
Script Not Loading
- Verify your
vendorIdis correct - Check that your vendor account is active
- Ensure the version tag exists
Configuration Issues
- Contact Sesamy support if your vendor configuration needs updates
- Check browser console for JavaScript errors
- Verify your website's Content Security Policy allows the scripts domain
Version Conflicts
If you experience issues after updates:
- Temporarily use a specific version number instead of
stable - Check the changelog for breaking changes
- 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