Fetch a specific user.
import { whopApi } from "@/lib/whop-api";
const result = await whopApi.getUser({
// ID of the user by tag or the username.
userId: "user_XXXXXXXX" /* Required! */,
});
const response = {
// Fetch a specific user.
publicUser: {
// The internal ID of the user.
id: "xxxxxxxxxxx",
// The name of the user from their Whop account.
name: "some string",
// The username of the user from their Whop account.
username: "some string",
// The user's profile picture
profilePicture: {
// This is the URL you use to render optimized attachments on the client. This should be used for apps.
url: "some string",
},
// The city the user is from.
city: "some string",
// The country the user is from.
country: "some string",
// The user's bio
bio: "some string",
// Whether or not the user's phone is verified
phoneVerified: true,
// The user's banner image
banner: {
// This is the URL you use to render optimized attachments on the client. This should be used for apps.
url: "some string",
},
// When the user was created.
createdAt: 1716931200,
},
};
Was this page helpful?