npm.io
2.7.1-alpha.8 • Published 1 month ago

@ordinlabs/wsm-api-client

Licence
LGPL-3.0-only
Version
2.7.1-alpha.8
Deps
2
Size
1.3 MB
Vulns
0
Weekly
0

Workspace Manager Client SDK

The Workspace Manager Typescript Client SDK provides a mechanism for scripting actions the Workspace Manager admin application.

Getting an API Key

  1. Log in to the admin application.
  2. Click on your username in the top right corner and click the Profile link.
  3. Click on the Profile tab.
  4. Click the Generate new access key button.
  5. Provide a description of the key and an expiration date.
  6. Click the Generate button.
  7. Copy the key and store it in a safe place. Note: there is no way to view the key after this dialog is dismissed.

Using the SDK

import { newRpcClient } from '@ordinlabs/wsm-api-client';

async function go() {
  const rpcClient = newRpcClient({
    baseUrl: 'https://www.example.com',
    apiKey: 'the-api-key',
  });
  
  await rpcClient.startWorkspace({workspaceId: '12345'});
}

go().catch(e => console.error(e));