JSPM

  • Created
  • Published
  • Downloads 29083
  • Score
    100M100P100Q178857F
  • License Apache-2.0

Smartsheet JavaScript client SDK

Package Exports

  • smartsheet
  • smartsheet/dist/index.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 (smartsheet) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Smartsheet SDK for JavaScript

Build Status Coverage Status npm version

This is a client SDK for connecting to the Smartsheet API from Node.js applications.

System Requirements

The SDK is compatible with actively supported Node.js versions 14.x or later.

Installation

To install this SDK run the following command in a terminal window:

npm install smartsheet

Example Usage

To call the API you must have an access token. You can generate an access token in Smartsheet UI under Account > Personal Settings > API Access.

The following is a brief sample using promises that shows you how to:

  • Initialize the client
  • List all sheets
  • Load one sheet
// Initialize the client
var client = require('smartsheet');
var smartsheet = client.createClient({
  accessToken: '<access_token>', // Replace <access_token> with your API token
  logLevel: 'info'
});

// The `smartsheet` variable now contains access to all of the APIs

// Set queryParameters for `include` and pagination
var options = {
  queryParameters: {
    include: "attachments",
    includeAll: true
  }
};

// List all sheets
smartsheet.sheets.listSheets(options)
  .then(function (result) {
    var sheetId = result.data[0].id;  // Choose the first sheet

    // Load one sheet
    smartsheet.sheets.getSheet({id: sheetId})
      .then(function(sheetInfo) {
        console.log(sheetInfo);
      })
      .catch(function(error) {
        console.log(error);
      });
  })
  .catch(function(error) {
    console.log(error);
  });

See the node-read-write-sheet project for a code example that shows how to call methods to read and write to a sheet using this SDK.

Documentation

  • The Smartsheet API documentation with corresponding SDK example code can be found here.
  • For an example of using the Javascript SDK see the sample project here.

Advanced Topics

For details about more advanced features, see Advanced Topics.

Developer Agreement

Review the Developer Program Agreement.

Acknowledgements

We would like to thank the following people for their contributions to this project: