Skip to content

Repository files navigation

👉 Visit the DatoCMS homepage or see What is DatoCMS?


vue-datocms

MIT NPM Build Status

A set of components and utilities to work faster with DatoCMS in Vue.js environments. Integrates seamlessly with DatoCMS's GraphQL Content Delivery API.

  • Works with Vue 3 (version 4 is maintained for compatibility with Vue 2);
  • TypeScript ready;
  • Compatible with any data-fetching library (axios, Apollo);
  • Usable both client and server side;
  • Compatible with vanilla Vue and pretty much any other Vue-based solution.

Table of Contents

Features

vue-datocms contains Vue components ready to use, helpers functions and usage examples.

Components:

Composables:

Helpers:

Installation

# First, install Vue
npm install vue
# Then install vue-datocms
npm install vue-datocms

# Demos

For fully working examples take a look at our [examples directory](https://github.com/datocms/vue-datocms/tree/master/examples).

Live demo: [https://vue-datocms-example.netlify.com/](https://vue-datocms-example.netlify.com/)

Development

This repository contains a number of demos/examples. You can use them to locally test your changes.

cd examples
npm setup
npm run dev

Releasing (maintainers)

Every user-visible change needs a changeset: run npx changeset from the repo root in the same PR, pick the bump level (patch is for bug fixes only, new API surface is minor) and commit the file it writes under .changeset/. That is where the changelog entry comes from, and it is where the bump level is decided — not on release day. See .changeset/README.md.

To release, from an up-to-date, clean master, run npm run release. It builds and tests, applies the pending changesets — bumping the version and writing CHANGELOG.md — publishes to npm, and only then tags vX.Y.Z, pushes, and creates a GitHub release whose notes come straight from that changelog entry. An interrupted release is resumed by re-running it, never undone. Use npm run release:next for a prerelease under the next dist-tag.

The script is @datocms/release-toolchain, shared with every other DatoCMS repository and pinned here by tag.


Trying a change before it's released

Every push to a branch here publishes a preview of the package, which you can install anywhere — no npm release, no npm link:

npm i https://pkg.pr.new/datocms/vue-datocms@<commit-sha>

The exact URL shows up in the commit's check run on GitHub, and in a comment on the pull request once there is one. This is the supported way to try a change inside a site that lives in another repository, or to hand a fix to whoever reported it before it is released.

Previews are throwaway: they are never published to npm, and the URL stops resolving after a while. Never commit one to a package.json that ships.

What is DatoCMS?

DatoCMS - The Headless CMS for the Modern Web

DatoCMS is Headless CMS for the modern web. Trusted by 25,000+ businesses, agencies, and individuals, it gives your team one place to manage content and ship it to any website, app, or device via API.

New here? Start with Create free account and the Documentation. Stuck? Ask the Community. Curious what's new? Product Updates.

Building with AI: Agent Skills turn coding assistants (Claude Code, Cursor) into expert DatoCMS developers, with full read/write via the auto-installed CLI. No local terminal? Use the MCP Server instead.

Talking to DatoCMS from code:

  • Content Delivery API (CDA) — the fast, read-only GraphQL API your website/app uses to fetch published content.
  • Content Management API (CMA) — the REST API for creating and updating content, models, and project settings (think scripts, migrations, integrations).
  • CLI — terminal tool for schema migrations and importing from Contentful/WordPress.

Framework guides: end-to-end recipes for fetching content, rendering Structured Text, optimizing images/video, handling SEO, and setting up live preview with visual editing in Next.js, Nuxt, Svelte, and Astro.

Want a head start? Browse our starter projects — ready-to-deploy example sites for popular frameworks.

About

Vue.js components for DatoCMS

Topics

Resources

Stars

27 stars

Watchers

4 watching

Forks

Releases

Packages

Used by

Contributors

Languages