The user profile contains an enriched view of the current user, including identity information, school, grade, enrolled courses, goals, and XP totals.You can access user data in several ways:
Server-side: verify users or fetch profiles directly from your backend
Client-side: use a framework hook with built-in state and caching
The timeback.user namespace provides programmatic methods that accept an email directly. Use them in your own API routes, server actions, webhooks, cron jobs, or any backend context.
Use timeback.user.verify(email) to check whether a Timeback user exists for a given email. This is a lightweight check — it does not fetch enrollments, analytics, or build an enriched profile.
const result = await timeback.user.verify('student@example.com')if (result.verified) { console.log(result.timebackId) // "tb_abc123"}
Useful for gating features (e.g., offering a free tier to Timeback users) without the cost of a full profile fetch.
Use timeback.user.getProfile(email) to get the full enriched profile — identity, enrollments, courses, goals, and XP. This is the programmatic equivalent of the /user/me HTTP handler.
On the client, use the framework-specific profile hook. The hook handles loading state, caching, and session-aware refetching — you never call timeback.user.fetch() directly from the browser.