Skip to main content

User

Extends

Implements

Constructors

new User()

new User(data?): User

Creates a new class instance

Parameters

data?: IUser

Returns

User

Inherited from

Wrapper<UserSchema, IUser>.constructor

Source

src/lib/Wrapper.ts:36

new User()

new User(client, data?): User

Parameters

client: Client

data?: IUser

Returns

User

Inherited from

Wrapper<UserSchema, IUser>.constructor

Source

src/lib/Wrapper.ts:37

Properties

accessLevel?

optional readonly accessLevel: UserAccessLevel

Implementation of

IUser.accessLevel

Source

src/User.ts:160


avatar?

optional readonly avatar: AvatarURL

The user's avatar URL.

Implementation of

IUser.avatar

Source

src/User.ts:99


badgeCounts?

optional readonly badgeCounts: Record<BadgeCategory, number>

The user's badge counts by category.

Implementation of

IUser.badgeCounts

Source

src/User.ts:111


bio?

optional readonly bio: string

The user's bio.

Implementation of

IUser.bio

Source

src/User.ts:103


canAccessDistrictsHomepage?

optional readonly canAccessDistrictsHomepage: boolean

Implementation of

IUser.canAccessDistrictsHomepage

Source

src/User.ts:126


canHellban?

optional readonly canHellban: boolean

Implementation of

IUser.canHellban

Source

src/User.ts:127


canMessageUsers?

optional readonly canMessageUsers: boolean

Whether the user can send Guardian messages.

Implementation of

IUser.canMessageUsers

Source

src/User.ts:131


canModifyCoaches?

optional readonly canModifyCoaches: boolean

Implementation of

IUser.canModifyCoaches

Source

src/User.ts:132


child?

optional readonly child: boolean

Whether the user is a child account.

Implementation of

IUser.child

Source

src/User.ts:149


client?

optional client: Client

The client that this base was fetched with.

Inherited from

Wrapper.client

Source

src/lib/Wrapper.ts:15


completedVideos?

optional readonly completedVideos: number

Implementation of

IUser.completedVideos

Source

src/User.ts:124


creator?

optional readonly creator: boolean

Implementation of

IUser.creator

Source

src/User.ts:156


curator?

optional readonly curator: boolean

Implementation of

IUser.curator

Source

src/User.ts:154


developer?

optional readonly developer: boolean

Implementation of

IUser.developer

Source

src/User.ts:141


email?

optional readonly email: string

The user's email address. Required authentication.

Implementation of

IUser.email

Source

src/User.ts:91


emails?

optional readonly emails: string[]

The user's authentication email addresses. Required authentication.

Implementation of

IUser.emails

Source

src/User.ts:95


formalTeacher?

optional readonly formalTeacher: boolean

Source

src/User.ts:153


googleID?

optional readonly googleID: null | string

Implementation of

IUser.googleID

Source

src/User.ts:118


hasAccessToAIGuideDev?

optional readonly hasAccessToAIGuideDev: boolean

Implementation of

IUser.hasAccessToAIGuideDev

Source

src/User.ts:134


hasAccessToAIGuideTeacher?

optional readonly hasAccessToAIGuideTeacher: boolean

Implementation of

IUser.hasAccessToAIGuideTeacher

Source

src/User.ts:135


hasChildren?

optional readonly hasChildren: boolean

Implementation of

IUser.hasChildren

Source

src/User.ts:136


hasClasses?

optional readonly hasClasses: boolean

Implementation of

IUser.hasClasses

Source

src/User.ts:137


hasCoach?

optional readonly hasCoach: boolean

Implementation of

IUser.hasCoach

Source

src/User.ts:138


hasStudents?

optional readonly hasStudents: boolean

Implementation of

IUser.hasStudents

Source

src/User.ts:139


joined?

optional readonly joined: Date

The date the user created their account.

Implementation of

IUser.joined

Source

src/User.ts:115


kaid?

optional readonly kaid: null | `kaid_${number}`

The user's KAID.

Implementation of

IUser.kaid

Source

src/User.ts:79


key?

optional readonly key: string

Implementation of

IUser.key

Source

src/User.ts:117


midsignupPhantom?

optional readonly midsignupPhantom: boolean

Implementation of

IUser.midsignupPhantom

Source

src/User.ts:158


moderator?

optional readonly moderator: boolean

Whether the user is a Guardian.

Implementation of

IUser.moderator

Source

src/User.ts:145


newNotifications?

optional readonly newNotifications: number

The number of unread notifications.

Implementation of

IUser.newNotifications

Source

src/User.ts:123


nickname?

optional readonly nickname: string

The user's nickname. May in rare cases be null.

Implementation of

IUser.nickname

Source

src/User.ts:87


orphan?

optional readonly orphan: boolean

Implementation of

IUser.orphan

Source

src/User.ts:151


parent?

optional readonly parent: boolean

Implementation of

IUser.parent

Source

src/User.ts:150


phantom?

optional readonly phantom: boolean

Implementation of

IUser.phantom

Source

src/User.ts:157


points?

optional readonly points: number

The user's energy points.

Implementation of

IUser.points

Source

src/User.ts:107


programs?

optional readonly programs: Program[]

Implementation of

IUser.programs

Source

src/User.ts:163


publisher?

optional readonly publisher: boolean

Implementation of

IUser.publisher

Source

src/User.ts:155


qualarooID?

optional readonly qualarooID: null | string

Implementation of

IUser.qualarooID

Source

src/User.ts:119


rawData?

