Identity API

User profiles, friends, and presence

Identity API

Manage user profiles, social connections, and online presence.

User Profiles

// Get current user profile
const profile = await aethex.identity.getProfile();

// Get another user's profile
const user = await aethex.identity.getUser('user_abc123');

// Update profile
await aethex.identity.update({
  displayName: 'CoolPlayer42',
  avatar: 'https://...',
  bio: 'Gaming enthusiast'
});

Friends System

// Send friend request
await aethex.identity.friends.request('user_xyz');

// Accept friend request
await aethex.identity.friends.accept('request_id');

// Get friends list
const friends = await aethex.identity.friends.list();

// Remove friend
await aethex.identity.friends.remove('user_xyz');

Presence

// Set online status
await aethex.identity.presence.set({
  status: 'online', // 'online', 'away', 'dnd', 'offline'
  activity: 'Playing GameForge'
});

// Subscribe to friend presence
aethex.identity.presence.subscribe((updates) => {
  updates.forEach(u => {
    console.log(`${u.userId} is now ${u.status}`);
  });
});