Mirra
SDK Reference

User

SDK reference for user operations

Overview

Internal user profile and account management system

  • Category: internal
  • Auth Required: No
  • Supported Modes: standard, delegated, service

Operations

getProfile

Get user profile information including username, email, timezone, phone, and usage stats

Returns:

UserProfile - User profile object with all profile fields

Example:

const result = await mirra.user.getProfile();

updateProfile

Update user profile fields (username, email, timezone, phone)

Arguments:

  • username (string, optional): New username (3-30 characters, alphanumeric with underscores/hyphens)
  • email (string, optional): New email address
  • timezone (string, optional): IANA timezone identifier (e.g., America/Los_Angeles)
  • phoneNumber (string, optional): Phone number (7-15 digits with optional formatting)

Returns:

UserProfile - Updated user profile object

Example:

const result = await mirra.user.updateProfile({});

updatePreferences

Update user preferences (notification settings, etc)

Arguments:

  • timezone (string, optional): Preferred timezone for scheduling
  • socials (object, optional): Social media links (twitter, discord)

Returns:

UserPreferences - Updated user preferences

Example:

const result = await mirra.user.updatePreferences({});

getUsageStats

Get token usage statistics, quota, and billing information

Returns:

UsageStats - Token usage and quota information

Example:

const result = await mirra.user.getUsageStats();

getSessions

Get active sessions/devices (based on push token registrations)

Returns:

Session[] - Array of active sessions/devices

Example:

const result = await mirra.user.getSessions();

deactivateAccount

Soft delete user account (set inactive flag) - CAUTION: This marks the account for deletion

Arguments:

  • confirm (boolean, required): Must be true to confirm account deactivation

Returns:

void - No return value on success

Example:

const result = await mirra.user.deactivateAccount({
  confirm: true
});

On this page