# useCroct

Learn how to access the SDK instance.

This composable returns the Croct Plug instance, giving you access to the full [Plug API](/reference/sdk/javascript/api/plug/plug).

## Signature

This composable has the following signature:

```ts
function useCroct(): Plug;
```

## Example

Here is an example of how to use this composable to track a goal event:

**JavaScript**

```vue
<script setup>
const croct = useCroct();

function onCtaClick() {
  croct.track('goalCompleted', {
    goalId: 'ctaClicked',
  });
}
</script>

<template>
  <a href="/signup" @click="onCtaClick">Sign up for free</a>
</template>
```

**TypeScript**

```vue
<script setup lang="ts">
const croct = useCroct();

function onCtaClick() {
  croct.track('goalCompleted', {
    goalId: 'ctaClicked',
  });
}
</script>

<template>
  <a href="/signup" @click="onCtaClick">Sign up for free</a>
</template>
```

## Explore

- [Plug API](/reference/sdk/javascript/api/plug/plug): Explore the full Plug API for tracking, identification, and more.
