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.
A floating button that expands to show messages. Customizable position, theme, and colors.
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.
Get up and running in under 5 minutes with these simple steps.
Copy this script tag and paste it before the closing </body>
tag on your website.
<script src="https://dinocms.com/js/dino-embed.js"
data-dino-token="demo_api_key_xxxxxxxxxxxx"></script>
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.
A message widget will appear on your site. When your editors send SMS messages, they'll show up automatically.
Add the script as above, then use data attributes on any HTML element:
<!-- Display the latest message -->
<h1 data-dino="latest">Loading...</h1>
<!-- Display a feed of messages -->
<div data-dino="feed">Loading...</div>
Learn how embed tokens work and how your content is secured.
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.
demo_api_key_xxxxxxxxxxxx
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.
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.
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.
The widget mode displays a floating button that expands to show your messages. Perfect for adding messaging without modifying your existing page layout.
Add this script tag to your HTML. The widget will appear automatically based on your dashboard settings.
<script src="https://dinocms.com/js/dino-embed.js"
data-dino-token="demo_api_key_xxxxxxxxxxxx"></script>
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 |
By default, the widget polls for new messages every 30 seconds. To disable this, add the data-dino-poll
attribute:
<script src="https://dinocms.com/js/dino-embed.js"
data-dino-token="demo_api_key_xxxxxxxxxxxx"
data-dino-poll="false"></script>
Inline mode lets you display message content directly within your existing HTML elements. Perfect for custom layouts and tighter integration with your site design.
First, include the embed script (same as widget mode), then add data-dino
attributes to any HTML elements where you want content to appear.
<!-- 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>
Replace the element's content with just the latest message text:
<p data-dino="latest">Loading latest update...</p>
Display multiple messages in a styled feed:
<div data-dino="feed">Loading messages...</div>
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) |
Show only the 5 most recent messages:
<div data-dino="feed" data-dino-limit="5">Loading...</div>
Show messages only from a specific editor (use the editor's ID from your dashboard):
<p data-dino="latest" data-dino-editor="123">Loading...</p>
You can have multiple inline elements on the same page:
<!-- 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>
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.
https://dinocms.com/api/embed/demo_api_key_xxxxxxxxxxxx
/config
Returns site configuration and embed settings.
curl -X GET "https://dinocms.com/api/embed/demo_api_key_xxxxxxxxxxxx/config" \
-H "Accept: application/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
}
}
}
/messages
Returns messages for display.
| Parameter | Type | Default | Description |
|---|---|---|---|
type |
string | latest |
latest or feed |
limit |
integer | 10 |
Number of messages (1-50) |
editor |
integer | - | Filter by editor ID |
curl -X GET "https://dinocms.com/api/embed/demo_api_key_xxxxxxxxxxxx/messages?type=feed&limit=5" \
-H "Accept: application/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": "Invalid embed token"
}
{
"error": "Domain not authorized for this embed"
}
Too many requests. Wait and retry. Limit: 100 requests per minute.
Complete reference of all available configuration options. These are set in your DinoCMS dashboard and fetched automatically by the embed script.
| 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 |
| 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) |
Common issues and how to resolve them.
The domain making the request doesn't match your site's configured domain.
localhost
The floating button doesn't show up on your page.
</body>
Widget appears but shows "Unable to load messages" or stays on "Loading..."
Browser blocks requests with "Access-Control-Allow-Origin" errors.
http://localhost
not file://
New messages don't appear without refreshing the page.
data-dino-poll="false"
Feed items or messages don't match your site's design.
.dino-feed
, .dino-feed-item
data-dino="latest"
, only the text content is replaced - your element's styles remainOpen 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