orbis.getMessages()

Returns an array of encrypted messages from a conversation.

How to use?

let { data, error } = await orbis.getMessages(conversation_id);

Parameters

  • conversation_id: ID of the conversation

Returns

[
  	{
  		stream_id: "k...",
  		conversation_id: "k...", /** Stream id of the conversation this message is sent to. */
  		creator: "did:pkh:...",
  		content: {
  			conversation_id: "k...", /** Stream id of the conversation this message is sent to. */
  			encryptedMessage: {
  				/**
  				 * 'encryptedString' and 'encryptedSymmetricKey' are two objects generated by Lit Protocol
  				 */
  		    encryptedString: "...",
  		    encryptedSymmetricKey: "...",

  				/** Stringified array of the access control conditions */
  		    accessControlConditions: "[]"
  		  }
  		},
  		creator_details: {
  			did: "did:pkh:...",
  			profile: {
  				username: "Baptiste",
  				pfp: "https://..."
  			}
  		},
  	},
  	...
  ]

Next steps

Explore other parts of the API.

orbis.getConversation()

orbis.decryptMessage()