Setup your development environment

The @gospace-ai/api package is a Node.js SDK for interacting with gospace’s Workplace and Spatial APIs.

Install the SDK

Set Up a Node.js Project

Create a new directory and initialise a Node.js project:

mkdir gospace-project
cd gospace-project
npm init -y

Install@gospace-ai/api

Install the SDK via npm:

npm install @gospace-ai/api

Note: If @gospace-ai/api is not available on npm, check developer.gospace.com for the correct package name or installation instructions.

Install dotenv

To manage environment variables securely:

npm install dotenv

Configure API Key

Create a .env file in your project root:env

GOSPACE_API_KEY=prod_abc123

Alternatively, set the environment variable:bash

export GOSPACE_API_KEY='prod_abc123'

On Windows (PowerShell)

$env:GOSPACE_API_KEY='prod_abc123'

Verify Installation

Create a test script to confirm the SDK is installed:

// test.js
const gospace = require('@gospace-ai/api');
require('dotenv').config();
const client = new gospace({ api_key: process.env.GOSPACE_API_KEY });
console.log(client);

Run the script:

node test.js

You should see the SDK’s client object printed.

Last updated

Was this helpful?