Skip to content
  • Auto
  • Light
  • Dark
Get Started

Retrieve

Retrieve
client.alias.username.retrieve(stringusername, RequestOptionsoptions?): idstringbiounionlinksLinksprofileImageUrlunionurlstringusernameunionUser
get/v1/alias/{username}

Get basic details about a user, given their username

Parameters
usernamestring
Returns
idstringbiounionlinksLinksprofileImageUrlunionurlstringusernameunionUser
import ValTown from '@valtown/sdk';

const client = new ValTown();

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

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