Tagtics

TTaaggttiiccss

Overview

  • Introduction
  • Features
  • Tech Stack

Implementations

  • Client Overview
  • React / Next.js
  • Vue 3
  • Angular
  • Svelte
  • Solid.js
  • Vanilla JS / HTML
DDooccss
Dashboard
ImplementationsSvelte
Implementation Guide

Svelte Integration

Integrate TTaaggttiiccss using modern lifecycle hooks. The client automatically handles route changes for you.

Initialization

Call init when your app mounts and destroy when it unmounts to prevent memory leaks.

<script>
  import { onMount, onDestroy } from 'svelte';

  let script;

  onMount(() => {
    script = document.createElement('script');
    script.src = 'https://cdn.tagtics.online/client.js';
    script.async = true;
    script.onload = () => {
      window.Tagtics?.init({ apiKey: 'YOUR_API_KEY' });
    };
    document.body.appendChild(script);
  });

  onDestroy(() => {
    window.Tagtics?.destroy();
    script?.remove();
  });
</script>