Skip to content
  • Auto
  • Light
  • Dark
Get Started
View as Markdown
Copy Markdown

Open in Claude
Open in ChatGPT

Retrieve

client.alias.username.retrieve(stringusername, RequestOptionsoptions?): User { id, bio, links, 4 more }
get/v1/alias/{username}

Get basic details about a user, given their username

ParametersExpand Collapse
username: string
ReturnsExpand Collapse
User { id, bio, links, 4 more }

User object

id: string

The ID of this user

formatuuid
bio: string | null

The user’s biography, if they have provided one

URL of this user on this API

formaturi
profileImageUrl: string | null

URL that points to the user’s profile image, if one exists

formaturi
type: "user" | "org"

Whether this is a user or an organization

Accepts one of the following:
"user"
"org"
url: string

URL of this user’s profile on Val Town’s website

formaturi
username: string | null

The user’s handle that they chose for themselves. Does not include the @ symbol

import ValTown from "npm:@valtown/sdk";

const client = new ValTown();

const user = await client.alias.username.retrieve('username');

console.log(user.id);
{
  "id": "00000000-0000-0000-0000-000000000000",
  "bio": "Hello world",
  "links": {
    "self": "https://example.com"
  },
  "profileImageUrl": null,
  "type": "user",
  "url": "https://val.town/u/tmcw",
  "username": "tmcw"
}
Returns Examples
{
  "id": "00000000-0000-0000-0000-000000000000",
  "bio": "Hello world",
  "links": {
    "self": "https://example.com"
  },
  "profileImageUrl": null,
  "type": "user",
  "url": "https://val.town/u/tmcw",
  "username": "tmcw"
}