Initialization
Last updated
Was this helpful?
Last updated
Was this helpful?
First, the app needs to receive an authorization token from SAFE Launcher. Then, it needs to retrieve your email data (your email ID and your saved emails).
The authoriseApplication
function is called using AUTH_PAYLOAD
as an argument:
The app uses the information contained in its package.json
file for the following fields:
app.name
app.vendor
app.version
app.id
Therefore, the request body looks like this:
The LOW_LEVEL_API
permission is requested because the app needs to use the low-level APIs:
info::Why is it necessary to ask for this permission?By providing the
LOW_LEVEL_API
permission, the user should be aware that the app can now store data outside of SAFE Launcher's sandboxing. If the app doesn't properly keep track of the data it creates, the user might be unable to retrieve and delete data stored by the app. For example, it might be possible that some of the data created by the app cannot be deleted by the user. It's the responsibility of the app to keep track of the data it creates using the low-level API.
SAFE Launcher displays a prompt with basic information about the app along with the requested permission (LOW_LEVEL_API
). You can authorize this request by clicking on "ALLOW".
After you authorize the request, the app receives an authorization token.
info::What is an authorization token?
Your root structured data is created using a random ID. In order to be able to retrieve your root structured data later, you need to store its ID in a config file. This config file will be stored in the app's root directory.
The app sends an to SAFE Launcher.
Authorization tokens are used to invoke APIs that require . These tokens are session based and thus will be valid only while SAFE Launcher is running.
The app needs a way to store your email data on the SAFE Network. One solution is to create a private that will be used by the app to store your email ID and your saved emails. Let's call it the "root structured data".
During the initialization process, in its root directory. , the app creates a root structured data and a config file. , the app tries to fetch your root structured data.