Docs
Sign up
Docs
Using Demo Token

Code examples show a demo token. Log in or sign up to see your real embed tokens.

Introduction

DinoCMS allows you to display SMS messages from your editors directly on your website. Whether you want a floating widget or inline content, our embed system makes it easy to keep your audience updated in real-time.

Widget Mode

A floating button that expands to show messages. Customizable position, theme, and colors.

Inline Mode

Inject message content directly into any HTML element using data attributes.

Both modes support automatic polling for new messages (every 30 seconds by default), so your content stays fresh without any page reloads.

Quick Start

Get up and running in under 5 minutes with these simple steps.

1
Add the embed script to your website

Copy this script tag and paste it before the closing </body> tag on your website.

HTML
<script src="https://dinocms.com/js/dino-embed.js" 
        data-dino-token="demo_api_key_xxxxxxxxxxxx"></script>
2
Configure your embed settings (optional)

Visit your site's settings in the DinoCMS dashboard to customize the widget appearance, position, theme, and display mode. Changes apply instantly without updating your embed code.

3
That's it!

A message widget will appear on your site. When your editors send SMS messages, they'll show up automatically.

Want inline content instead?

Add the script as above, then use data attributes on any HTML element:

HTML
<!-- Display the latest message -->
<h1 data-dino="latest">Loading...</h1>

<!-- Display a feed of messages -->
<div data-dino="feed">Loading...</div>
Authentication

Learn how embed tokens work and how your content is secured.

Embed Tokens

Each site in DinoCMS has a unique embed token - a 64-character string that identifies your site. This token is automatically generated when you create a site and is used to authenticate requests from your website.

Your Embed Token
demo_api_key_xxxxxxxxxxxx
Domain Validation

For security, embed requests are validated against your site's configured domain. The Origin or Referer header must match the domain you've set in your DinoCMS dashboard.

Important: If you see a "403 Domain not authorized" error, make sure your site's domain setting in DinoCMS matches the domain where you're embedding the widget.

Rate Limiting

To ensure fair usage and protect against abuse, the embed API is rate-limited to 100 requests per minute per IP address. This is more than enough for normal usage, even with multiple visitors and automatic polling enabled.

Regenerating Tokens

If you believe your token has been compromised, you can regenerate it from your site's settings in the DinoCMS dashboard. Warning: This will immediately invalidate the old token, and any existing embeds using it will stop working until you update them with the new token.

Widget Integration

The widget mode displays a floating button that expands to show your messages. Perfect for adding messaging without modifying your existing page layout.

Basic Setup

Add this script tag to your HTML. The widget will appear automatically based on your dashboard settings.

HTML
<script src="https://dinocms.com/js/dino-embed.js" 
        data-dino-token="demo_api_key_xxxxxxxxxxxx"></script>
Configuration Options

All widget settings are configured in your DinoCMS dashboard. Changes apply immediately without updating your embed code.

Option Values Default Description
position bottom-right, bottom-left, top-right, top-left bottom-right Widget button position on screen
theme light, dark light Color scheme for the widget panel
primaryColor Any hex color #4F46E5 Button background color
mode latest, feed latest Show single message or scrollable feed
feedLimit 1 - 50 10 Number of messages in feed mode
openByDefault true, false false Open widget panel on page load
showEditorName true, false true Toggle the editor name in widget metadata
showDateStamp true, false true Toggle the date/time stamp in widget metadata
Disabling Auto-Refresh

By default, the widget polls for new messages every 30 seconds. To disable this, add the data-dino-poll attribute:

HTML
<script src="https://dinocms.com/js/dino-embed.js" 
        data-dino-token="demo_api_key_xxxxxxxxxxxx"
        data-dino-poll="false"></script>
Inline Integration

Inline mode lets you display message content directly within your existing HTML elements. Perfect for custom layouts and tighter integration with your site design.

Basic Setup

First, include the embed script (same as widget mode), then add data-dino attributes to any HTML elements where you want content to appear.

HTML
<!-- Include the script -->
<script src="https://dinocms.com/js/dino-embed.js" 
        data-dino-token="demo_api_key_xxxxxxxxxxxx"></script>

<!-- Display the latest message -->
<h1 data-dino="latest">Loading...</h1>
Display Modes
Latest Message

Replace the element's content with just the latest message text:

HTML
<p data-dino="latest">Loading latest update...</p>
Message Feed

Display multiple messages in a styled feed:

HTML
<div data-dino="feed">Loading messages...</div>
Data Attributes

Customize inline behavior with these data attributes:

Attribute Values Description
data-dino latest, feed Required. Display mode for this element
data-dino-limit 1 - 50 Number of messages to show in feed mode (default: 10)
data-dino-editor Editor ID Filter messages to show only those from a specific editor
data-dino-poll true, false Enable/disable auto-refresh for this element (default: true)
showEditorName true, false Toggle editor names in inline feed metadata (dashboard setting)
showDateStamp true, false Toggle date stamps in inline feed metadata (dashboard setting)
Examples
Limited Feed

Show only the 5 most recent messages:

HTML
<div data-dino="feed" data-dino-limit="5">Loading...</div>
Filter by Editor

