The SkyCiv NPM Package

This package provides helpful tools to create objects and interact with the SkyCiv API. These components can be used to quickly construct models by providing code completion, parameter information and examples.

The SkyCiv API documentation can be found here:

The SkyCiv NPM package documentation can be found here:


npm i skyciv


The recommend use of the package is by using the Model() and ApiObject() classes.

const skyciv = require('skyciv');

// Create a SkyCiv Model object
const model = new skyciv.Model('metric');
model.nodes.add(0, 0, 0);
model.nodes.add(5, 0, 0);
model.members.add(1, 2, 1);
model.sections.addLibrarySection(['Australian', 'Steel (300 Grade)', 'Universal beams', '200 UB 18.2'], 1);
// or: model.sections.addLibrarySection(skyciv.sections.Australian_Steel_300_Grade_Universal_beams_200_UB_18_2, 1);
model.materials.add('Structural Steel');
// or: model.materials.addCustom('Custom Steel', 7850, 210000, 0.29, 300, 440, 'steel');
model.supports.add(1, 'FFFFFR');
model.supports.add(2, 'FFFFFR');
model.point_loads.add('m', null, 1, 30, 0, -5);

// Create an API Object
const ao = new skyciv.ApiObject();

// Set auth
ao.auth.username = 'YOUR_SKYCIV_USERNAME';
ao.auth.key = 'YOUR_SKYCIV_API_KEY';

// Set functions
ao.functions.add('S3D.session.start', { keep_open: true });
ao.functions.add('S3D.model.set', { s3d_model: model });
ao.functions.add('S3D.model.solve', { analysis_type: 'linear' });
ao.functions.add('', { name: 'package-demo', path: 'api/NPM/' });

// Your function to handle the response
const callback = (res) => {

// Send the object to the API

Sections Database

Section library paths for all sections can be found in the skyciv.sections object.

For example:

const path = skyciv.sections.Australian_Steel_300_Grade_Universal_beams_200_UB_18_2;

// path is now equal to:
["Australian", "Steel (300 Grade)", "Universal beams", "200 UB 18.2"]

This way, auto-completion helps to avoid looking up section paths manually.

Global Methods

skyciv.request(apiObject, callback?, options?)

Note: We recommend using the .request method of the ApiObject class rather than this function as seen in the above sample.

Make a request to the SkyCiv API. The callback function receives the parsed response.

const skyciv = require('skyciv');

const apiObject = {...}; // A custom built object
// or
const apiObject = new skyciv.ApiObject();

skyciv.request(apiObject, function(res) {
    // Do something with results object "res"
}, options);

skyciv.requestPromise(apiObject, options?)

Make a request to the SkyCiv API and receive a pending promise.

const skyciv = require('skyciv');
async function main() {
    const apiObject = {...}; // A custom built object
    // or
    const apiObject = new skyciv.ApiObject();

    // then
    const skycivResponse = await skyciv.requestPromise(apiObject);
    // Do something with the response


Manually building the API Object

Visit the API docs for instructions on how to create an instance of the SkyCiv API object.


Version Breaking Description
1.2.1 Breaks skyciv.section keys. • Typos.
• Improved in-code docs.
• Removed special characters from keys in skyciv.sections.
• Added requestPromise() method to the ApiObject class.
• The request() and requestPromise() method of the ApiObject() will now automatically store the last_session_id to the auth.session_id property of the ApiObject instance.
• Added SelfWeight.enable() and SelfWeight.disable() methods.
• Made all add() methods return the ID of the new element.
1.2.0 false • Added 37 new classes including the ApiObject() and Model() classes.
1.1.1 false • patch.
1.1.0 true (for nodejs) skyciv.request() now returns parsed JSON for node.js
• Added skyciv.requestPromise()
1.0.1 true • Changed skyciv.skyciv.request() to skyciv.request().
1.0.0 - Initial release.