(feat): add auth() function
All checks were successful
CI / checks (push) Successful in 4m52s

(fix): wasm error
This commit is contained in:
Alois 2026-07-02 23:38:38 +02:00
commit 8ae8377662
5 changed files with 28 additions and 19 deletions

View file

@ -62,9 +62,7 @@ const client = await MTPClient.create({
client.subscribe("SomeType", (message) => console.log(message));
const clientId = client.credentials?.clientId == null
? await client.register()
: (await client.connect(), client.credentials.clientId);
const clientId = await client.auth();
await client.send("SomeType", { value: "hello" });
console.log("Connected MTP client", clientId, client.state);