Skip to content
DashboardGet API Key

Get current user

client.users.retrieveCurrent(RequestOptionsoptions?): UserRetrieveCurrentResponse { name }
GET/v1/users/me

Returns the identity associated with the authenticated API token.

ReturnsExpand Collapse
UserRetrieveCurrentResponse { name }
name: string

Display name of the API token.

Get current user

import Chamelaion from 'chamelaion';

const client = new Chamelaion({
  apiKey: process.env['CHAMELAION_API_KEY'], // This is the default and can be omitted
});

const response = await client.users.retrieveCurrent();

console.log(response.name);
{
  "name": "My API Token"
}
{
  "error": "missing authorization header"
}
{
  "error": "invalid authorization format"
}
{
  "error": "missing token"
}
{
  "error": "invalid token"
}
{
  "error": "unauthorized"
}
{
  "error": "internal error"
}
Returns Examples
{
  "name": "My API Token"
}
{
  "error": "missing authorization header"
}
{
  "error": "invalid authorization format"
}
{
  "error": "missing token"
}
{
  "error": "invalid token"
}
{
  "error": "unauthorized"
}
{
  "error": "internal error"
}