Skip to main content

Workspace Operations

A Hexabase workspace can hold multiple projects. After authenticating, set the workspace to be processed.

Get all workspaces

Gets the workspace owned and belonging to the authenticated user.

const workspaces = await client.workspaces();

Get a specific workspace

Get a specific workspace by specifying the workspace ID.

const workspace = await client.workspace('WORKSPACE_ID');

Get all workspaces and current workspace

Get all the workspaces you own or belong to and the workspaces currently being processed.

const {
workspaces, // All workspaces
workspace, // Workspace currently being processed
} = await client.workspacesWithCurrent();

Workspace settings

Set up the workspace where you are going to do the processing.

// To specify a workspace ID 
await client.setWorkspace('WORKSPACE_ID');

// To specify a workspace object
const workspace = await client.workspace('ANOTHER_WORKSPACE_ID');
await client.setWorkspace(workspace);

Get the workspace current being processed

Gets the workspace that is currently being processed.

client.currentWorkspace;

Invite other users to your workspace

Invite other users to join the workspace. Invited users can join the workspace after confirming the email.

const workspace = await client.workspace('WORKSPACE_ID');
// Invitation to workspace
workspace.invite(
['[email protected]'], // Email address of the user to invite
'hexabase' // Domain
);

Create a new workspace

Use the save method to create a new workspace.

const workspace = await client.workspace();
workspace.set('name', 'My Workspace');
await workspace.save();

Workspace updates are not supported as of November 2023.

Update workspace contents

Use the fetch method to update the contents of the workspace.

await workspace.fetch();

Archive workspace

Archives a workspace. Archived workspaces can be restored from the administration panel.

await workspace.archive();

Get password policy

Get the workspace password policy.

const policy = await workspace.getPasswordPolicy();

Get features available in a workspace

Get the features available in a workspace.

const features = await workspace.getFunctionality();

Get workspace usage status

Get workspace usage status.

const usage = await workspace.getUsage();

Get groups under workspace

Get the groups under the workspace.

const group = await workspace.group('GROUP_ID');

Get a list of projects under the workspace

Get a list of projects under the workspace.

const projects = await workspace.projects();

Get a specific project under the workspace

const project = await workspace.project('PROJECT_ID');

Get all projects and datastores under the workspace

Get all projects and datastores under the workspace.

const projects = await workspace.projectsAndDatastores();

Get the project template under the workspace

Get the project template under the workspace.

const templates = await workspace.projectTemplates();