A lightweight Node.js wrapper for NetSuite's SuiteTalk REST Web Services, currently at version 1.1.0. It provides a simple interface to make signed HTTP requests using Token-Based Authentication (TBA), supporting CRUD operations on records, SuiteQL queries, and HATEOAS navigation. Unlike the official NetSuite SDK, this package is a thin client that wraps the REST API directly, making it lightweight and easy to use. It has a monthly release cadence and is maintained on GitHub. Key differentiators include built-in request signing, promise-based async API, and optional custom base URL.
npm install netsuite-restNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Initializes the wrapper with TBA credentials from environment variables, then makes a GET request to list customers.
Ensure environment variables are set or pass them directly. The realm is your NetSuite account ID (e.g., '1234567').
Use paths like 'record/v1/customer/' (no leading slash).
Always add a .catch() handler or use try/catch with async/await.
If you rely on base_url, test after upgrading to 1.1.x; the default is https://{{realm}}.suitetalk.api.netsuite.com.Pass all credential parameters: consumer_key, consumer_secret_key, token, token_secret, realm.
Use: const api = new NsApiWrapper({...}); api.request({...});Verify consumer_key, consumer_secret, token, token_secret, and realm (NetSuite account ID). Check that TBA is enabled in NetSuite.
In .catch(), check the error object structure. Use console.error(err) to inspect. Ensure you handle errors properly.
Check the request path and credentials. Log the full error response to see the HTML content.