optional rawData: RecursivePartial<UserSchema<AvatarSchema, ProfileSchema, ListProgramsSchema<unknown>>>

The raw base schema data

Remarks

Only set if the base was created from a user schema.

Inherited from

Wrapper.rawData

Source

src/lib/Wrapper.ts:22


self?

optional readonly self: boolean

Whether the user is the currently authenticated user.

Implementation of

IUser.self

Source

src/User.ts:75


statistics?

optional readonly statistics: UserStatistics

Implementation of

IUser.statistics

Source

src/User.ts:162


teacher?

optional readonly teacher: boolean

Implementation of

IUser.teacher

Source

src/User.ts:152


username?

optional readonly username: null | string

The user's username. May not be set by the user.

Implementation of

IUser.username

Source

src/User.ts:83

Accessors

url

get url(): null | `http${string}://${string}khanacademy.${string}/profile/${string}`

Returns

null | `http${string}://${string}khanacademy.${string}/profile/${string}`

Source

src/User.ts:165

Methods

#resolveIdentifier()

private #resolveIdentifier(): string

Returns

string

Source

src/User.ts:201


copy()

copy(data): User

Updates data into the class

Parameters

data: IUser

The data to copy from

Returns

User

The class instance

Inherited from

Wrapper.copy

Source

src/lib/Wrapper.ts:53


copyFromSchema()

copyFromSchema(schema): User

Updates data from a schema into the instance

Parameters

schema: RecursivePartial<UserSchema<AvatarSchema, ProfileSchema, ListProgramsSchema<unknown>>>

The schema to copy from

Returns

User

The class instance

Inherited from

Wrapper.copyFromSchema

Source

src/lib/Wrapper.ts:65


get()

get(client): Promise<User>

Fetches the user's profile using a getFullUserProfile query and updates the user's data

Parameters

client: Client= undefined

Optional client to use for the request

Returns

Promise<User>

Overrides

Wrapper.get

See

Client.getUser

Source

src/User.ts:283


getAllPrograms()

getAllPrograms(client, sort?, limit?): Promise<User>

Parameters

client: Client= undefined

sort?: ListProgramSortOrder

limit?: number

Returns

Promise<User>

See

Client.getAllUserPrograms

Source

src/User.ts:332


getAvatar()

