DecaneDocs
UsersLook up a user
Users

Look up a user

getUserById(userId) (1.8.0+) returns one user of your project: how they signed in, their addresses, and their email with emailVerified. It needs a project secret with the users:read scope.

This is how your server learns a signed-in user’s email. After a Google redirect, decane_email arrives in the URL as plain text the browser can change, and the Decane token is signed but carries no email. Verify the token, then look the user up by its id:

tsme.ts
const claims = await decane.verifyAccessToken(token);
const user = await decane.getUserById(claims.userId);

if (user.emailVerified) sendReceipt(user.email!);

emailVerified is true when the person proved the address (an email code, or Google’s verified claim) and false for an address your own server supplied through createUser. A user of another project, or an unknown id, answers NOT_FOUND.