@tode-sdk/figma-vue

Tode Analytics SDK for Figma plugins built with Vue
311
Install
npm install @tode-sdk/figma-vue
Latest Version:1.0.0
Vue:3
License:MIT
Last Updated:Oct 22, 2026
Links: GitHub  ·  npm
Maintainer: kolebayev

@tode-sdk/figma-vue

Vue 3 composable for using Tode Analytics in a Figma plugin's UI (iframe).

npm install @tode-sdk/core @tode-sdk/figma-vue

Usage

<script setup lang="ts">
import { useTode } from '@tode-sdk/figma-vue';

const { trackAction, isReady, wsState } = useTode({
  debug: false,
  pingInterval: 5000,
  onWebSocketStateChange: (state) => console.log('WS:', state),
});
</script>

<template>
  <button @click="trackAction('button_clicked')">
    Click me
  </button>
</template>

Requires tode.init({ apiKey }) to have already run in the plugin controller (code.ts) - see the docs.

useTode(options?)

Option Type Default Description
debug boolean false Log internal adapter activity to the console
pingInterval number 5000 WebSocket keepalive ping interval, in ms
onWebSocketStateChange (state: WebSocketState) => void - Called whenever the session WebSocket's state changes

Returns { tode, isReady, wsState, trackAction, trackActionWithMetric } (isReady/wsState are readonly refs; the two track functions delegate to tode and accept the same optional TrackOptions). The composable listens for the plugin controller's config message, opens the session WebSocket once ready, and automatically reconnects (exponential backoff) if the connection drops. Cleanup runs automatically in onUnmounted - no manual destroy() call needed.

Related Packages

vue-mixpanel

Mixpanel analytics plugin for Vue 3

107,510 39
vue-hotjar

Vue Hotjar plugin

432,471 27
@piwikpro/vue-piwik-pro

Piwik PRO tracking library for VueJS

26,937
@piwikpro/nuxt-piwik-pro

Dedicated Piwik PRO library that helps with implementing Piwik PRO Tag Manager a...

9,831
vue-hotjar-next

Vue 3 Hotjar plugin

328,324 12

Version History

Version Released Vue License
1.0.0 >=3.0.0 MIT
Pre-releases (1)
Version Released License
0.0.0-stage