Vue 3

Add the script in index.html and initialize in mounted():

<!-- public/index.html -->
<script src="<https://glyph-core.s3.us-east-1.amazonaws.com/test/Glyph-unified-bundle.js>"></script>
// App.vue (script setup)
import { onMounted, onBeforeUnmount } from "vue";

onMounted(async () => {
  await (window as any).Glyph?.initWidget({
    theme: {
      primaryColor: "#fc6432",
      placement: "bottom-right",
      theme: "dark",
    },
    supportedChains: ["polygon"],
  });
});

onBeforeUnmount(() => {
  (window as any).Glyph?.destroyReactIframe?.();
});

Last updated