Skip to main content

Message type - Meta

Enables sending arbitary meta actions in a group. This message type has some rules and it's recommeneded to not interact directly with this message type as Push SDK will handle it for you. It's documentated just for the curious minds.

// userAlice.chat.send(recipient, message)
// This section focuses on customization parameters for 'message' object
const aliceMessagesBob = await userAlice.chat.send(recipient, {
type: 'Meta',
content: "Alice.eth create the grp 'xyz'", // content can be eliminated
action: "CreateGroup", // can be "AddMember", "RemoveMember", "PromoteAdmin", etc
info: { // any added info that is not visible but can be programmatically understood
affected: [], // recipients // this can be array
arbitary: { // optional, can have anything, never shown based on type
timestamp: // epoch one, include timestamp so session key becomes different
}
}
});

Customization parameters‚Äč

When sending a message, you can customize the following params

ParamTypeSubtypeDefaultRemarks
recipientstring--Recipient supports a number of address format including wallet address, chain agnostic wallet address, NFT addresses or even chatid which is useful in groups
messageobject--Configuration for message to be sent
-message.typeMetaTextType of message Content
-message.contentstring-Message Content
-options.actionstring, choose from CreateGroup, AddMember, RemoveMember, PromoteAdmin, DemoteAdmin, UpdareGroupinfo-Action that is getting applied in the Meta message action
-options.info{ affected : string[]: arbitrary?: { [key: string]: any } }-Pass recipients in the affected array list, any arbitary data if applicable can be passed in arbitary object

Note: Parameters in this style are mandatory.