{"library":"mg-api-node","title":"MyGeotab Node.js API Client","description":"This package, `mg-api-node`, functions as an unofficial Node.js client for programmatically interacting with the MyGeotab API. It offers capabilities for authentication, executing API calls (such as `Get`, `call`, and `multicall`), and managing request timeouts and session IDs to optimize repeated interactions. The latest stable version is 1.3.1. Its release cadence has been infrequent, with the most recent feature addition (request timeout functionality) in v1.3.0. While it once served as a direct Node.js interface for MyGeotab, this project is now officially deprecated. Users are strongly advised to transition to the `mg-api-js` package for ongoing support, new feature development, and improved maintainability.","language":"javascript","status":"deprecated","last_verified":"Tue Apr 21","install":{"commands":["npm install mg-api-node"],"cli":null},"imports":["const API = require('mg-api-node');","const api = new API(userName, password, database);"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"const API = require('mg-api-node');\n\nconst userName = process.env.GEOTAB_USERNAME ?? 'YOUR_USERNAME';\nconst password = process.env.GEOTAB_PASSWORD ?? 'YOUR_PASSWORD';\nconst database = process.env.GEOTAB_DATABASE ?? 'YOUR_DATABASE'; // e.g., 'geotab-live'\n\nconst api = new API(userName, password, database);\n\napi.authenticate(function(err, data) {\n  if (err) {\n    console.error('Authentication Error:', err);\n    return;\n  }\n\n  console.log('Authenticated successfully. User:', data.userName);\n\n  api.call('Get', {\n    typeName: 'User',\n    search: {\n      name: data.userName\n    }\n  }, function(err, userData) {\n    if (err) {\n      console.error('API Call Error:', err);\n      return;\n    }\n    console.log('User Data:', userData);\n  });\n});","lang":"javascript","description":"Demonstrates basic authentication and a 'Get' API call to fetch user data using callback patterns.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}