Vanilla JavaScript Integration Guide
Sveltia CMS works seamlessly with vanilla JavaScript projects — no framework required. This guide shows you how to manage content through Sveltia CMS and consume it directly in your JavaScript applications.
Overview
Sveltia CMS operates as a CDN-served single-page application, so you can load it directly in your project without any build tools or server-side rendering. Simply include an HTML file with the CMS script and start managing your content.
Once configured, the CMS generates static JSON or Markdown files that you consume on the client side. This approach works well for lightweight projects that need dynamic content management without framework overhead — perfect for event listings, announcements, portfolios, or any site where you want managed content instead of hardcoded data.
Implementation
The implementation is straightforward, leveraging native browser APIs and simple libraries:
JSON Files
Fetch the JSON files generated by Sveltia CMS and parse them using the native Fetch API. This allows you to dynamically render content on your pages without any additional dependencies.
Markdown Files
Use a library like Marked to parse Markdown files. The CDN version can be included directly in your HTML, allowing you to render Markdown content without any build step. Simply fetch the Markdown file, parse it with Marked, and insert the resulting HTML into your page.
Examples
Check out real-world examples in our Showcase demonstrating vanilla JavaScript setups with Sveltia CMS. These implementations can help you get started with your own project.