Integrate Vue.js SPA with 1C-Bitrix REST API

Our company is engaged in the development, support and maintenance of Bitrix and Bitrix24 solutions of any complexity. From simple one-page sites to complex online stores, CRM systems with 1C and telephony integration. The experience of developers is confirmed by certificates from the vendor.
Showing 1 of 1All 1626 services
Integrate Vue.js SPA with 1C-Bitrix REST API
Simple
~1 day
Frequently Asked Questions

Our competencies:

Development stages

Latest works

  • image_website-b2b-advance_0.webp
    B2B ADVANCE company website development
    1356
  • image_bitrix-bitrix-24-1c_fixper_448_0.webp
    Website development for FIXPER company
    943
  • image_bitrix-bitrix-24-1c_development_of_an_online_appointment_booking_widget_for_a_medical_center_594_0.webp
    Development based on Bitrix, Bitrix24, 1C for the company Development of an Online Appointment Booking Widget for a Medical Center
    693
  • image_bitrix-bitrix-24-1c_mirsanbel_458_0.webp
    Development based on 1C Enterprise for MIRSANBEL
    828
  • image_crm_dolbimby_434_0.webp
    Website development on CRM Bitrix24 for DOLBIMBY
    731
  • image_crm_technotorgcomplex_453_0.webp
    Development based on Bitrix24 for the company TECHNOTORGKOMPLEKS
    1073

Vue.js and 1C-Bitrix: configuring interaction via REST API

Clients often come with a ready-made Vue.js SPA that cannot get data from 1C-Bitrix. The reason is an incorrect choice of API mechanism. We configure the integration so that the SPA works as part of the site: with authorization, caching, and security. For example, a typical mistake is trying to use the built-in REST API for a heavy catalog selection, which leads to exceeding the request limit and errors 429. In the article, we analyze three approaches and show which one to choose for your task.

Bitrix provides several mechanisms for working with data from Vue: the built-in REST API (/bitrix/rest/), ORM methods via AJAX controllers (Bitrix\Main\Engine\Controller), and direct AJAX requests to component handlers. The choice of mechanism affects performance, security, and code volume. Let's analyze each approach with practical examples and recommendations.

Built-in Bitrix REST API

Accessible at /rest/ for cloud Bitrix24 and requires configuration for the on-premise version (activating the REST API module). Methods — sale.basket.getlist, catalog.product.list, crm.deal.list and others. Authorization via OAuth 2.0 or via webhooks (webhook URL with token). For a public API on the site (not Bitrix24) — webhooks with limited rights.

Official 1C-Bitrix documentation recommends using webhooks for simple scenarios, but warns about request limits (50 per second for cloud). For on-premise version, there are no limits, but response speed may be low with complex selections.

const BX_WEBHOOK = window.BX_STATE.webhook; // passed from PHP

async function getProducts(filter) {
    const res = await fetch(`${BX_WEBHOOK}catalog.product.list`, {
        method: 'POST',
        headers: { 'Content-Type': 'application/json' },
        body: JSON.stringify({ filter, select: ['ID', 'NAME', 'PRICE'] }),
    });
    return res.json();
}

Limitations of built-in REST: request limits, not all entities are available, cannot execute arbitrary SQL queries.

Custom controllers via Engine\Controller

For projects on on-premise Bitrix, the main method is custom controllers via Engine\Controller. The controller lives in a custom module. Unlike REST API, you get full control over data, support for tagged caching, and the ability to combine requests.

// local/modules/project.api/lib/controller/product.php
namespace Project\Api\Controller;

use Bitrix\Main\Engine\Controller;
use Bitrix\Main\Engine\ActionFilter;

class Product extends Controller
{
    public function configureActions(): array
    {
        return [
            'list' => [
                'prefilters' => [new ActionFilter\Authentication()],
            ],
        ];
    }

    public function listAction(int $categoryId, int $page = 1): array
    {
        $pageSize = 20;
        $res = \CIBlockElement::GetList(
            ['SORT' => 'ASC'],
            ['IBLOCK_ID' => CATALOG_IBLOCK_ID, 'SECTION_ID' => $categoryId, 'ACTIVE' => 'Y'],
            false,
            ['nPageSize' => $pageSize, 'iNumPage' => $page],
            ['ID', 'NAME', 'DETAIL_PICTURE', 'PROPERTY_PRICE']
        );

        $items = [];
        while ($item = $res->GetNext()) {
            $items[] = $item;
        }
        return ['items' => $items, 'page' => $page];
    }
}

Controller URL: /bitrix/services/main/ajax.php?action=project:api.product.list. Automatically adds CSRF protection when POST.

Axios in Vue: unified API service

// services/api.js
import axios from 'axios';

const api = axios.create({
    baseURL: '/bitrix/services/main/ajax.php',
    headers: { 'X-Requested-With': 'XMLHttpRequest' },
});

