unsetToken

Clear any existing token.

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

The SDK automatically emits a userSignedOut 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:

croct.unsetToken(): void

Example

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

import croct from '@croct/plug';
console.log(croct.getToken()); // eyJhbGciOiJIUzI1Ni...
croct.unsetToken();
console.log(croct.getToken()); // null