SDK Reference
Methods
DecryptPost

decryptPost

Decrypts the content of an encrypted post.

How to use?

content can be obtained using getPosts or getPost methods.

const res = await orbis.decryptPost(content);

Parameters

  • content - object containing post's encrypted contents
    • encryptedBody - object JSON object containing the encryption details
      • encryptedString - string Encrypted string generated by Lit Protocol
      • encryptedSymmetricKey - string Encrypted symmetric key generated by Lit Protocol
      • accessControlConditions - string Array of access control conditions stored as a string

Returns

{
  result: "Content of the decrypted post"
}

Examples

Fetch a post and decrypt it

const { data, error } = await orbis.getPost("k...")
if(error) throw error
 
const unencryptedPost = await orbis.decryptPost(data.content)
console.log("Unencrypted content:", unencryptedPost.result)