The Portabella SDK is the open source package that powers all interactions on Portabella. It handles:
- generating new private keys
- authenticating requests via signatures
- encrypting and decrypting payloads
- wrapping and unwrapping keys for collaboration purposes.
While we iron out the HTTP API documentation it's best to just look at the generated typedocs that come with the package.
At the most basic level here are some actions you migh be interested in doing:
You can initialise the SDK as follows:
Before you read or write any data you'll need to prime the SDK for that action. If you're wanting to read data, make sure you call
await sdk.fetchProject(), this forces the SDK to fetch the private key for the project so you can decrypt data.
If you want to write you can do
await sdk.loadPublicKey() and that will fetch the projects public key so you can write data to it.
Now that you've initialised the SDK you can create your first task, doing so looks a little like this:
You can refer to the generated typedocs for additional properties to pass through here. The SDK will handle all aspects of encryption.
Reading a created task is as easy as created one. The SDK will handle all aspects of decryption.