Alokai
You are reading the documentation for SDK v2, which is no longer the latest version. Switch to current

Authentication

Introduction

This section will cover the basics of authentication and how to register, login and logout a user.

API Reference You can find all available CT module methods and their description in the API Reference.

Registering a user

To register a user, you can use the signUp method of the CT module.

import { sdk } from '~/sdk.config.ts';

const { user } = await sdk.ct.signUp({
  email: 'email@example.com',
  password: 'password'
});

Logging in

To log in a user, you can use the signIn method of the CT module.

import { sdk } from '~/sdk.config.ts';

const { user } = await sdk.ct.signIn({
  email: 'test@gmail.com',
  password: 'test123!'
});

Logging out

To log out a user, you can use the signOut method of the CT module.

import { sdk } from '~/sdk.config.ts';

await sdk.ct.signOut();

On this page