tode.isReady

Check if Tode is initialized and ready to track events.

Usage

TypeScript
if (tode.isReady) {
  tode.trackAction('action');
}

Type

boolean

Description

Returns true when Tode has been successfully initialized and is ready to track events. Always check this property before calling tracking methods to avoid errors.

Examples

Basic check

TypeScript
import { tode } from '@tode-sdk/core';
 
if (tode.isReady) {
  tode.trackAction('plugin_opened');
}

In UI code with framework adapters

React:

TypeScript
const { tode, isReady } = useTode();
 
const handleClick = () => {
  if (isReady) {
    tode.trackAction('button_clicked');
  }
};

Vue:

Vue
<script setup>
const { isReady, trackAction } = useTode();
 
const handleClick = () => {
  if (isReady.value) {
    trackAction('button_clicked');
  }
};
</script>

Conditional UI

TypeScript
function TrackButton() {
  const { isReady, tode } = useTode();
 
  return (
    <button
      onClick={() => tode.trackAction('click')}
      disabled={!isReady}
    >
      Track Action
    </button>
  );
}

Notes

  • Returns false until tode.init() completes successfully
  • Framework adapters provide reactive versions of this property
  • Always check before tracking to ensure events are captured

See Also

Track your Figma plugin

Sign up to get your API key and start collecting analytics in minutes.

Get your API key