Overview
Inboxes are a way for users to send encrypted data to your app.
The advantage of Inboxes is that they don't require the user to be registered in order to send encrypted data. This opens up various possibilities in environments where you need to gather sensitive information from unregistered users (e.g. on your website).
To learn more about Inboxes, their structure, how they are encrypted, and what are their use cases - read Inbox Docs.
Before working with Inboxes, follow our Getting Started Guide. It will show you how to set up your project to work with PrivMX Bridge.
Sample code on this page is based on the initial assumptions.
Working with Inboxes
Let's start with the includes required to use the Inbox API:
Inboxes can be used in two different contexts/modes:
- in the management context - through a logged-in user, such as when we want to create or modify the Inbox,
- in the context of sending the Entries to the Inbox - from the public access level.
Working as a Logged-in User
To start using Inboxes you need to create the instances of the dependent modules: ThreadApi
and StoreApi
:
Creating an Inbox
In Inboxes, publicMeta
is exposed as the InboxPublicView
.
In short: this is a place where you can store any data that needs to be publicly accessible using getInboxPublicView(...)
.
Note that users don't have to be added to the Inbox to have access to this method - they only need Inbox' ID.
Putting data inside publicMeta
also gives your own server the ability to access it using PrivMX Bridge API.
Fetching Inboxes
Getting a list of Inboxes available for the user in the given Context:
Modifying Inboxes
How Updates Work
To update an Inbox you must always provide a full list of parameters.
The updateInbox(...)
method needs all the parameters as in the createInbox(...)
method and a few more. If you want to update
one of the parameters – provide it in a new modified form. If, on the other hand, you want to leave
the parameter unchanged – provide it as it was before.
We use cookies on our website. We use them to ensure the proper functioning of the site and, if you agree, for purposes we set, such as analytics or marketing.