Skip to main content
The settings system allows users to manage their profiles, account security, notification preferences, and push subscriptions.

Overview

The tangle.client.settings package provides comprehensive user settings management, including profile editing, password changes, notification configuration, and push notification setup.

Profile Management

Edit Profile

Update user profile information including name, username, bio, and icon.
name
string
User’s display name
username
string
User’s unique username
bio
string
User biography or status text
icon
fixed64
Snowflake ID of emoji to use as profile icon

Protocol Definition

// settings.editProfile -> ()
message EditProfile {
  optional string name = 1;
  optional string username = 2;
  optional string bio = 3;
  // @snowflake<Emoji>
  optional fixed64 icon = 4;
}
All fields are optional, allowing partial updates to the profile.

Edit Profile Photo

Update the user’s profile photo.
file
media.UploadedFileRef
Reference to an uploaded image file. Set to null/empty to remove the profile photo.

Protocol Definition

// settings.editProfilePhoto -> ()
message EditProfilePhoto { 
  optional media.UploadedFileRef file = 1; 
}

Change Status

Update the user’s online status.
status
UserStatus.Status
required
The new status to set (online, idle, do not disturb, invisible)

Protocol Definition

// settings.changeStatus -> ()
message ChangeStatus {
  tangle.client.types.UserStatus.Status status = 2;
}

Account Management

Get Account

Retrieve account information for the authenticated user.
// settings.getAccount -> settings.Account
message GetAccount {}

Response: Account

email
string
User’s email address (if set)
confirmed
bool
required
Whether the email address has been confirmed
has_password
bool
required
Whether the account has a password set (accounts created via OAuth may not have passwords)

Protocol Definition

message Account {
  optional string email = 1;
  bool confirmed = 2;
  bool has_password = 3;
}

Change Password

Update the account password.
current_password
string
required
The user’s current password for verification
new_password
string
required
The new password to set
revoke_sessions
bool
required
If true, revoke all other active sessions after changing the password

Protocol Definition

// settings.changePassword -> ()
message ChangePassword {
  string current_password = 1;
  string new_password = 2;
  bool revoke_sessions = 3; // Revoke all other sessions after password change
}
Setting revoke_sessions to true will log the user out of all other devices and sessions.

Change Email

Update the account email address.
new_email
string
required
The new email address to set

Protocol Definition

// settings.changeEmail -> ()
message ChangeEmail {
  string new_email = 1;
}

Notification Preferences

Change Notification Preferences

Configure notification settings for specific chats or communities.
prefs
NotifPrefs
required
The notification preference level to set
chat_ref
refs.ChatRef
Target chat for the notification setting (mutually exclusive with community_id)
community_id
fixed64
Target community ID for default notification setting (mutually exclusive with chat_ref)

Protocol Definition

// settings.changeNotificationPreferences -> ()
message ChangeNotificationPreferences {
  enum NotifPrefs {
    ALL = 0;
    MENTIONS = 1;
    NONE = 2;
  }
  
  NotifPrefs prefs = 1;
  
  oneof scope {
    refs.ChatRef chat_ref = 2; // For channel or DM chat
    // @snowflake<Community>
    fixed64 community_id = 3; // For community-level default
  }
}

Notification Preference Levels

ALL
0
Receive notifications for all messages
MENTIONS
1
Receive notifications only for mentions and replies
NONE
2
Do not receive any notifications
Notification preferences can be set at both the chat level and community level. Chat-level settings override community-level defaults.

Push Notifications

Register Push Subscription

Register a device or browser for push notifications.
web
WebPush
Web push subscription details (for browser-based push notifications)
push
Push
Mobile push subscription details (for native mobile apps)

Protocol Definition

// settings.registerPushSubscription -> ()
message RegisterPushSubscription {
  enum PushType {
    UNKNOWN = 0;
    WEB = 1;
  }
  message WebPush {
    string endpoint = 1;
    string p256dh = 2;
    string auth = 3;
  }
  message Push {
    PushType type = 1;
    string token = 2;
  }

  oneof subscription {
    WebPush web = 1;
    Push push = 2;
  }
}

WebPush Fields

endpoint
string
required
Push service endpoint URL
p256dh
string
required
P-256 ECDH public key for encryption
auth
string
required
Authentication secret for the push subscription

Push Fields

type
PushType
required
Type of push notification system
token
string
required
Device token for push notifications

Unregister Push Subscription

Remove the current device’s push notification subscription.
// settings.unregisterPushSubscription -> ()
message UnregisterPushSubscription {}

Common Workflows

Updating Profile

  1. Send EditProfile with desired field updates (name, username, bio, icon)
  2. Optionally send EditProfilePhoto to update the profile picture
  3. Changes are reflected immediately

Changing Password

  1. Send ChangePassword with current and new password
  2. Optionally set revoke_sessions to log out other devices
  3. Store new password credentials securely

Configuring Notifications

  1. Send ChangeNotificationPreferences with desired preference level
  2. Specify either a chat or community scope
  3. Notifications will follow the new preference level

Setting Up Push Notifications

  1. Obtain push subscription from browser or mobile OS
  2. Send RegisterPushSubscription with subscription details
  3. Server will send push notifications according to user preferences
  4. Call UnregisterPushSubscription when logging out or disabling notifications

Build docs developers (and LLMs) love