# useCroct

Learn how to access the SDK instance.

This composable gets the instance of the SDK initialized by the [`createCroct`](/reference/sdk/vue/api/functions/create-croct) plugin, providing access to the [Plug API](/reference/sdk/javascript/api/plug).

## Signature

This composable has the following signature:

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

The return is the [Plug](/reference/sdk/javascript/api/plug) instance.

## Example

Here is an example of how to use this composable:

**JavaScript**

```vue
<script setup>
import {useCroct} from '@croct/plug-vue';

const croct = useCroct();

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

<template>
  <a href="/signup" @click="onClick">Sign up</a>
</template>
```

**TypeScript**

```vue
<script setup lang="ts">
import {useCroct} from '@croct/plug-vue';

const croct = useCroct();

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

<template>
  <a href="/signup" @click="onClick">Sign up</a>
</template>
```