getAvatar(client): Promise<"https://www.khanacademy.org/images/avatars/svg/blobby-green.svg" | "https://www.khanacademy.org/images/avatars/svg/blobby-yellow.svg" | "https://www.khanacademy.org/images/avatars/svg/blobby-blue.svg" | "https://www.khanacademy.org/images/avatars/svg/blobby-purple.svg" | "https://www.khanacademy.org/images/avatars/svg/area-52-yellow.svg" | "https://www.khanacademy.org/images/avatars/svg/area-52-blue.svg" | "https://www.khanacademy.org/images/avatars/svg/area-52-green.svg" | "https://www.khanacademy.org/images/avatars/svg/area-52-purple.svg" | "https://www.khanacademy.org/images/avatars/svg/eggleston-blue.svg" | "https://www.khanacademy.org/images/avatars/svg/eggleston-yellow.svg" | "https://www.khanacademy.org/images/avatars/svg/eggleston-green.svg" | "https://www.khanacademy.org/images/avatars/svg/eggleston-orange.svg" | "https://www.khanacademy.org/images/avatars/svg/scuttlebug-purple.svg" | "https://www.khanacademy.org/images/avatars/svg/scuttlebug-yellow.svg" | "https://www.khanacademy.org/images/avatars/svg/scuttlebug-blue.svg" | "https://www.khanacademy.org/images/avatars/svg/scuttlebug-green.svg" | "https://www.khanacademy.org/images/avatars/svg/boggle-yellow.svg" | "https://www.khanacademy.org/images/avatars/svg/boggle-blue.svg" | "https://www.khanacademy.org/images/avatars/svg/boggle-green.svg" | "https://www.khanacademy.org/images/avatars/svg/boggle-purple.svg" | "https://www.khanacademy.org/images/avatars/svg/sneak-peak-green.svg" | "https://www.khanacademy.org/images/avatars/svg/sneak-peak-yellow.svg" | "https://www.khanacademy.org/images/avatars/svg/sneak-peak-blue.svg" | "https://www.khanacademy.org/images/avatars/svg/sneak-peak-purple.svg" | "https://www.khanacademy.org/images/avatars/svg/stelly-blue.svg" | "https://www.khanacademy.org/images/avatars/svg/stelly-yellow.svg" | "https://www.khanacademy.org/images/avatars/svg/stelly-green.svg" | "https://www.khanacademy.org/images/avatars/svg/stelly-orange.svg" | "https://www.khanacademy.org/images/avatars/svg/cacteye-purple.svg" | "https://www.khanacademy.org/images/avatars/svg/cacteye-yellow.svg" | "https://www.khanacademy.org/images/avatars/svg/cacteye-blue.svg" | "https://www.khanacademy.org/images/avatars/svg/cacteye-green.svg" | "https://www.khanacademy.org/images/avatars/svg/leaf-green.svg" | "https://www.khanacademy.org/images/avatars/svg/leaf-blue.svg" | "https://www.khanacademy.org/images/avatars/svg/leaf-grey.svg" | "https://www.khanacademy.org/images/avatars/svg/leaf-red.svg" | "https://www.khanacademy.org/images/avatars/svg/leaf-orange.svg" | "https://www.khanacademy.org/images/avatars/svg/leaf-yellow.svg" | "https://www.khanacademy.org/images/avatars/svg/leafers-seed.svg" | "https://www.khanacademy.org/images/avatars/svg/leafers-seedling.svg" | "https://www.khanacademy.org/images/avatars/svg/leafers-sapling.svg" | "https://www.khanacademy.org/images/avatars/svg/leafers-tree.svg" | "https://www.khanacademy.org/images/avatars/svg/leafers-ultimate.svg" | "https://www.khanacademy.org/images/avatars/svg/piceratops-seed.svg" | "https://www.khanacademy.org/images/avatars/svg/piceratops-seedling.svg" | "https://www.khanacademy.org/images/avatars/svg/piceratops-sapling.svg" | "https://www.khanacademy.org/images/avatars/svg/piceratops-tree.svg" | "https://www.khanacademy.org/images/avatars/svg/piceratops-ultimate.svg" | "https://www.khanacademy.org/images/avatars/svg/duskpin-seed.svg" | "https://www.khanacademy.org/images/avatars/svg/duskpin-seedling.svg" | "https://www.khanacademy.org/images/avatars/svg/duskpin-sapling.svg" | "https://www.khanacademy.org/images/avatars/svg/duskpin-tree.svg" | "https://www.khanacademy.org/images/avatars/svg/duskpin-ultimate.svg" | "https://www.khanacademy.org/images/avatars/svg/primosaur-seed.svg" | "https://www.khanacademy.org/images/avatars/svg/primosaur-seedling.svg" | "https://www.khanacademy.org/images/avatars/svg/primosaur-sapling.svg" | "https://www.khanacademy.org/images/avatars/svg/primosaur-tree.svg" | "https://www.khanacademy.org/images/avatars/svg/primosaur-ultimate.svg" | "https://www.khanacademy.org/images/avatars/svg/starky-seed.svg" | "https://www.khanacademy.org/images/avatars/svg/starky-seedling.svg" | "https://www.khanacademy.org/images/avatars/svg/starky-sapling.svg" | "https://www.khanacademy.org/images/avatars/svg/starky-tree.svg" | "https://www.khanacademy.org/images/avatars/svg/starky-ultimate.svg" | "https://www.khanacademy.org/images/avatars/svg/aqualine-seed.svg" | "https://www.khanacademy.org/images/avatars/svg/aqualine-seedling.svg" | "https://www.khanacademy.org/images/avatars/svg/aqualine-sapling.svg" | "https://www.khanacademy.org/images/avatars/svg/aqualine-tree.svg" | "https://www.khanacademy.org/images/avatars/svg/aqualine-ultimate.svg" | "https://www.khanacademy.org/images/avatars/svg/spunky-sam.svg" | "https://www.khanacademy.org/images/avatars/svg/spunky-sam-green.svg" | "https://www.khanacademy.org/images/avatars/svg/spunky-sam-orange.svg" | "https://www.khanacademy.org/images/avatars/svg/spunky-sam-red.svg" | "https://www.khanacademy.org/images/avatars/svg/marcimus.svg" | "https://www.khanacademy.org/images/avatars/svg/marcimus-orange.svg" | "https://www.khanacademy.org/images/avatars/svg/marcimus-red.svg" | "https://www.khanacademy.org/images/avatars/svg/marcimus-purple.svg" | "https://www.khanacademy.org/images/avatars/svg/mr-pink.svg" | "https://www.khanacademy.org/images/avatars/svg/mr-pink-green.svg" | "https://www.khanacademy.org/images/avatars/svg/mr-pink-orange.svg" | "https://www.khanacademy.org/images/avatars/svg/robot_female_1.svg" | "https://www.khanacademy.org/images/avatars/svg/robot_female_2.svg" | "https://www.khanacademy.org/images/avatars/svg/robot_female_3.svg" | "https://www.khanacademy.org/images/avatars/svg/robot_male_1.svg" | "https://www.khanacademy.org/images/avatars/svg/robot_male_2.svg" | "https://www.khanacademy.org/images/avatars/svg/robot_male_3.svg" | "https://www.khanacademy.org/images/avatars/svg/orange-juice-squid.svg" | "https://www.khanacademy.org/images/avatars/svg/purple-pi.svg" | "https://www.khanacademy.org/images/avatars/svg/purple-pi-pink.svg" | "https://www.khanacademy.org/images/avatars/svg/purple-pi-teal.svg" | "https://www.khanacademy.org/images/avatars/svg/mr-pants.svg" | "https://www.khanacademy.org/images/avatars/svg/mr-pants-green.svg" | "https://www.khanacademy.org/images/avatars/svg/mr-pants-orange.svg" | "https://www.khanacademy.org/images/avatars/svg/mr-pants-pink.svg" | "https://www.khanacademy.org/images/avatars/svg/mr-pants-purple.svg" | "https://www.khanacademy.org/images/avatars/svg/old-spice-man.svg" | "https://www.khanacademy.org/images/avatars/svg/old-spice-man-blue.svg" | "https://www.khanacademy.org/images/avatars/svg/cs-winston.svg" | "https://www.khanacademy.org/images/avatars/svg/cs-winston-baby.svg" | "https://www.khanacademy.org/images/avatars/svg/cs-ohnoes.svg" | "https://www.khanacademy.org/images/avatars/svg/cs-hopper-happy.svg" | "https://www.khanacademy.org/images/avatars/svg/cs-hopper-jumping.svg" | "https://www.khanacademy.org/images/avatars/svg/cs-hopper-cool.svg" | "https://www.khanacademy.org/images/avatars/blobby-green.png" | "https://www.khanacademy.org/images/avatars/blobby-yellow.png" | "https://www.khanacademy.org/images/avatars/blobby-blue.png" | "https://www.khanacademy.org/images/avatars/blobby-purple.png" | "https://www.khanacademy.org/images/avatars/area-52-yellow.png" | "https://www.khanacademy.org/images/avatars/area-52-blue.png" | "https://www.khanacademy.org/images/avatars/area-52-green.png" | "https://www.khanacademy.org/images/avatars/area-52-purple.png" | "https://www.khanacademy.org/images/avatars/eggleston-blue.png" | "https://www.khanacademy.org/images/avatars/eggleston-yellow.png" | "https://www.khanacademy.org/images/avatars/eggleston-green.png" | "https://www.khanacademy.org/images/avatars/eggleston-orange.png" | "https://www.khanacademy.org/images/avatars/scuttlebug-purple.png" | "https://www.khanacademy.org/images/avatars/scuttlebug-yellow.png" | "https://www.khanacademy.org/images/avatars/scuttlebug-blue.png" | "https://www.khanacademy.org/images/avatars/scuttlebug-green.png" | "https://www.khanacademy.org/images/avatars/boggle-yellow.png" | "https://www.khanacademy.org/images/avatars/boggle-blue.png" | "https://www.khanacademy.org/images/avatars/boggle-green.png" | "https://www.khanacademy.org/images/avatars/boggle-purple.png" | "https://www.khanacademy.org/images/avatars/sneak-peak-green.png" | "https://www.khanacademy.org/images/avatars/sneak-peak-yellow.png" | "https://www.khanacademy.org/images/avatars/sneak-peak-blue.png" | "https://www.khanacademy.org/images/avatars/sneak-peak-purple.png" | "https://www.khanacademy.org/images/avatars/stelly-blue.png" | "https://www.khanacademy.org/images/avatars/stelly-yellow.png" | "https://www.khanacademy.org/images/avatars/stelly-green.png" | "https://www.khanacademy.org/images/avatars/stelly-orange.png" | "https://www.khanacademy.org/images/avatars/cacteye-purple.png" | "https://www.khanacademy.org/images/avatars/cacteye-yellow.png" | "https://www.khanacademy.org/images/avatars/cacteye-blue.png" | "https://www.khanacademy.org/images/avatars/cacteye-green.png" | "https://www.khanacademy.org/images/avatars/leaf-green.png" | "https://www.khanacademy.org/images/avatars/leaf-blue.png" | "https://www.khanacademy.org/images/avatars/leaf-grey.png" | "https://www.khanacademy.org/images/avatars/leaf-red.png" | "https://www.khanacademy.org/images/avatars/leaf-orange.png" | "https://www.khanacademy.org/images/avatars/leaf-yellow.png" | "https://www.khanacademy.org/images/avatars/leafers-seed.png" | "https://www.khanacademy.org/images/avatars/leafers-seedling.png" | "https://www.khanacademy.org/images/avatars/leafers-sapling.png" | "https://www.khanacademy.org/images/avatars/leafers-tree.png" | "https://www.khanacademy.org/images/avatars/leafers-ultimate.png" | "https://www.khanacademy.org/images/avatars/piceratops-seed.png" | "https://www.khanacademy.org/images/avatars/piceratops-seedling.png" | "https://www.khanacademy.org/images/avatars/piceratops-sapling.png" | "https://www.khanacademy.org/images/avatars/piceratops-tree.png" | "https://www.khanacademy.org/images/avatars/piceratops-ultimate.png" | "https://www.khanacademy.org/images/avatars/duskpin-seed.png" | "https://www.khanacademy.org/images/avatars/duskpin-seedling.png" | "https://www.khanacademy.org/images/avatars/duskpin-sapling.png" | "https://www.khanacademy.org/images/avatars/duskpin-tree.png" | "https://www.khanacademy.org/images/avatars/duskpin-ultimate.png" | "https://www.khanacademy.org/images/avatars/primosaur-seed.png" | "https://www.khanacademy.org/images/avatars/primosaur-seedling.png" | "https://www.khanacademy.org/images/avatars/primosaur-sapling.png" | "https://www.khanacademy.org/images/avatars/primosaur-tree.png" | "https://www.khanacademy.org/images/avatars/primosaur-ultimate.png" | "https://www.khanacademy.org/images/avatars/starky-seed.png" | "https://www.khanacademy.org/images/avatars/starky-seedling.png" | "https://www.khanacademy.org/images/avatars/starky-sapling.png" | "https://www.khanacademy.org/images/avatars/starky-tree.png" | "https://www.khanacademy.org/images/avatars/starky-ultimate.png" | "https://www.khanacademy.org/images/avatars/aqualine-seed.png" | "https://www.khanacademy.org/images/avatars/aqualine-seedling.png" | "https://www.khanacademy.org/images/avatars/aqualine-sapling.png" | "https://www.khanacademy.org/images/avatars/aqualine-tree.png" | "https://www.khanacademy.org/images/avatars/aqualine-ultimate.png" | "https://www.khanacademy.org/images/avatars/spunky-sam.png" | "https://www.khanacademy.org/images/avatars/spunky-sam-green.png" | "https://www.khanacademy.org/images/avatars/spunky-sam-orange.png" | "https://www.khanacademy.org/images/avatars/spunky-sam-red.png" | "https://www.khanacademy.org/images/avatars/marcimus.png" | "https://www.khanacademy.org/images/avatars/marcimus-orange.png" | "https://www.khanacademy.org/images/avatars/marcimus-red.png" | "https://www.khanacademy.org/images/avatars/marcimus-purple.png" | "https://www.khanacademy.org/images/avatars/mr-pink.png" | "https://www.khanacademy.org/images/avatars/mr-pink-green.png" | "https://www.khanacademy.org/images/avatars/mr-pink-orange.png" | "https://www.khanacademy.org/images/avatars/robot_female_1.png" | "https://www.khanacademy.org/images/avatars/robot_female_2.png" | "https://www.khanacademy.org/images/avatars/robot_female_3.png" | "https://www.khanacademy.org/images/avatars/robot_male_1.png" | "https://www.khanacademy.org/images/avatars/robot_male_2.png" | "https://www.khanacademy.org/images/avatars/robot_male_3.png" | "https://www.khanacademy.org/images/avatars/orange-juice-squid.png" | "https://www.khanacademy.org/images/avatars/purple-pi.png" | "https://www.khanacademy.org/images/avatars/purple-pi-pink.png" | "https://www.khanacademy.org/images/avatars/purple-pi-teal.png" | "https://www.khanacademy.org/images/avatars/mr-pants.png" | "https://www.khanacademy.org/images/avatars/mr-pants-green.png" | "https://www.khanacademy.org/images/avatars/mr-pants-orange.png" | "https://www.khanacademy.org/images/avatars/mr-pants-pink.png" | "https://www.khanacademy.org/images/avatars/mr-pants-purple.png" | "https://www.khanacademy.org/images/avatars/old-spice-man.png" | "https://www.khanacademy.org/images/avatars/old-spice-man-blue.png" | "https://www.khanacademy.org/images/avatars/cs-winston.png" | "https://www.khanacademy.org/images/avatars/cs-winston-baby.png" | "https://www.khanacademy.org/images/avatars/cs-ohnoes.png" | "https://www.khanacademy.org/images/avatars/cs-hopper-happy.png" | "https://www.khanacademy.org/images/avatars/cs-hopper-jumping.png" | "https://www.khanacademy.org/images/avatars/cs-hopper-cool.png">

