{"library":"smartsheet","title":"Smartsheet JavaScript SDK","description":"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.","language":"javascript","status":"active","last_verified":"Sun Apr 19","install":{"commands":["npm install smartsheet"],"cli":null},"imports":["import { createClient } from 'smartsheet';","const { createClient } = require('smartsheet');","import type { SmartsheetClient } from 'smartsheet';"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import { createClient } from 'smartsheet';\n\nconst accessToken = process.env.SMARTSHEET_ACCESS_TOKEN ?? ''; // Load from environment variable for security\n\nif (!accessToken) {\n  console.error('Error: SMARTSHEET_ACCESS_TOKEN environment variable is not set.');\n  process.exit(1);\n}\n\n// Initialize the client\nconst smartsheet = createClient({\n  accessToken: accessToken,\n  logLevel: 'info' // Can be 'info', 'warn', 'error', 'debug'\n});\n\n// Set queryParameters for `include` and pagination\nconst options = {\n  queryParameters: {\n    include: 'attachments',\n    includeAll: true\n  }\n};\n\nasync function listAndLoadSheets() {\n  try {\n    // List all sheets\n    const result = await smartsheet.sheets.listSheets(options);\n    if (result.data && result.data.length > 0) {\n      const sheetId = result.data[0].id; // Choose the first sheet\n\n      // Load one sheet\n      const sheetInfo = await smartsheet.sheets.getSheet({ sheetId: sheetId });\n      console.log('Successfully loaded sheet:', sheetInfo.name, 'with ID:', sheetInfo.id);\n      // console.log(JSON.stringify(sheetInfo, null, 2)); // Uncomment to see full sheet data\n    } else {\n      console.log('No sheets found in your Smartsheet account.');\n    }\n  } catch (error) {\n    console.error('An error occurred:', error);\n  }\n}\n\nlistAndLoadSheets();","lang":"typescript","description":"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.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}