# unsetToken

Learn how to clear any existing token.

This method clears any existing token and effectively anonymizes the user.

The SDK automatically emits a [`userSignedOut`](/reference/event/types/user-account/user-signed-out) event. As a result, the current session is terminated and a new session is started.

Calling this method has no effect if no token is set.

## Signature

This method has the following signature:

```ts
croct.unsetToken(): void
```

## Example

Here is a basic example of how to use this method:

```ts
import croct from '@croct/plug';

console.log(croct.getToken()); // eyJhbGciOiJIUzI1Ni...

croct.unsetToken();

console.log(croct.getToken()); // null
```