Parameters

client: Client= undefined

Returns

Promise<"https://www.khanacademy.org/images/avatars/svg/blobby-green.svg" | "https://www.khanacademy.org/images/avatars/svg/blobby-yellow.svg" | "https://www.khanacademy.org/images/avatars/svg/blobby-blue.svg" | "https://www.khanacademy.org/images/avatars/svg/blobby-purple.svg" | "https://www.khanacademy.org/images/avatars/svg/area-52-yellow.svg" | "https://www.khanacademy.org/images/avatars/svg/area-52-blue.svg" | "https://www.khanacademy.org/images/avatars/svg/area-52-green.svg" | "https://www.khanacademy.org/images/avatars/svg/area-52-purple.svg" | "https://www.khanacademy.org/images/avatars/svg/eggleston-blue.svg" | "https://www.khanacademy.org/images/avatars/svg/eggleston-yellow.svg" | "https://www.khanacademy.org/images/avatars/svg/eggleston-green.svg" | "https://www.khanacademy.org/images/avatars/svg/eggleston-orange.svg" | "https://www.khanacademy.org/images/avatars/svg/scuttlebug-purple.svg" | "https://www.khanacademy.org/images/avatars/svg/scuttlebug-yellow.svg" | "https://www.khanacademy.org/images/avatars/svg/scuttlebug-blue.svg" | "https://www.khanacademy.org/images/avatars/svg/scuttlebug-green.svg" | "https://www.khanacademy.org/images/avatars/svg/boggle-yellow.svg" | "https://www.khanacademy.org/images/avatars/svg/boggle-blue.svg" | "https://www.khanacademy.org/images/avatars/svg/boggle-green.svg" | "https://www.khanacademy.org/images/avatars/svg/boggle-purple.svg" | "https://www.khanacademy.org/images/avatars/svg/sneak-peak-green.svg" | "https://www.khanacademy.org/images/avatars/svg/sneak-peak-yellow.svg" | "https://www.khanacademy.org/images/avatars/svg/sneak-peak-blue.svg" | "https://www.khanacademy.org/images/avatars/svg/sneak-peak-purple.svg" | "https://www.khanacademy.org/images/avatars/svg/stelly-blue.svg" | "https://www.khanacademy.org/images/avatars/svg/stelly-yellow.svg" | "https://www.khanacademy.org/images/avatars/svg/stelly-green.svg" | "https://www.khanacademy.org/images/avatars/svg/stelly-orange.svg" | "https://www.khanacademy.org/images/avatars/svg/cacteye-purple.svg" | "https://www.khanacademy.org/images/avatars/svg/cacteye-yellow.svg" | "https://www.khanacademy.org/images/avatars/svg/cacteye-blue.svg" | "https://www.khanacademy.org/images/avatars/svg/cacteye-green.svg" | "https://www.khanacademy.org/images/avatars/svg/leaf-green.svg" | "https://www.khanacademy.org/images/avatars/svg/leaf-blue.svg" | "https://www.khanacademy.org/images/avatars/svg/leaf-grey.svg" | "https://www.khanacademy.org/images/avatars/svg/leaf-red.svg" | "https://www.khanacademy.org/images/avatars/svg/leaf-orange.svg" | "https://www.khanacademy.org/images/avatars/svg/leaf-yellow.svg" | "https://www.khanacademy.org/images/avatars/svg/leafers-seed.svg" | "https://www.khanacademy.org/images/avatars/svg/leafers-seedling.svg" | "https://www.khanacademy.org/images/avatars/svg/leafers-sapling.svg" | "https://www.khanacademy.org/images/avatars/svg/leafers-tree.svg" | "https://www.khanacademy.org/images/avatars/svg/leafers-ultimate.svg" | "https://www.khanacademy.org/images/avatars/svg/piceratops-seed.svg" | "https://www.khanacademy.org/images/avatars/svg/piceratops-seedling.svg" | "https://www.khanacademy.org/images/avatars/svg/piceratops-sapling.svg" | "https://www.khanacademy.org/images/avatars/svg/piceratops-tree.svg" | "https://www.khanacademy.org/images/avatars/svg/piceratops-ultimate.svg" | "https://www.khanacademy.org/images/avatars/svg/duskpin-seed.svg" | "https://www.khanacademy.org/images/avatars/svg/duskpin-seedling.svg" | "https://www.khanacademy.org/images/avatars/svg/duskpin-sapling.svg" | "https://www.khanacademy.org/images/avatars/svg/duskpin-tree.svg" | "https://www.khanacademy.org/images/avatars/svg/duskpin-ultimate.svg" | "https://www.khanacademy.org/images/avatars/svg/primosaur-seed.svg" | "https://www.khanacademy.org/images/avatars/svg/primosaur-seedling.svg" | "https://www.khanacademy.org/images/avatars/svg/primosaur-sapling.svg" | "https://www.khanacademy.org/images/avatars/svg/primosaur-tree.svg" | "https://www.khanacademy.org/images/avatars/svg/primosaur-ultimate.svg" | "https://www.khanacademy.org/images/avatars/svg/starky-seed.svg" | "https://www.khanacademy.org/images/avatars/svg/starky-seedling.svg" | "https://www.khanacademy.org/images/avatars/svg/starky-sapling.svg" | "https://www.khanacademy.org/images/avatars/svg/starky-tree.svg" | "https://www.khanacademy.org/images/avatars/svg/starky-ultimate.svg" | "https://www.khanacademy.org/images/avatars/svg/aqualine-seed.svg" | "https://www.khanacademy.org/images/avatars/svg/aqualine-seedling.svg" | "https://www.khanacademy.org/images/avatars/svg/aqualine-sapling.svg" | "https://www.khanacademy.org/images/avatars/svg/aqualine-tree.svg" | "https://www.khanacademy.org/images/avatars/svg/aqualine-ultimate.svg" | "https://www.khanacademy.org/images/avatars/svg/spunky-sam.svg" | "https://www.khanacademy.org/images/avatars/svg/spunky-sam-green.svg" | "https://www.khanacademy.org/images/avatars/svg/spunky-sam-orange.svg" | "https://www.khanacademy.org/images/avatars/svg/spunky-sam-red.svg" | "https://www.khanacademy.org/images/avatars/svg/marcimus.svg" | "https://www.khanacademy.org/images/avatars/svg/marcimus-orange.svg" | "https://www.khanacademy.org/images/avatars/svg/marcimus-red.svg" | "https://www.khanacademy.org/images/avatars/svg/marcimus-purple.svg" | "https://www.khanacademy.org/images/avatars/svg/mr-pink.svg" | "https://www.khanacademy.org/images/avatars/svg/mr-pink-green.svg" | "https://www.khanacademy.org/images/avatars/svg/mr-pink-orange.svg" | "https://www.khanacademy.org/images/avatars/svg/robot_female_1.svg" | "https://www.khanacademy.org/images/avatars/svg/robot_female_2.svg" | "https://www.khanacademy.org/images/avatars/svg/robot_female_3.svg" | "https://www.khanacademy.org/images/avatars/svg/robot_male_1.svg" | "https://www.khanacademy.org/images/avatars/svg/robot_male_2.svg" | "https://www.khanacademy.org/images/avatars/svg/robot_male_3.svg" | "https://www.khanacademy.org/images/avatars/svg/orange-juice-squid.svg" | "https://www.khanacademy.org/images/avatars/svg/purple-pi.svg" | "https://www.khanacademy.org/images/avatars/svg/purple-pi-pink.svg" | "https://www.khanacademy.org/images/avatars/svg/purple-pi-teal.svg" | "https://www.khanacademy.org/images/avatars/svg/mr-pants.svg" | "https://www.khanacademy.org/images/avatars/svg/mr-pants-green.svg" | "https://www.khanacademy.org/images/avatars/svg/mr-pants-orange.svg" | "https://www.khanacademy.org/images/avatars/svg/mr-pants-pink.svg" | "https://www.khanacademy.org/images/avatars/svg/mr-pants-purple.svg" | "https://www.khanacademy.org/images/avatars/svg/old-spice-man.svg" | "https://www.khanacademy.org/images/avatars/svg/old-spice-man-blue.svg" | "https://www.khanacademy.org/images/avatars/svg/cs-winston.svg" | "https://www.khanacademy.org/images/avatars/svg/cs-winston-baby.svg" | "https://www.khanacademy.org/images/avatars/svg/cs-ohnoes.svg" | "https://www.khanacademy.org/images/avatars/svg/cs-hopper-happy.svg" | "https://www.khanacademy.org/images/avatars/svg/cs-hopper-jumping.svg" | "https://www.khanacademy.org/images/avatars/svg/cs-hopper-cool.svg" | "https://www.khanacademy.org/images/avatars/blobby-green.png" | "https://www.khanacademy.org/images/avatars/blobby-yellow.png" | "https://www.khanacademy.org/images/avatars/blobby-blue.png" | "https://www.khanacademy.org/images/avatars/blobby-purple.png" | "https://www.khanacademy.org/images/avatars/area-52-yellow.png" | "https://www.khanacademy.org/images/avatars/area-52-blue.png" | "https://www.khanacademy.org/images/avatars/area-52-green.png" | "https://www.khanacademy.org/images/avatars/area-52-purple.png" | "https://www.khanacademy.org/images/avatars/eggleston-blue.png" | "https://www.khanacademy.org/images/avatars/eggleston-yellow.png" | "https://www.khanacademy.org/images/avatars/eggleston-green.png" | "https://www.khanacademy.org/images/avatars/eggleston-orange.png" | "https://www.khanacademy.org/images/avatars/scuttlebug-purple.png" | "https://www.khanacademy.org/images/avatars/scuttlebug-yellow.png" | "https://www.khanacademy.org/images/avatars/scuttlebug-blue.png" | "https://www.khanacademy.org/images/avatars/scuttlebug-green.png" | "https://www.khanacademy.org/images/avatars/boggle-yellow.png" | "https://www.khanacademy.org/images/avatars/boggle-blue.png" | "https://www.khanacademy.org/images/avatars/boggle-green.png" | "https://www.khanacademy.org/images/avatars/boggle-purple.png" | "https://www.khanacademy.org/images/avatars/sneak-peak-green.png" | "https://www.khanacademy.org/images/avatars/sneak-peak-yellow.png" | "https://www.khanacademy.org/images/avatars/sneak-peak-blue.png" | "https://www.khanacademy.org/images/avatars/sneak-peak-purple.png" | "https://www.khanacademy.org/images/avatars/stelly-blue.png" | "https://www.khanacademy.org/images/avatars/stelly-yellow.png" | "https://www.khanacademy.org/images/avatars/stelly-green.png" | "https://www.khanacademy.org/images/avatars/stelly-orange.png" | "https://www.khanacademy.org/images/avatars/cacteye-purple.png" | "https://www.khanacademy.org/images/avatars/cacteye-yellow.png" | "https://www.khanacademy.org/images/avatars/cacteye-blue.png" | "https://www.khanacademy.org/images/avatars/cacteye-green.png" | "https://www.khanacademy.org/images/avatars/leaf-green.png" | "https://www.khanacademy.org/images/avatars/leaf-blue.png" | "https://www.khanacademy.org/images/avatars/leaf-grey.png" | "https://www.khanacademy.org/images/avatars/leaf-red.png" | "https://www.khanacademy.org/images/avatars/leaf-orange.png" | "https://www.khanacademy.org/images/avatars/leaf-yellow.png" | "https://www.khanacademy.org/images/avatars/leafers-seed.png" | "https://www.khanacademy.org/images/avatars/leafers-seedling.png" | "https://www.khanacademy.org/images/avatars/leafers-sapling.png" | "https://www.khanacademy.org/images/avatars/leafers-tree.png" | "https://www.khanacademy.org/images/avatars/leafers-ultimate.png" | "https://www.khanacademy.org/images/avatars/piceratops-seed.png" | "https://www.khanacademy.org/images/avatars/piceratops-seedling.png" | "https://www.khanacademy.org/images/avatars/piceratops-sapling.png" | "https://www.khanacademy.org/images/avatars/piceratops-tree.png" | "https://www.khanacademy.org/images/avatars/piceratops-ultimate.png" | "https://www.khanacademy.org/images/avatars/duskpin-seed.png" | "https://www.khanacademy.org/images/avatars/duskpin-seedling.png" | "https://www.khanacademy.org/images/avatars/duskpin-sapling.png" | "https://www.khanacademy.org/images/avatars/duskpin-tree.png" | "https://www.khanacademy.org/images/avatars/duskpin-ultimate.png" | "https://www.khanacademy.org/images/avatars/primosaur-seed.png" | "https://www.khanacademy.org/images/avatars/primosaur-seedling.png" | "https://www.khanacademy.org/images/avatars/primosaur-sapling.png" | "https://www.khanacademy.org/images/avatars/primosaur-tree.png" | "https://www.khanacademy.org/images/avatars/primosaur-ultimate.png" | "https://www.khanacademy.org/images/avatars/starky-seed.png" | "https://www.khanacademy.org/images/avatars/starky-seedling.png" | "https://www.khanacademy.org/images/avatars/starky-sapling.png" | "https://www.khanacademy.org/images/avatars/starky-tree.png" | "https://www.khanacademy.org/images/avatars/starky-ultimate.png" | "https://www.khanacademy.org/images/avatars/aqualine-seed.png" | "https://www.khanacademy.org/images/avatars/aqualine-seedling.png" | "https://www.khanacademy.org/images/avatars/aqualine-sapling.png" | "https://www.khanacademy.org/images/avatars/aqualine-tree.png" | "https://www.khanacademy.org/images/avatars/aqualine-ultimate.png" | "https://www.khanacademy.org/images/avatars/spunky-sam.png" | "https://www.khanacademy.org/images/avatars/spunky-sam-green.png" | "https://www.khanacademy.org/images/avatars/spunky-sam-orange.png" | "https://www.khanacademy.org/images/avatars/spunky-sam-red.png" | "https://www.khanacademy.org/images/avatars/marcimus.png" | "https://www.khanacademy.org/images/avatars/marcimus-orange.png" | "https://www.khanacademy.org/images/avatars/marcimus-red.png" | "https://www.khanacademy.org/images/avatars/marcimus-purple.png" | "https://www.khanacademy.org/images/avatars/mr-pink.png" | "https://www.khanacademy.org/images/avatars/mr-pink-green.png" | "https://www.khanacademy.org/images/avatars/mr-pink-orange.png" | "https://www.khanacademy.org/images/avatars/robot_female_1.png" | "https://www.khanacademy.org/images/avatars/robot_female_2.png" | "https://www.khanacademy.org/images/avatars/robot_female_3.png" | "https://www.khanacademy.org/images/avatars/robot_male_1.png" | "https://www.khanacademy.org/images/avatars/robot_male_2.png" | "https://www.khanacademy.org/images/avatars/robot_male_3.png" | "https://www.khanacademy.org/images/avatars/orange-juice-squid.png" | "https://www.khanacademy.org/images/avatars/purple-pi.png" | "https://www.khanacademy.org/images/avatars/purple-pi-pink.png" | "https://www.khanacademy.org/images/avatars/purple-pi-teal.png" | "https://www.khanacademy.org/images/avatars/mr-pants.png" | "https://www.khanacademy.org/images/avatars/mr-pants-green.png" | "https://www.khanacademy.org/images/avatars/mr-pants-orange.png" | "https://www.khanacademy.org/images/avatars/mr-pants-pink.png" | "https://www.khanacademy.org/images/avatars/mr-pants-purple.png" | "https://www.khanacademy.org/images/avatars/old-spice-man.png" | "https://www.khanacademy.org/images/avatars/old-spice-man-blue.png" | "https://www.khanacademy.org/images/avatars/cs-winston.png" | "https://www.khanacademy.org/images/avatars/cs-winston-baby.png" | "https://www.khanacademy.org/images/avatars/cs-ohnoes.png" | "https://www.khanacademy.org/images/avatars/cs-hopper-happy.png" | "https://www.khanacademy.org/images/avatars/cs-hopper-jumping.png" | "https://www.khanacademy.org/images/avatars/cs-hopper-cool.png">

