import { Luma } from "@alhwyn/luma";
const luma = new Luma(process.env.LUMA_API_KEY!);
const user = await luma.users.get();
console.log(user.email, user.id);
{
"id": "usr-abc123",
"email": "you@example.com",
"name": "Jane Doe"
}
Users
Get authenticated user
Fetch the authenticated Luma user profile with luma.users.get(), returning the id, name, email, and avatar linked to your API key.
import { Luma } from "@alhwyn/luma";
const luma = new Luma(process.env.LUMA_API_KEY!);
const user = await luma.users.get();
console.log(user.email, user.id);
{
"id": "usr-abc123",
"email": "you@example.com",
"name": "Jane Doe"
}
SDK
Run the script:
luma.users.get(): Promise<User>
Returns the authenticated user tied to your API key.
import { Luma } from "@alhwyn/luma";
const luma = new Luma(process.env.LUMA_API_KEY!);
const user = await luma.users.get();
console.log(user.email, user.id);
{
"id": "usr-abc123",
"email": "you@example.com",
"name": "Jane Doe"
}
Parameters
Takes no parameters.Test it
import { Luma } from "@alhwyn/luma";
const luma = new Luma(process.env.LUMA_API_KEY!);
const user = await luma.users.get();
console.log("Authenticated as:", user.email);
LUMA_API_KEY=your-key-here npx tsx script.ts
LUMA_API_KEY=your-key-here bun script.ts