Quick start
1. Install the SDK
Section titled “1. Install the SDK”@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.
npm install ./cloudoak-sdk-2.0.0.tgz2. Connect with the gear flow
Section titled “2. Connect with the gear flow”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);3. Download the starter
Section titled “3. Download the starter”A small app with the gear sign-in and its packaging. It holds no session and no token.
sha256sum -c cloudoak-starter.zip.sha256Next: 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.