Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

To integrate Vue.js with Drupal, use Drupal as the content-management backend and Vue as the presentation layer. For most entity-based content, start with Drupal core’s JSON:API; fetch its resources from Vue with a JSON:API client, then add routing, menus, authentication, and output customization only where the project needs them.

How does a Vue–Drupal integration work?

In a decoupled Drupal architecture, Drupal manages content while a separate Vue application presents it. Drupal exposes content through an API, and Vue requests that data and renders the resulting pages. Drupal’s decoupled documentation names Vue as one of the frameworks that can use Drupal as a content API.

This separation lets editors continue working with Drupal’s content model while frontend developers build the user interface in Vue. It also means the two applications need an explicit contract: Vue must understand Drupal’s entity types, bundles, fields, and relationships, and Drupal must expose the content and access the frontend requires.

Decoupling is an architectural choice, not a prerequisite for using Vue. If the project needs Drupal’s existing page-rendering stack, consider retaining it rather than moving every page to a separate frontend. The decision depends on deployment ownership, rendering and SEO needs, editorial preview, operational complexity, and how much of Drupal’s page stack should remain.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Should you use JSON:API or GraphQL?

For ordinary Drupal entities, begin by evaluating JSON:API. Drupal describes it as a zero-configuration REST API for content entities, included in Drupal core since 8.7; that version history is stated in Drupal.org documentation updated in 2025. GraphQL is an alternative when the frontend benefits from asking for a query-specific field graph.

Consideration JSON:API GraphQL
Response model Entity-oriented resources and relationships that reflect Drupal’s content model. Query-shaped results selected by the client.
Good fit when Vue can consume Drupal’s entity and bundle structure without needing a custom response shape for every view. Vue needs flexible field selection or query-specific shapes.
Evaluate before choosing How the frontend will handle relationships, caching, authorization, and any needed output customization. How the team will maintain the schema and queries, and how caching and authorization fit the project.

Neither API is a universal winner. Compare the fit with your Drupal schema, caching strategy, authorization requirements, tooling, and the amount of customization the team is prepared to maintain.

How do you fetch Drupal articles in a Vue component?

Drupal’s API Client is a framework-agnostic set of JavaScript tools for common Drupal APIs. Its documentation says it can be used with any JavaScript framework, with or without TypeScript, on the server or client, and through a bundler or CDN. The Vue example uses onMounted to request the node--article collection and renders each article’s title.

<script setup>
import { ref, onMounted } from "vue";
import { JsonApiClient } from "@drupal-api-client/json-api-client";

const articles = ref({});

onMounted(async () => {
  const client = new JsonApiClient("https://drupal-api-demo.party");
  articles.value = await client.getCollection("node--article");
});
</script>

<template>
  <h1>Umami Articles</h1>
  <ul v-if="articles.data">
    <li v-for="article in articles.data">
      {{ article.attributes.title }}
    </li>
  </ul>
  <div v-else>Loading...</div>
</template>

The host in this example is a documentation demo, not a production endpoint. Replace it with the base URL for your Drupal API, supplied through the appropriate configuration for each environment. The example demonstrates the request-and-render path; it is not a complete production data layer.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Make the fetch production-ready

Handle the states the short example leaves out. Keep loading, error, and empty results distinct so readers know whether content is still loading, the request failed, or the collection has no items. Decide how the component or shared data layer reports request failures, and prevent stale responses from overwriting newer state when users navigate or change filters. The example does not demonstrate cancellation behavior, so implement that according to the client and application architecture you choose.

For a detail view, use the same entity-aware approach but resolve the requested content and its relationships deliberately. Do not assume a Drupal response is a flat object: design the Vue view around the fields and related resources the content model actually exposes.

How should Drupal routing and menus work in Vue?

A Vue router and Drupal’s editorial URL and navigation data solve different problems. If editors manage aliases, redirects, or menus in Drupal, expose that information to Vue rather than duplicating it as hardcoded frontend configuration.

Need Drupal option Purpose
Resolve Drupal paths, aliases, and redirects Decoupled Router Helps a decoupled frontend resolve Drupal-managed URL behavior.
Use editor-managed navigation Decoupled Menus Exposes configurable Drupal menus through an API for JavaScript frontends.
Customize exposed fields or resources JSON:API Extras Supports output customization such as field aliases and resource exposure.

Keep the responsibilities clear: Vue handles frontend navigation and page rendering, while Drupal remains the source for the aliases, redirects, and menu configuration that editors maintain there.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

How do authentication and API documentation fit?

Publicly readable content may not require authenticated API requests. If the Vue application must access protected content or perform authenticated operations, choose an authentication design that fits the deployment and access model before exposing those operations to the browser.

  • Simple OAuth: Drupal’s module guide lists it for OAuth 2.0 authentication when authenticated API access is required.
  • OpenAPI: Use it when the project needs API documentation and discoverability, including support for tools such as Swagger UI or ReDoc.

Authentication is a security boundary, not just a Vue client setting. Decide which operations are public, which require a user identity, and how credentials are protected; do not treat a frontend package or API documentation module as a substitute for access-control decisions.

What is a practical build sequence?

  1. Model the content in Drupal. Define the content types, bundles, fields, references, translations, and publication rules the Vue pages must support.
  2. Expose representative content. Enable and inspect JSON:API resources for the content the frontend needs. Check how fields and relationships appear before shaping Vue components around them.
  3. Set up the Vue application’s API configuration. Keep the Drupal API base URL environment-specific instead of baking a demo host into application code.
  4. Build one end-to-end view. Use a JSON:API client to render a collection, then add a detail view and explicit loading, failure, and empty states.
  5. Connect editor-managed URLs and navigation. Add Decoupled Router and Decoupled Menus if the project needs Drupal aliases, redirects, or configurable menus in the frontend.
  6. Choose extensions based on a real requirement. Consider JSON:API Extras for output customization, GraphQL for query-shaped data, Simple OAuth for authenticated API access, and OpenAPI for discoverable documentation.
  7. Plan the operating model before launch. Decide how caching and invalidation work, how editors preview drafts, whether the deployment is same-origin or needs CORS, how localization is represented, and how accessibility is maintained.

What should you verify before launch?

  • Content coverage: Every Vue view has the Drupal fields and relationships it needs, including the intended publication and translation behavior.
  • URL behavior: Frontend routes, Drupal aliases, and redirects behave consistently for the URLs the project supports.
  • Editorial workflow: Preview and draft behavior are understood by both editors and developers; a public content endpoint alone does not define preview behavior.
  • Security: Public and authenticated operations are distinguished, and deployment and API access rules match the intended users.
  • Operations: The team has accounted for caching, invalidation, CORS or same-origin deployment, and environment-specific API configuration.
  • User experience: Requests have clear loading, error, and empty states, and the rendered interface remains accessible.

Drupal’s older frontend getting-started guide also outlines lists, detail pages, menus, routing, authentication, forms, and deployment. It is marked deprecated, so use current module and package documentation for implementation details rather than treating that guide as current setup instructions.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.