• Subscribe to changes to the current user's profile.

    The handler is invoked whenever the display name or avatar changes.

    Parameters

    • fn: ((profile) => void)

      Handler that receives the updated profile.

        • (profile): void
        • Parameters

          Returns void

    Returns Unsubscribe

    A function that cancels the subscription. Always call it during plugin teardown to avoid leaks.

    Example

    import { onProfileUpdate } from "@urth/metatell-sdk/user";

    const unsubscribe = onProfileUpdate((profile) => {
    nameLabel.textContent = profile.displayName;
    });

    // later, on teardown
    unsubscribe();