@urth/metatell-sdk/emote lets a plugin trigger an emote and observe emotes
performed in the room.
import { trigger } from "@urth/metatell-sdk/emote";
trigger("wave");
trigger() requests the named emote from the host. The set of valid names is
defined by the metatell host. It is fire-and-forget: it returns nothing and
reports no error when the host does not handle the request.
onEmote() fires when any user performs an emote. It returns an Unsubscribe
function; call it on teardown.
import { onEmote } from "@urth/metatell-sdk/emote";
const off = onEmote((event) => {
console.log(event.sessionId, event.name, event.at);
});
interface EmoteEvent {
sessionId: string;
name: string;
at: number; // timestamp
}
sessionId to a user.