{"library":"node-iterable-api","title":"Iterable API Client for Node.js","description":"node-iterable-api is a Node.js client library that provides a wrapper around the Iterable API, enabling developers to programmatically interact with various Iterable services such as managing user lists, tracking events, updating user profiles, triggering campaigns, and handling commerce data. The current stable version is 1.2.0. The package has seen irregular updates, including recent dependency and security fixes in v1.0.3, indicating active maintenance rather than a strict release cadence. A key differentiator is its direct mapping to the Iterable API documentation, though it's explicitly noted that not all Iterable API resources are fully implemented, requiring developers to check `lib/api.js` for current support. This library is primarily designed for CommonJS environments.","language":"javascript","status":"active","last_verified":"Sun Apr 19","install":{"commands":["npm install node-iterable-api"],"cli":null},"imports":["const client = require('node-iterable-api').create('<api-key>')","const IterableClient = require('node-iterable-api')"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"const client = require('node-iterable-api').create(process.env.ITERABLE_API_KEY ?? '');\n\nasync function getIterableLists() {\n  if (!process.env.ITERABLE_API_KEY) {\n    console.warn('ITERABLE_API_KEY environment variable is not set. Using a dummy key. Operations will likely fail.');\n  }\n\n  try {\n    // Retrieve all lists available in your Iterable account\n    const response = await client.lists.get();\n    console.log('Successfully retrieved Iterable lists:', response.lists);\n\n    // Example: Create a new user (replace with actual user data)\n    const userUpdateResponse = await client.users.update({\n      email: 'test@example.com',\n      dataFields: {\n        firstName: 'Test',\n        lastName: 'User',\n        registrationDate: new Date().toISOString()\n      }\n    });\n    console.log('User update response:', userUpdateResponse);\n\n  } catch (err) {\n    console.error('An error occurred:', err.message || err);\n    if (err.body) {\n      console.error('Error details:', err.body);\n    }\n  }\n}\n\ngetIterableLists();","lang":"javascript","description":"Initializes the Iterable API client and demonstrates fetching lists and updating a user profile.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}