{"library":"netsuite-api-client","title":"NetSuite API Client","description":"The `netsuite-api-client` package provides a robust interface for interacting with NetSuite's SuiteTalk Web Services, specifically focusing on REST calls and SuiteQL queries. It is currently at stable version `1.0.3` and demonstrates an active release cadence with frequent patch updates addressing dependencies and minor fixes. This library distinguishes itself as a direct fork and merge of the formerly popular `netsuite-rest` and `suiteql` packages, specifically designed to address their limitations. Key differentiators include its ESM-only nature, comprehensive TypeScript typings, and the integration of updated dependencies like `got` to mitigate recent CVEs. It is explicitly maintained and supported, offering a more modern and secure alternative for NetSuite integrations. The package supports promise-based operations for standard REST `request` calls and `query` executions, along with a `queryAll` streaming mechanism for efficiently handling large datasets, which is crucial for enterprise-level data operations. Error handling has also been significantly improved to directly surface NetSuite-specific messages.","language":"javascript","status":"active","last_verified":"Tue Apr 21","install":{"commands":["npm install netsuite-api-client"],"cli":null},"imports":["import { NetsuiteApiClient } from 'netsuite-api-client';"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import { NetsuiteApiClient } from 'netsuite-api-client';\n\nasync function runNetsuiteOperations() {\n  const client = new NetsuiteApiClient({\n    consumer_key: process.env.NETSUITE_CONSUMER_KEY ?? '',\n    consumer_secret_key: process.env.NETSUITE_CONSUMER_SECRET_KEY ?? '',\n    token: process.env.NETSUITE_TOKEN ?? '',\n    token_secret: process.env.NETSUITE_TOKEN_SECRET ?? '',\n    realm: process.env.NETSUITE_REALM ?? '',\n    base_url: process.env.NETSUITE_BASE_URL ?? ''\n  });\n\n  try {\n    // Perform a GET request to fetch customer records\n    const response = await client.request({\n      path: 'record/v1/customer/',\n      method: 'GET'\n    });\n    console.log('Customer data:', response.data.links);\n\n    // Perform a SuiteQL query\n    const transactions = await client.query(\"select id from transaction where rownum <= 5\");\n    console.log('Transactions:', transactions);\n\n  } catch (err) {\n    console.error('Netsuite API Error:', err.message);\n  }\n}\n\nrunNetsuiteOperations();","lang":"typescript","description":"Instantiates the NetSuite API client using token-based authentication and performs a basic GET request for customer data, followed by a SuiteQL query.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}