Skip to main content

Get Current User

GET/me
Fetch the profile of whoever's logged in. This is typically one of the first calls you make after login-it tells you who the user is and gives you their basic profile info like name and email. Useful for displaying "Welcome back, Sarah!" or checking that authentication worked before doing anything else.

When to use this

  • Showing user profile info in your app's header or sidebar
  • Verifying the user's identity after login
  • Personalising the experience based on who's logged in

Response

User retrieved successfully

Notes

💡Call this after login to confirm authentication succeeded and to get the user's details for your UI.
Code Samples

Get your user profile using the TypeScript SDK:

import { BackstageClient } from '@ticketlayer/backstage';

const client = new BackstageClient({
organisationSlug: 'your-org',
});
client.setAccessToken('YOUR_ACCESS_TOKEN');

// Get the current authenticated user
const user = await client.users.getMe();

console.log(`Hello, ${user.firstName} ${user.lastName}!`);
console.log(`Email: ${user.email}`);
console.log(`User ID: ${user.id}`);

Try It

Related