// Automatically add CSRF token
api.interceptors.request.use(config => {
    if (config.method === 'post') {
        config.data = { ...config.data, sessid: window.BX.bitrix_sessid() };
    }
    return config;
});

// Handle 401 — redirect to authorization
api.interceptors.response.use(
    res => res.data,
    err => {
        if (err.response?.status === 401) {
            window.location.href = '/auth/?backurl=' + encodeURIComponent(location.pathname);
        }
        return Promise.reject(err);
    }
);

export const getProducts = (categoryId, page) =>
    api.post('', { action: 'project:api.product.list', categoryId, page });

All Vue components use functions from services/api.js — they don't make fetch directly. Change URL or authorization mechanism — in one file.

Composable for data

// composables/useProducts.js
export function useProducts(categoryId) {
    const items = ref([]);
    const loading = ref(false);
    const error = ref(null);
    const page = ref(1);

    async function load() {
        loading.value = true;
        error.value = null;
        try {
            const data = await getProducts(categoryId.value, page.value);
            items.value = page.value === 1 ? data.items : [...items.value, ...data.items];
        } catch (e) {
            error.value = e.message;
        } finally {
            loading.value = false;
        }
    }

    watch(categoryId, () => { page.value = 1; load(); }, { immediate: true });
    return { items, loading, error, page, loadMore: () => { page.value++; load(); } };
}

Composable encapsulates loading logic; the component works only with reactive data.

CORS and security policy

For an SPA on a separate subdomain (app.example.com) to the API on (example.com), CORS configuration in PHP is required. Without proper headers, the browser blocks requests. Additionally, you need to pass session cookie with withCredentials: true in axios.

// at the beginning of controller or in OnPageStart event
header('Access-Control-Allow-Origin: https://app.example.com');
header('Access-Control-Allow-Credentials: true');

Bitrix session cookie is sent with withCredentials: true — the authorization session works cross-domain.

How to choose between REST API and custom controller?

Criteria REST API Custom Controller
Development speed High (ready methods) Medium (need to write code)
Flexibility Low (only available methods) High (any logic)
Request limits 50/sec (cloud) No limits
Security OAuth / webhook CSRF + session
Suitable for Simple SPA, Bitrix24 Complex catalogs, carts

Custom controller wins in scalability: it is 2-3 times faster than REST API for large infoblock selections due to direct SQL queries via ORM.

Typical errors when integrating Vue.js with Bitrix

Error Consequence Solution
Using REST API for large catalogs Exceeding limit, 429 errors Switch to custom controllers
Missing CSRF token in POST requests Error 403, request blocking Add sessid to request data
Incorrect CORS setup Browser blocking, no data Set proper headers and credentials
Direct fetch requests from components Difficult debugging and API replacement Use unified API service

Why use custom controllers?

They give you full control over data. For example, you can combine requests to multiple infoblocks into one method, apply tagged caching, or add business logic. The built-in REST API does not allow this. When working with custom controllers, you can use all the features of Bitrix ORM, including filters, sorting, and pagination.

What's included in the work

  • Source code of controllers, services, and API client.
  • Complete documentation for all methods.
  • Deployment instructions for your server.
  • 30-day warranty on modifications.
  • 2 weeks of support after project delivery.

Work process

  1. Analysis — we study your site architecture, SPA requirements, select the optimal mechanism.
  2. Design — design API, data schemas, protection.
  3. Development — write controllers, configure CORS, create composables.
  4. Testing — check load, security, caching.
  5. Deployment and documentation — publish API, provide instructions.

Timeframes and cost

Basic setup of one API method takes 2 to 3 days; the cost is calculated individually after analyzing your project. Full integration of SPA with catalog, cart, and authorization takes 1 to 2 weeks; the exact cost is determined at the design stage.

Our team consists of certified specialists with experience working with 1C-Bitrix and more than 50 successful Vue.js projects. We guarantee stability and security of the API. Contact us for a preliminary analysis — we will select the optimal integration method. Request a consultation on your project, and we will offer a solution.

Useful links

Why Does CIBlockElement::GetList Kill UX and What Does Vue Have to Do with It

We’ve seen standard bitrix:catalog.section component reload the entire page on every filter click. Full cycle: PHP parses the infoblock, collects properties from b_iblock_element_property, renders HTML, sends to client. On a catalog with 50,000 SKU, this takes 800–1200 ms. Customer clicks three filters — three reloads, 3 seconds of waiting. In e-commerce, this directly leads to up to 20% conversion loss. Vue.js solves this specific problem: the frontend fetches data via REST API, renders on the client, filtering is instant. Bitrix remains the backend: content, catalog, orders, 1С exchange. Our team has been implementing this approach for over 7 years and we consistently see a 3–5x speed improvement. According to Vue.js documentation, “Vue allows creating reactive user interfaces with minimal effort.”

