Registry / crm-productivity / smartsheet

smartsheet

JSON →
library4.7.2jsnpmunverified

The Smartsheet JavaScript SDK, currently at version 4.7.2, provides an official client library for interacting with the Smartsheet API from Node.js applications. It ships with comprehensive TypeScript types, facilitating development in type-safe environments. The SDK maintains an active and consistent release cadence, frequently introducing minor versions with new features, API endpoint support, and critical bug fixes, as evidenced by recent updates adding new sharing, workspace, and folder endpoints, alongside improvements to retry mechanisms and pagination. It differentiates itself as the directly supported client, offering extensive coverage of the Smartsheet API's functionalities. Developers can initialize the client using an access token obtained from the Smartsheet UI and leverage promise-based methods for operations such as listing and loading sheets, managing users, and handling attachments. The SDK requires actively supported Node.js versions 14.x or later for optimal compatibility and robust operation.

npm install smartsheet
INSTALL
IMPORT
SIG · SMARTSHEET
S
smartsheet
crm-productivityjavascriptv4.7.2
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

createClient
import { createClient } from 'smartsheet';
import smartsheet from 'smartsheet'; const client = smartsheet.createClient(...);
For modern ESM usage, `createClient` is a named export. The SDK's README still shows a CommonJS `require` pattern for the full module object.
createClient (CommonJS)
const { createClient } = require('smartsheet');
const smartsheet = require('smartsheet'); const client = smartsheet.createClient(...);
While the README uses the older `const client = require('smartsheet'); const smartsheet = client.createClient(...)` pattern, destructuring is generally preferred in CommonJS for clarity.
SmartsheetClient (Type)
import type { SmartsheetClient } from 'smartsheet';
import { SmartsheetClient } from 'smartsheet';
When importing types in TypeScript, it's best practice to use `import type` to ensure they are stripped during compilation.

This quickstart demonstrates how to initialize the Smartsheet client, list all available sheets, and then load the details of the first sheet found using asynchronous `await` syntax.

import { createClient } from 'smartsheet'; const accessToken = process.env.SMARTSHEET_ACCESS_TOKEN ?? ''; // Load from environment variable for security if (!accessToken) { console.error('Error: SMARTSHEET_ACCESS_TOKEN environment variable is not set.'); process.exit(1); } // Initialize the client const smartsheet = createClient({ accessToken: accessToken, logLevel: 'info' // Can be 'info', 'warn', 'error', 'debug' }); // Set queryParameters for `include` and pagination const options = { queryParameters: { include: 'attachments', includeAll: true } }; async function listAndLoadSheets() { try { // List all sheets const result = await smartsheet.sheets.listSheets(options); if (result.data && result.data.length > 0) { const sheetId = result.data[0].id; // Choose the first sheet // Load one sheet const sheetInfo = await smartsheet.sheets.getSheet({ sheetId: sheetId }); console.log('Successfully loaded sheet:', sheetInfo.name, 'with ID:', sheetInfo.id); // console.log(JSON.stringify(sheetInfo, null, 2)); // Uncomment to see full sheet data } else { console.log('No sheets found in your Smartsheet account.'); } } catch (error) { console.error('An error occurred:', error); } } listAndLoadSheets();
Debug
Known issues
breakingOlder sharing endpoints were deprecated in favor of new ones. Existing code using the deprecated endpoints may eventually break or behave unexpectedly.
fix
Migrate your code to use the newly introduced sharing endpoints. Refer to the Smartsheet API documentation for the updated methods.
affects: >=4.7.0
breakingThe `getWorkspace()` and `getFolder()` methods were deprecated. Developers must now use `getWorkspaceMetadata()` paired with `getWorkspaceChildren()` (and similarly for folders) to retrieve equivalent data.
fix
Replace calls to `getWorkspace()` with `smartsheet.workspaces.getWorkspaceMetadata(id)` and `smartsheet.workspaces.getWorkspaceChildren(id)`. Apply similar changes for folder methods.
affects: >=4.4.0
gotchaVersions prior to 4.2.3 had a bug where the request body was not correctly resent during retries for POST/PUT methods, potentially leading to data loss or incorrect state on intermittent network failures.
fix
Upgrade to version 4.2.3 or later to ensure correct retry behavior for all HTTP methods.
affects: <4.2.3
gotchaThe Smartsheet SDK requires Node.js version 14.x or later. Using older, unsupported Node.js versions may lead to unexpected errors, security vulnerabilities, or installation failures.
fix
Ensure your Node.js environment is actively supported (v14.x or later). Update Node.js to a compatible version.
affects: <any
Errors
Common errors & fixes
Error: SMARTSHEET_ACCESS_TOKEN environment variable is not set.
The Smartsheet client was initialized without an access token, or the token was invalid.
fix
Provide a valid Smartsheet API access token, ideally through an environment variable like `SMARTSHEET_ACCESS_TOKEN`, or directly in the `createClient` call (not recommended for production).
TypeError: smartsheet.sheets.getWorkspace is not a function
Attempting to call a deprecated method (`getWorkspace` or `getFolder`) that has been removed or replaced in newer SDK versions.
fix
Update your code to use the new methods introduced in v4.4.0: `getWorkspaceMetadata()` and `getWorkspaceChildren()` for workspaces, and `getFolderMetadata()` and `getFolderChildren()` for folders.
ERR_MODULE_NOT_FOUND: Cannot find module 'smartsheet'
Incorrect module import path or attempting a CommonJS `require` in an ESM module without proper configuration (or vice versa).
fix
Ensure `npm install smartsheet` has been run. For ESM, use `import { createClient } from 'smartsheet';`. For CommonJS, use `const { createClient } = require('smartsheet');`. Check your `package.json` `type` field if encountering issues in mixed environments.
Upgrade
Version history
4.7.2latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
40 hits · last 30 days
node
36
OpenAI (training)
1
Resources
smartsheet — npm install smartsheet · libregistry