Skip to content

Authentication using TalkLabs

Use this when you don’t run a login system and don’t want to build one. We give you the user database: you register each user with an id, a handle, and a display name, we store them, and your app puts them into chat. Your data stays yours — export it anytime.

What it takes: one call to register a user. That’s it.

Give the user a stable id you choose, a handle, and a display name. We create the record (or update it if it already exists) and store it for you.

register.js — sportstalk-sdk (server side)
import { ChatClient } from 'sportstalk-sdk';
// Your app id + your secret API key. Keep the API key on your server.
const client = ChatClient.init({ appId: APP_ID, apiToken: API_KEY });
// Create or update the user. We store them; export your data anytime.
await client.createOrUpdateUser({
userid: 'u-8842', // any stable id you choose
handle: 'dave_m', // unique handle
displayname: 'Dave',
});

That user now exists in your app and can be put into a room.

To give a registered user a live chat session in the browser, mint them a token from your server — a single call — then join. That mint step is the Authentication using my identities recipe; the identity you mint is the user you just registered.