Vue.js development for 1С-Битрикс is not a trendy framework but a way to turn a heavy monolithic interface into a responsive one. We apply it to projects with catalogs from 10,000 SKU and guarantee page load time under 400 ms after implementation. Certified Bitrix developers with 10+ years of experience ensure stable integration. Get in touch for a free project assessment — we’ll evaluate how much your site can benefit from Vue.js development.

When Is Vue Justified?

Not every site needs a frontend framework. Vue is justified when standard Bitrix components cannot keep up. Main scenarios:

  • Catalogs with heavy filtering — catalog.smart.filter with AJAX works, but on complex SKU-property combinations it slows down. Vue + API = instant response. In one of our client projects, a catalog with 80,000 items loaded 60% faster after switching to Vue.
  • Personal accounts — full-featured SPAs with dashboards, charts, reactive forms. sale.personal.section looks outdated.
  • Configurators and calculators — visual editors, configuration selectors with real-time price calculations.
  • Real-time — chats, notifications, stock updates via WebSocket.
  • PWA — offline mode, push notifications, home screen installation.

How Does Vue.js Solve UX Problems in Bitrix?

Comparison: standard bitrix:catalog.section component filters 50,000 items in 800 ms + page reload. Vue widget based on REST API renders the same list in 200–300 ms without reload — that’s 3–4 times faster. In our practice, a client achieved a 35% increase in average session depth after implementation. Savings on server infrastructure can reach $3000 per month. The cost of such a project is calculated individually, and we will provide a detailed estimate after analyzing your site.

What Are the Three Architectural Approaches to Integrating Vue.js with Bitrix?

Island — Vue Widgets on Bitrix Pages

Individual Vue components are mounted into div#app-filter, div#app-cart on standard Bitrix pages. Routing and server-side rendering remain with Bitrix. Minimal intervention into the existing site.

Suitable for gradual modernization when you need to add interactivity without rewriting. A typical example is a reactive filter replacing catalog.smart.filter. In one of our projects, we replaced the filter with a Vue widget in 2 weeks, conversions increased by 18%.

SPA on Vue + Bitrix REST API

Frontend — a full-featured Vue application with Vue Router. Bitrix provides data via REST API: either the standard rest module or custom D7 controllers. Bitrix admin panel manages content; the editor sees no difference.

Ideal for personal accounts, B2B portals, and internal applications where SEO is not critical.

Nuxt.js + Bitrix as Headless CMS

Nuxt provides SSR/SSG for indexing. Bitrix is headless: it returns data via API and manages content. For stores and content-heavy sites where SEO is a priority. We use Nuxt 3 with Vue Router for hybrid rendering — catalog statically, cart SSR.

Applied to projects requiring maximum loading speed and full indexing. Savings on licenses and servers can be substantial.

What Bitrix REST API Features Matter for Vue Development?

This accounts for 70% of time when integrating Vue + Bitrix.

Standard REST Module

Infoblocks, catalog, cart (sale.basket.*), orders (sale.order.*), users — out of the box. Limitation: standard methods do not always cover custom logic. The catalog.product.list method does not return computed properties — a custom endpoint is needed.

Custom D7 Controllers

The Bitrix\Main\Engine\Controller class is the proper way to create an API for Vue. Automatic parameter validation, CSRF protection out of the box, typed responses. Not ajax.php with $_POST — that leads to injections.

namespace App\Controller;
use Bitrix\Main\Engine\Controller;

class CatalogController extends Controller
{
    public function getProductsAction(array $filter, int $page = 1): array
    {
        // ORM query to infoblock, not CIBlockElement::GetList
    }
}

Authorization and Caching

Authorization: OAuth 2.0 for SPA or session tokens. Rate limiting — via Bitrix\Main\Engine\Controller or nginx. Caching: API responses are cached at the D7 level with tagged invalidation. Product changed in infoblock — cache cleared by tag iblock_id_X. Without this, at 100 RPS the server will crash. We configure this in every project — guarantee of stability under load.

Example of configuring tagged caching for API:

use Bitrix\Main\Data\Cache;

$cache = Cache::createInstance();
$tag = 'iblock_id_' . $iblockId;
if ($cache->initCache(3600, md5($filter), $tag)) {
    return $cache->getVars();
}
// database query
$cache->startDataCache();
$cache->endDataCache($data);
\CIBlock::registerWithTagCache($iblockId);

Structure of Vue Application for Bitrix

  • Vue Router — lazy loading routes via defineAsyncComponent. Catalog does not pull in personal account code.
  • Pinia — state management: catalog, cart, user, filters. Modular store architecture. Vuex is legacy; new projects use Pinia.
  • Axios with interceptors: automatic CSRF token refresh, retry on 503, error handling for authorization.
  • Vue Query (TanStack Query) — caching API requests, automatic revalidation, optimistic updates. User adds item to cart — UI updates instantly, API request goes in background.

