@fonderie/vue
@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 asetup().useFonderieClient()— the injected client; throws if none was provided.FONDERIE_INJECTION_KEY— the typedInjectionKey<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/ssestream, no polling); updates only when that key changes; never waits (last answer, device-restored value, orfallback); a key the server does not expose warns once.withRemoteConfig(key, Component, { off?, fallback? })— render a component only while a boolean key is on,offotherwise; props, attrs and slots pass through. For a whole screen passfallback: true.useSse(topics, onEvent, { onReset })— Server-Sent Events ('*', exact types,prefix.*;topicsmay be a ref), one shared connection. Additive — never gate rendering on it.
Related Packages
vite-plugin-favicons-inject
A Vite plugin for creating and injecting favicons during the application build!
533,525
10
@fonderie/vue-webhooks
Vue 3 composables for Fonderie's outgoing webhooks — thin bindings over @fonderi...
2,583
5
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 | |
| 0.6.0 | MIT | |
| 0.5.3 | MIT | |
| 0.5.2 | MIT | |
| 0.5.1 | MIT | |
| 0.5.0 | MIT | |
| 0.4.0 | MIT | |
| 0.3.0 | MIT | |
| 0.2.0 | MIT | |
| 0.1.0 | MIT |