# 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 events go out immediately. You don't have to check it before tracking: events tracked earlier are held (up to 50) and sent once it turns `true`. It is useful for showing a status or disabling UI until analytics is connected.

## Examples

### Basic check

```typescript
import { tode } from '@tode-sdk/core';

if (tode.isReady) {
  tode.trackAction('plugin_opened');
}
```

### In UI code with framework adapters

**React:**
```tsx
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

```tsx
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

- [tode.init()](https://docs.usetode.dev/api/init) - Initialize Tode
- [tode.trackAction()](https://docs.usetode.dev/api/track-action) - Track actions

Source: https://docs.usetode.dev/api/is-ready
