Infohub JS API
Loading...
Searching...
No Matches
COLNEO infohub JavaScript API

Introduction

The infohub JavaScript API is the client SDK for applications that work with COLNEO infohub and its related services. It provides domain objects, service clients, model-viewer adapters, BCF 3.0 access, portal helpers, and reusable utilities through one ES module package.

Most infohub operations share a Context. The context holds the current user and access token, service endpoints, scope, project, and optional coordination model. Pass the configured context to service classes so that requests use the same identity and project selection throughout an application.

Note
Access to the private package and to COLNEO services requires an account provided by COLNEO. Never embed access tokens or registry credentials in source code.

API overview

The main package entry point exports the following API areas. Select a category to browse its classes and members.

The service classes are the usual starting point for application code. Domain classes represent returned infohub data, while adapter classes provide a common interface for supported model viewers.

Installation

The package is published in the private COLNEO npm registry. Authenticate with the registry, then install the package in the application directory:

npm login --registry=https://registry.colneo.digital/
npm install @colneo/infohub-js-api

The package uses ES modules. Public classes can be imported from its main entry point:

import {
} from '@colneo/infohub-js-api';
Provides direct access to the COLNEO BCF 3.0 API.
Definition BcfServices.js:1079
Maintains the shared connection and selection state for COLNEO infohub services.
Definition Context.js:52
Definition ProjectServices.js:19

Getting started

Create one context, configure the service URLs supplied by the host application, and attach the authenticated user and current project. The same context can then be shared by all service clients.

import { BcfServices, Context } from '@colneo/infohub-js-api';
const context = new Context();
context.setServiceUrls({
hub: 'https://infohub.example/hub',
bcf: 'https://infohub.example/bcf'
});
context.setUserAndToken('user@example.com', '<access-token>');
context.setScopeAndProjectShortId('<scope>', '<project-short-id>');
const bcf = new BcfServices(context);
const response = await bcf.projects.list();
if (response.status < 300) {
console.log(response.data);
} else {
console.error(response.message);
}

Service operations commonly return a Promise that resolves to an ApiResponse. Inspect its status before using data; additional diagnostic information may be available in message. Consult each method for its parameters, response payload, and error behavior.

Where to go next

  • Start with Context when connecting an application to infohub.
  • Use ProjectServices and the other infohub service classes for project and user-management data.
  • Use IModelViewer when application logic must work across supported model viewers.
  • Use BcfServices for Building Collaboration Format workflows.
  • Use the category and class indexes to explore the complete source API.