Type alias UserInfo

UserInfo: {
    screenId: string;
    userId: string;
    username: string;
}

Represents a user in the context of a Devvit game.

This is a simplified version of a Reddit User. For more comprehensive user data, you should use the Reddit API Client.

Type declaration

  • screenId: string

    A unique ID for the specific app instance. If the user refreshes the page, they'll get a new screenId.

  • userId: string

    The Reddit user ID (t2_XXXXX format)

  • username: string

    The Reddit username

Example

const user: UserInfo = {
userId: "t2_abc123",
username: "RedditUser123",
screenId: "unique-session-id"
};