Skip to main content

Message type - Image

Enables sending a single image as a messages to the recipient. You will need to pass the image as base64. Base64 is a method for encoding binary data into ASCII text.

// userAlice.chat.send(recipient, message)
// This section focuses on customization parameters for 'message' object
const aliceMessagesBob = await userAlice.chat.send(recipient, {
type: 'Image',
content:
'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAvklEQVR4AcXBsW2FMBiF0Y8r3GQb6jeBxRauYRpo4yGQkMd4gg==',
});

Push Chat also supports Image URLs (including GIFs), see Media Embed message type to learn more.


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.typeImageTextType of message Content
-message.contentstring-Message Content

Note: Parameters in this style are mandatory.