See

!.getUserAvatar

Source

src/User.ts:292


getPrograms()

getPrograms(client, sort?, limit?): AsyncGenerator<Program[], User, unknown>

Parameters

client: Client= undefined

sort?: ListProgramSortOrder

limit?: number

Returns

AsyncGenerator<Program[], User, unknown>

See

Client.getUserPrograms

Source

src/User.ts:311


getStatistics()

getStatistics(client): Promise<User>

Parameters

client: Client= undefined

Returns

Promise<User>

See

Client.getUserStatistics

Source

src/User.ts:302


is()

is(user): boolean

Checks if two users are the same

Parameters

user: IUser | User

The user to compare to

Returns

boolean

Overrides

Wrapper.is

Source

src/User.ts:351


isSchema()

isSchema(schema): boolean

Checks if the schema represents the same instance

Parameters

schema: RecursivePartial<UserSchema<AvatarSchema, ProfileSchema, ListProgramsSchema<unknown>>>

Returns

boolean

Inherited from

Wrapper.isSchema

Source

src/lib/Wrapper.ts:88


transformSchema()

transformSchema(schema): object

Parameters

schema: RecursivePartial<UserSchema<AvatarSchema, ProfileSchema, ListProgramsSchema<unknown>>>

Returns

object

accessLevel

