JSPM

  • Created
  • Published
  • Downloads 299
  • Score
    100M100P100Q95616F
  • License SEE LICENSE IN LICENSE

Client.js is a library for implementing BIM Project management applications.

Package Exports

  • @inweb/client
  • @inweb/client/dist/client.js
  • @inweb/client/dist/client.module.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@inweb/client) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Client.js

Client.js is a JavaScript library for implementing cross-browser BIM Project management applications. Client.js provides the following benefits:

  • easy access to the server resources like Projects, Files, Issues etc
  • integration of the VisualizeJS library with the Open Cloud Server
  • convenient API to open BIM files from the server for rendering and data management
  • optimizations and improvements of the quality of rendering BIM files

Table of contents

Installation

Install via npm

Open a terminal in your project folder and run:

npm install open-cloud-cllient

The Client.js package will be downloaded and installed. Then you're ready to import it in your code, see example below.

CDN or static hosting

Declare your script, and then use ODA object as shown below.

<script src="https://opencloud.azureedge.net/libs/clientjs/24.12/client.min.js"></script>

<script>
  const client = new ODA.Client();

  // place your code here (see example below)
</script>

Example

Download and render a drawing file from the Open Cloud Server:

// create instance of the Client class for working with server
const client = new ODA.Client({ serverUrl: "https://cloud.opendesign.com/api" });

// create instance of Viewer class for rendering drawing files
const viewer = new ODA.Viewer(client);

// initialize Viewer it with the specified <canvas> element
await viewer.initialize(canvas);

// login to the server
await client.signInWithEmail("email", "password");

// get file list from the server
const files = await client.getFiles();

// open the first file in the list
await viewer.open(files.result[0]);

To learn more, see First application guide.

Code and documentation copyright 2002-2023 the Open Design Alliance. Code is distributed under a proprietary license, see LICENSE for more information.