Documentation
    Preparing search index...

    Interface IdentityServiceOptions

    Options for creating the identity service.

    const identityService = createIdentityService({
    getSigner: () => window.nostr ?? null,
    });
    runtime.registerService('identity', identityService);
    interface IdentityServiceOptions {
        getBadges?: (
            pubkey: string,
            message: IdentityGetBadgesMessage,
        ) => MaybePromise<Badge[]>;
        getBlocked?: (
            pubkey: string,
            message: IdentityGetBlockedMessage,
        ) => MaybePromise<string[]>;
        getFollows?: (
            pubkey: string,
            message: IdentityGetFollowsMessage,
        ) => MaybePromise<string[]>;
        getList?: (
            listType: string,
            pubkey: string,
            message: IdentityGetListMessage,
        ) => MaybePromise<string[]>;
        getMutes?: (
            pubkey: string,
            message: IdentityGetMutesMessage,
        ) => MaybePromise<string[]>;
        getProfile?: (
            pubkey: string,
            message: IdentityGetProfileMessage,
        ) => MaybePromise<ProfileData | null>;
        getSigner: () => Signer | null;
        getZaps?: (
            pubkey: string,
            message: IdentityGetZapsMessage,
        ) => MaybePromise<ZapReceipt[]>;
    }
    Index

    Properties

    getBadges?: (
        pubkey: string,
        message: IdentityGetBadgesMessage,
    ) => MaybePromise<Badge[]>

    Optional host-backed badge lookup for the current user.

    Type Declaration

      • (pubkey: string, message: IdentityGetBadgesMessage): MaybePromise<Badge[]>
      • Parameters

        • pubkey: string

          Current signer pubkey, or "" when no signer is connected.

        • message: IdentityGetBadgesMessage

          Original identity.getBadges request envelope.

        Returns MaybePromise<Badge[]>

        Badges awarded to the user.

    getBlocked?: (
        pubkey: string,
        message: IdentityGetBlockedMessage,
    ) => MaybePromise<string[]>

    Optional host-backed block-list lookup for the current user.

    Type Declaration

      • (pubkey: string, message: IdentityGetBlockedMessage): MaybePromise<string[]>
      • Parameters

        • pubkey: string

          Current signer pubkey, or "" when no signer is connected.

        • message: IdentityGetBlockedMessage

          Original identity.getBlocked request envelope.

        Returns MaybePromise<string[]>

        Hex-encoded blocked pubkeys.

    getFollows?: (
        pubkey: string,
        message: IdentityGetFollowsMessage,
    ) => MaybePromise<string[]>

    Optional host-backed follow-list lookup for the current user.

    Type Declaration

      • (pubkey: string, message: IdentityGetFollowsMessage): MaybePromise<string[]>
      • Parameters

        • pubkey: string

          Current signer pubkey, or "" when no signer is connected.

        • message: IdentityGetFollowsMessage

          Original identity.getFollows request envelope.

        Returns MaybePromise<string[]>

        Hex-encoded followed pubkeys.

    getList?: (
        listType: string,
        pubkey: string,
        message: IdentityGetListMessage,
    ) => MaybePromise<string[]>

    Optional host-backed categorized-list lookup for the current user.

    Type Declaration

      • (
            listType: string,
            pubkey: string,
            message: IdentityGetListMessage,
        ): MaybePromise<string[]>
      • Parameters

        • listType: string

          Requested list category from the wire envelope.

        • pubkey: string

          Current signer pubkey, or "" when no signer is connected.

        • message: IdentityGetListMessage

          Original identity.getList request envelope.

        Returns MaybePromise<string[]>

        List entries.

    getMutes?: (
        pubkey: string,
        message: IdentityGetMutesMessage,
    ) => MaybePromise<string[]>

    Optional host-backed mute-list lookup for the current user.

    Type Declaration

      • (pubkey: string, message: IdentityGetMutesMessage): MaybePromise<string[]>
      • Parameters

        • pubkey: string

          Current signer pubkey, or "" when no signer is connected.

        • message: IdentityGetMutesMessage

          Original identity.getMutes request envelope.

        Returns MaybePromise<string[]>

        Hex-encoded muted pubkeys.

    getProfile?: (
        pubkey: string,
        message: IdentityGetProfileMessage,
    ) => MaybePromise<ProfileData | null>

    Optional host-backed profile lookup for the current user.

    Kehto does not query relays itself; hosts that already maintain kind-0 metadata can provide it here without replacing the whole identity service.

    Type Declaration

      • (
            pubkey: string,
            message: IdentityGetProfileMessage,
        ): MaybePromise<ProfileData | null>
      • Parameters

        • pubkey: string

          Current signer pubkey, or "" when no signer is connected.

        • message: IdentityGetProfileMessage

          Original identity.getProfile request envelope.

        Returns MaybePromise<ProfileData | null>

        Profile metadata, or null when unavailable.

    getSigner: () => Signer | null

    Return the NIP-07-compatible signer (or null) used to resolve identity.getPublicKey / identity.getRelays. Called on every request — availability can change dynamically.

    getZaps?: (
        pubkey: string,
        message: IdentityGetZapsMessage,
    ) => MaybePromise<ZapReceipt[]>

    Optional host-backed zap receipt lookup for the current user.

    Type Declaration

      • (pubkey: string, message: IdentityGetZapsMessage): MaybePromise<ZapReceipt[]>
      • Parameters

        • pubkey: string

          Current signer pubkey, or "" when no signer is connected.

        • message: IdentityGetZapsMessage

          Original identity.getZaps request envelope.

        Returns MaybePromise<ZapReceipt[]>

        Zap receipts.