@fonderie/vue

Shared Vue 3 provide/inject for Fonderie — provide one FonderieClient at the root, resolve it from any @fonderie/vue-* composable.
3,963 5
Install
npm install @fonderie/vue
Latest Version:0.11.0
Vue:3
License:MIT
Last Updated:Oct 19, 2026
Links: GitHub  ·  npm
Maintainer: fonderie

@fonderie/vue

Shared Vue 3 provide/inject for Fonderie. Provide one FonderieClient at the app root; every @fonderie/vue-* composable then resolves it by injection — no client argument at call sites.

import { createApp } from 'vue';
import { FonderieClient, createMemoryCache } from '@fonderie/client';
import { FonderiePlugin } from '@fonderie/vue';

const client = new FonderieClient({ baseUrl: 'https://api.example.com/v1', cache: createMemoryCache() });

createApp(App).use(FonderiePlugin, client).mount('#app');
<script setup lang="ts">
import { useLogin } from '@fonderie/vue-auth';

const { login, isLoading, error } = useLogin(); // resolved by injection
</script>

Alternatively call provideFonderie(client) inside the root component's setup(). Passing a client explicitly still works everywhere and always wins over injection — useful in tests and multi-client apps.

API

  • FonderiePlugin — app.use(FonderiePlugin, client).
  • provideFonderie(client) — provide from within a setup().
  • useFonderieClient() — the injected client; throws if none was provided.
  • FONDERIE_INJECTION_KEY — the typed InjectionKey<FonderieClient>.
  • useFonderieSubClient(explicit, select, composableName) — resolution helper used by the @fonderie/vue-* composable packages: explicit argument wins, otherwise select from the injected client, otherwise throw a named error.
  • useRemoteConfig(key, fallback) — one public remote-config value as a computed ref. Always live (shared @fonderie/sse stream, no polling); updates only when that key changes; never waits (last answer, device-restored value, or fallback); a key the server does not expose warns once.
  • withRemoteConfig(key, Component, { off?, fallback? }) — render a component only while a boolean key is on, off otherwise; props, attrs and slots pass through. For a whole screen pass fallback: true.
  • useSse(topics, onEvent, { onReset }) — Server-Sent Events ('*', exact types, prefix.*; topics may be a ref), one shared connection. Additive — never gate rendering on it.

Related Packages

vue-typescript-inject

Angular-like injector for Vue

1,469 13
vite-plugin-favicons-inject

A Vite plugin for creating and injecting favicons during the application build!

533,525 10
@fonderie/vue-auth

Vue composables for Fonderie auth — thin bindings over @fonderie/client.

4,674 5
@fonderie/vue-webhooks

Vue 3 composables for Fonderie's outgoing webhooks — thin bindings over @fonderi...

2,583 5
vue-inline-svg

Replace SVG images with inline SVG element

4,535,739 188

Version History

Version Released License
0.11.0 MIT
0.10.0 MIT
0.9.0 MIT
0.8.0 MIT
0.7.0 MIT