Types

TypeScript type definitions for user and persona data structures in the Deva SDK.

Note: This documentation presents the essential fields developers need to work with the Deva SDK. Additional fields that are handled internally by the SDK are not shown here. The types shown reflect the most commonly used properties for building applications.


UserInfo

User information returned from the useDeva hook.

Interface

type UserInfo = {
  id: string;
  sub: string;
  persona: UserPersonaInfo;
  email?: string;
  name?: string | null;
  preferred_username?: string | null;
  picture?: string | null;
};

Fields

id: string

  • Unique user identifier

sub: string

  • OAuth subject identifier

  • Persistent across sessions

persona: UserPersonaInfo

email: string | undefined

  • User's email address (optional)

name: string | null | undefined

  • User's full name (optional)

preferred_username: string | null | undefined

  • User's preferred username (optional)

picture: string | null | undefined

  • URL to profile picture (optional)

Usage


UserPersonaInfo

User's persona information for display purposes.

Interface

Fields

id: string

  • Unique persona identifier

username: string

  • Persona username

  • Used for @mentions

display_name: string | null | undefined

  • Display name for UI

  • Falls back to username if not set

avatar: string | null | undefined

  • URL to persona avatar image

description: string | null | undefined

  • Persona biography

yap_votes: number | undefined

  • Vote count (defaults to 0)

Usage


Persona

Public persona type used in components for displaying deva and user information.

Interface

Fields

id: string

  • Unique persona identifier

username: string

  • Persona username

display_name: string | null | undefined

  • Display name

avatar: string | null | undefined

  • Avatar URL

user_id: string | null | undefined

  • Associated user ID (null for AI devas)

Usage

Used internally by SDK components:


Type Relationships


Import

Note: UserPersonaInfo is embedded in UserInfo and typically not imported separately.


Last updated