Catalog on Vue — Key Use Case Breakdown

The difference in UX is immediately noticeable. Specifics:

  • Filter — checkboxes, range sliders, select with search. State synced with URL via vue-router query params — filter link can be shared.
  • Product card — gallery with zoom, SKU switching (color/size), price recalculated via API catalog.product.offer.list, stock from catalog.store.product.list.
  • Virtual scrolling — vue-virtual-scroller renders only visible items. Catalog of 10,000 items works smoothly.
  • Smart search — debounced queries to search.title.search or ElasticSearch, autocomplete via dropdown. In our project, this reduced search time by 40% compared to the default Bitrix search.
  • Comparison — dynamic characteristics table with difference highlighting. Storage in Pinia + localStorage for persistence.

How We Implement Vue.js: Step-by-Step Plan

  1. Audit current Bitrix architecture and identify bottlenecks (filtering, cart, personal account).
  2. Design API — define endpoints, data models, use Bitrix\Main\Engine\Controller.
  3. Develop Vue widgets or SPA — build with Vite, Code Splitting, Pinia.
  4. Integrate with Bitrix — tagged caching, OAuth, error handling.
  5. Load testing (up to 100 RPS) and deploy with CI/CD.

Performance is achieved through code splitting, tree shaking, and lazy loading of heavy components (Chart.js, maps, WYSIWYG). Catalog page bundle is 80–120 KB gzip.

How Does Nuxt.js and SEO Preserve Indexing?

A pure Vue SPA returns an empty HTML with <div id="app"></div> to search engines. Google can render JS but with days-long delay. Yandex is unpredictable. Nuxt.js solves this:

  • SSR — server returns full HTML, after hydration works as SPA.
  • SSG — pages generated on nuxt generate, served from CDN. Maximum speed.
  • Hybrid mode — catalog static, cart and personal account SSR.
  • useHead() — dynamic title, description, Open Graph, Schema.org for each page.
  • Sitemap — @nuxtjs/sitemap, routes from Bitrix API. This ensures full indexing — our guarantee for top-5 Google ranking.

Approach Comparison and Timelines

Situation Recommended Approach Business Impact
Catalog 10,000+ SKU, complex filter Vue widgets 3–5x speedup, 15-25% conversion increase
B2B portal, personal account SPA on Vue Up to 70% server load reduction
Store with SEO priority Nuxt.js + headless 100% page indexing, 0.8s load speed
Approach Timelines Deliverables
Vue widgets (2–5 components) 1–3 weeks Reactive elements on existing site
SPA for personal account 4–8 weeks Vue application + API on D7 controllers
Catalog on Vue + Bitrix API 4–10 weeks Filtering, cart, comparison without reloads
Nuxt.js + Bitrix headless 6–12 weeks SSR/SSG, full functionality, SEO

Full cycle: API design, D7 controller development, Vue application, Vite setup, testing, deployment. Code is reviewed, tested, documented — not "build and forget." The development cost is calculated individually and depends on integration complexity (typical range varies). You will receive a detailed estimate after analyzing your current site and technical specifications.

Common Mistakes When Integrating Vue.js and Bitrix

  1. Using ajax.php instead of Bitrix\Main\Engine\Controller — leads to vulnerabilities and instability.
  2. Lack of tagged API caching — server cannot handle high load.
  3. Ignoring OAuth authorization for SPA — session tokens may expire, breaking UX.
  4. Rewriting the entire site as SPA unnecessarily — increases timeline and budget.
  5. Incorrect Nuxt SSR configuration — slow page generation on backend.
Detailed technical considerations
  • Script loading order: Bitrix core scripts must not conflict with Vue. Use window.BX24 only after Vue app is mounted.
  • EventBus pattern: For cross-widget communication, prefer Pinia over $emit chains.
  • Error handling: Wrap REST calls in a global Axios interceptor that retries on 503 and logs to Bitrix admin log.

What We Deliver and Our Guarantees

  • API documentation (Swagger/OpenAPI) for integration with your backend.
  • Code repository access and CI/CD pipeline.
  • Team training on Vue component usage and maintenance.
  • 1 month post-release support — stability guarantee.
  • Code complies with PSR-12 and Bitrix\Main\Engine\Controller standards.

Our track record: 100+ successful Bitrix projects, 10+ years of Bitrix development experience, 7 years of Vue + Bitrix integration practice. We deliver turnkey solutions — from a simple filter widget to a full Nuxt.js headless store.

Order Vue.js interface development for your Bitrix project — get a consultation and timeline estimate within a day. Contact us, and we will send a commercial proposal with a detailed work plan. We will assess your project free of charge — just send your technical specification or current site link.