Show messages only from a specific editor (use the editor's ID from your dashboard):

HTML
<p data-dino="latest" data-dino-editor="123">Loading...</p>
Multiple Elements

You can have multiple inline elements on the same page:

HTML
<!-- Hero section with latest message -->
<h1 data-dino="latest">Loading...</h1>

<!-- Sidebar with recent updates -->
<aside>
    <h3>Recent Updates</h3>
    <div data-dino="feed" data-dino-limit="3">Loading...</div>
</aside>

<!-- Footer with message from specific editor -->
<footer>
    <p data-dino="latest" data-dino-editor="456">Loading...</p>
</footer>
API Reference

While most users won't need to interact with the API directly (the JavaScript embed handles everything), you can make direct requests if you need custom integrations.

Base URL
https://dinocms.com/api/embed/demo_api_key_xxxxxxxxxxxx
GET /config

Returns site configuration and embed settings.

Request
cURL
curl -X GET "https://dinocms.com/api/embed/demo_api_key_xxxxxxxxxxxx/config" \
     -H "Accept: application/json"
Response
JSON
{
  "site": {
    "name": "My Website"
  },
  "settings": {
    "type": "widget",
    "widget": {
      "position": "bottom-right",
      "theme": "light",
      "primaryColor": "#4F46E5",
      "mode": "latest",
      "feedLimit": 10,
      "openByDefault": false,
      "title": "Messages",
      "buttonIcon": "chat"
    },
    "inline": {
      "type": "latest",
      "feedLimit": 5
    }
  }
}
GET /messages

Returns messages for display.

Query Parameters
Parameter Type Default Description
type string latest latest or feed
limit integer 10 Number of messages (1-50)
editor integer - Filter by editor ID
Request
cURL
curl -X GET "https://dinocms.com/api/embed/demo_api_key_xxxxxxxxxxxx/messages?type=feed&limit=5" \
     -H "Accept: application/json"
Response
JSON
{
  "site": {
    "name": "My Website"
  },
  "messages": [
    {
      "id": 123,
      "content": "Hello from the editor!",
      "editor": {
        "id": 1,
        "name": "John Doe"
      },
      "created_at": "2026-01-11T12:00:00+00:00",
      "formatted_date": "Jan 11, 2026",
      "formatted_time": "12:00 PM",
      "formatted_datetime": "Jan 11, 2026 at 12:00 PM"
    }
  ]
}
Error Responses
404 Invalid Embed Token
JSON
{
  "error": "Invalid embed token"
}
403 Domain Not Authorized
JSON
{
  "error": "Domain not authorized for this embed"
}
429 Rate Limited

Too many requests. Wait and retry. Limit: 100 requests per minute.

Configuration Options

Complete reference of all available configuration options. These are set in your DinoCMS dashboard and fetched automatically by the embed script.

Widget Settings
Setting Type Default Description
position string bottom-right Screen corner for the widget button. Options: bottom-right, bottom-left, top-right, top-left
theme string light Panel color scheme. Options: light, dark
primaryColor string #4F46E5 Widget button background color (hex format)
mode string latest Display mode. latest shows one message, feed shows multiple
feedLimit integer 10 Number of messages to show in feed mode (1-50)
openByDefault boolean false Whether the panel should be open when the page loads
title string Messages Widget header text
buttonIcon string chat Widget button icon: chat, message, megaphone, bell, sparkle
Inline Settings
Setting Type Default Description
type string latest Default display type for inline elements. Options: latest, feed
feedLimit integer 5 Default number of messages for inline feeds (1-50)
Troubleshooting

Common issues and how to resolve them.

"403 Domain not authorized"

The domain making the request doesn't match your site's configured domain.

Solutions:
  • Check your site's domain setting in the DinoCMS dashboard
  • Make sure the domain matches exactly (with or without www)
  • If testing locally, temporarily update your site's domain to localhost
Widget not appearing

The floating button doesn't show up on your page.

Solutions:
  • Check browser console for JavaScript errors
  • Verify the script tag is placed before </body>
  • Ensure your embed type is set to "widget" in settings (not "inline")
  • Check if another element has a higher z-index covering the widget
  • Verify the embed token is correct
Messages not loading

Widget appears but shows "Unable to load messages" or stays on "Loading..."

Solutions:
  • Check browser console for network errors
  • Verify your embed token hasn't been regenerated
  • Make sure you have at least one verified message from an editor
  • Check if you've exceeded the rate limit (100 requests/minute)
CORS errors in console

Browser blocks requests with "Access-Control-Allow-Origin" errors.

Solutions:
  • This usually indicates a domain mismatch - see the 403 error section above
  • If testing locally, make sure you're accessing via http://localhost not file://
Auto-refresh not working

New messages don't appear without refreshing the page.

Solutions:
  • Verify you haven't disabled polling with data-dino-poll="false"
  • Check browser console for polling errors
  • Note: polling happens every 30 seconds, so wait at least that long
Inline content looks wrong

Feed items or messages don't match your site's design.

Solutions:
  • The embed adds minimal styling - override with your own CSS
  • Target classes like .dino-feed , .dino-feed-item
  • For data-dino="latest" , only the text content is replaced - your element's styles remain
Still having issues?

Open your browser's developer console (F12) and look for any error messages starting with "DinoCMS:". These will give you more details about what's going wrong.

Need more help? Contact us at support@dinocms.com