@opencookie-dev/vue

Vue binding for the OpenCookie headless store
351
Install
npm install @opencookie-dev/vue
Latest Version:0.2.0
Vue:3
License:MIT
Last Updated:Sep 24, 2026
Links: npm
Maintainer: jacksonxly

@opencookie-dev/vue

The Vue 3 binding for OpenCookie's headless external store. Consent behavior remains in @opencookie-dev/core; this package only supplies a plugin and composables.

Install

pnpm add @opencookie-dev/core @opencookie-dev/vue
import { createApp } from "vue";
import { createOpenCookiePlugin } from "@opencookie-dev/vue";

createApp(App).use(createOpenCookiePlugin(store)).mount("#app");

Read the current snapshot in a component:

import type { OpenCookieSnapshot } from "@opencookie-dev/core";
import { useOpenCookieSnapshot } from "@opencookie-dev/vue";

const snapshot = useOpenCookieSnapshot<OpenCookieSnapshot>();

During server rendering, the composable reads getServerSnapshot() and does not subscribe. In the browser it subscribes for the current Vue scope and disposes automatically.

For Nuxt, use @opencookie-dev/nuxt.

OpenCookie is a technical tool, not legal advice.

Related Packages

@opencookie-dev/nuxt

Nuxt module and SSR-safe runtime binding for OpenCookie

324

Version History

Version Released Vue License
0.2.0 >=3.5.0 <4.0.0 MIT
0.1.0 >=3.5.0 <4.0.0 MIT