accessLevel: undefined | UserAccessLevel = schema.profile.accessLevel

badgeCounts

badgeCounts: undefined | Record<BadgeCategory, number>

bio

bio: undefined | string

canAccessDistrictsHomepage

canAccessDistrictsHomepage: undefined | boolean

canHellban

canHellban: undefined | boolean

canMessageUsers

canMessageUsers: undefined | boolean

canModifyCoaches

canModifyCoaches: undefined | boolean

child

child: undefined | boolean

completedVideos

completedVideos: undefined | number = schema.countVideosCompleted

creator

creator: undefined | boolean

curator

curator: undefined | boolean

developer

developer: undefined | boolean

email

email: undefined | string

emails

emails: undefined | string[]

formalTeacher

formalTeacher: undefined | boolean

googleID

googleID: undefined | null | string

hasAccessToAIGuideDev

hasAccessToAIGuideDev: undefined | boolean

hasAccessToAIGuideTeacher

hasAccessToAIGuideTeacher: undefined | boolean

hasChildren

hasChildren: undefined | boolean

hasClasses

hasClasses: undefined | boolean

hasCoach

hasCoach: undefined | boolean

hasStudents

hasStudents: undefined | boolean

joined

joined: undefined | Date

kaid

kaid: undefined | null | `kaid_${number}`

key

key: undefined | string

midsignupPhantom

midsignupPhantom: undefined | boolean

moderator

moderator: undefined | boolean

newNotifications

newNotifications: undefined | number

nickname

nickname: undefined | string

orphan

orphan: undefined | boolean

parent

parent: undefined | boolean

phantom

phantom: undefined | boolean

points

points: undefined | number

publisher

publisher: undefined | boolean

qualarooID

qualarooID: undefined | null | string

self

self: undefined | boolean

teacher

teacher: undefined | boolean

username

username: undefined | null | string

Overrides

Wrapper.transformSchema

Source

src/User.ts:209


fromIdentifier()

static fromIdentifier(identifier): User

Parameters

identifier: string

Returns

User

Source

src/User.ts:190


fromSchema()

static fromSchema(schema): User

Creates a new user from the given from a user schema

Parameters

schema: RecursivePartial<UserSchema<AvatarSchema, ProfileSchema, ListProgramsSchema<unknown>>>

Returns

User

Description

Note that Client.getUser will automatically call this method. This is only useful if you need to use the low-level API.

See

Client.getUser

Source

src/User.ts:182