Skip to content
The SDK and node releases can be downloaded only by accounts invited to their repositories, while Cloudoak is in its private alpha.

Quick start

@cloudoak/sdk (Apache-2.0) is developed in cloudoakhq/cloudoak-sdk. It is not on npm yet: download cloudoak-sdk-2.0.0.tgz from the SDK’s release and install that file.

Terminal window
npm install ./cloudoak-sdk-2.0.0.tgz

The user types their node’s address into your app (the gear) and signs in on that node’s own page. Pass credentials at runtime, never in your code: the SDK talks only to the node address the user typed.

import { CloudoakClient, tables } from '@cloudoak/sdk';
// The user points the app at their own node with the gear UI. The
// redirect address must be listed in the manifest's auth.redirect_uris.
const client = await CloudoakClient.connect({
nodeUrl: 'https://cloud.example.com', appId: 'com.example.notes', appVersion: '1.0.0',
redirectUri: window.location.origin + '/',
});
// Sign-in happens on the node's own page: the app never sees the
// password. On load, finish a sign-in the node just sent back;
// otherwise send the user there.
if (!(await client.completeSignIn())) {
await client.signIn();
}
const notes = await tables(client, 'notes').list();
console.log(notes.rows);

A small app with the gear sign-in and its packaging. It holds no session and no token.

Terminal window
sha256sum -c cloudoak-starter.zip.sha256

Next: from zero to an app on a node takes the starter from an empty folder to published and installed, and the SDK guide explains sign-in, data and sync.

Built from spec 2.1.0, SDK 2.0.0 and the node's guide at v0.6.0-alpha.1.