Vue / Nuxt Integration

Vue.js and Nuxt integration for SilentShield is coming soon.

Coming Soon

We are developing a Vue composable and Nuxt module for seamless integration. In the meantime, you can use the vanilla JavaScript integration which works with any framework.

Want to be notified when Vue support is ready? Contact us at [email protected].

Preview: Composable

A basic composable you can use today:

// composables/useSilentShield.ts
import { onMounted, onUnmounted } from 'vue';

export function useSilentShield(apiKey: string) {
  let script: HTMLScriptElement | null = null;

  onMounted(() => {
    script = document.createElement('script');
    script.src = `https://api.silentshield.io/client.js?key=${apiKey}`;
    script.defer = true;
    script.onload = () => {
      (window as any).SilentShield?.init({ apiKey });
    };
    document.head.appendChild(script);
  });

  onUnmounted(() => {
    if (script) document.head.removeChild(script);
  });
}