{"id":47473,"library":"elasticio-rest-node","title":"Elastic.io REST Node Client","description":"Official Node.js client library for the Elastic.io REST API. Version 2.0.0 supports Node >=12.13.0. Provides convenient methods for managing repos, users, contracts, workspaces, and other Elastic.io resources. While the package is actively maintained, its usage is specific to the Elastic.io platform and not a general-purpose REST client. The API is promise-based and requires authentication via email and API key.","status":"active","version":"2.0.0","language":"javascript","source_language":"en","source_url":null,"tags":["javascript"],"install":[{"cmd":"npm install elasticio-rest-node","lang":"bash","label":"npm"},{"cmd":"yarn add elasticio-rest-node","lang":"bash","label":"yarn"},{"cmd":"pnpm add elasticio-rest-node","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"Package does not ship ESM; use CommonJS require. The function returns an API client instance.","wrong":"import client from 'elasticio-rest-node';","symbol":"default","correct":"const client = require('elasticio-rest-node')('YOUR_EMAIL', 'YOUR_API_KEY');"},{"note":"Methods return Promises; callbacks are not supported.","wrong":"client.users.me(function(user) { ... });","symbol":"client.users.me","correct":"const client = require('elasticio-rest-node')(email, key); client.users.me().then(console.log);"},{"note":"Retrieve methods are async and return promises.","wrong":"client.repos.retrieve('id', callback);","symbol":"client.repos.retrieve","correct":"const client = require('elasticio-rest-node')(email, key); client.repos.retrieve('id').then(repo => {});"}],"quickstart":{"code":"const client = require('elasticio-rest-node')('YOUR_EMAIL', 'YOUR_API_KEY');\n\nclient.users.me()\n  .then((user) => {\n    console.log('Authenticated user:', user);\n  })\n  .catch((err) => {\n    console.error('Authentication failed:', err);\n  });","lang":"javascript","description":"Initialize client with email and API key, then fetch the current user's details."},"warnings":[{"fix":"Upgrade Node to >=12.13.0 or pin elasticio-rest-node to version 1.x.","message":"Version 2.0.0 dropped support for Node <12.13.0. If using older Node versions, stay on 1.x.","severity":"breaking","affected_versions":">=2.0.0"},{"fix":"Consider migrating to OAuth2 authentication using the Elastic.io web UI.","message":"The 'api-key' authentication scheme is deprecated in favor of OAuth2 tokens for new projects.","severity":"deprecated","affected_versions":">=2.0.0"},{"fix":"Wrap calls in async functions or use .catch() to handle errors.","message":"All API methods return Promises; using them synchronously (e.g., with await outside async function) will cause unhandled rejections.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Always call client = require('elasticio-rest-node')(email, key);.","message":"The constructor expects exactly two arguments (email, API key). Passing no arguments or extra arguments may throw without clear error.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"search_vec":"'12.13.0':18 '2.0.0':15 'activ':36 'api':13,55,66 'authent':62 'base':59 'client':4,7,53 'contract':26 'conveni':20 'elastic.io':1,11,30,44 'email':64 'general':50 'general-purpos':49 'javascript':68 'key':67 'librari':8 'maintain':37 'manag':23 'method':21 'node':3,17 'node.js':6 'offici':5 'packag':34 'platform':45 'promis':58 'promise-bas':57 'provid':19 'purpos':51 'repo':24 'requir':61 'resourc':31 'rest':2,12,52 'specif':41 'support':16 'usag':39 'user':25 'version':14 'via':63 'workspac':27","created_at":"2026-06-07T16:51:41.869232+00:00","updated_at":"2026-06-07T16:51:41.869232+00:00","problems":[{"fix":"Run 'npm install elasticio-rest-node' (yes, the package name has a hyphen).","cause":"Package not installed or missing from node_modules.","error":"Cannot find module 'elasticio-rest-node'"},{"fix":"Use const client = require('elasticio-rest-node')(email, key); not require('elasticio-rest-node').Client(...).","cause":"Using the module incorrectly as a constructor without arguments, or double-wrapping.","error":"TypeError: require(...) is not a function"},{"fix":"Verify your credentials in the Elastic.io dashboard. If using an API key, ensure it's still valid.","cause":"Incorrect email or API key, or key has been rotated.","error":"Unauthorized: Invalid API key"},{"fix":"Assign the result: const client = require('elasticio-rest-node')(email, key);","cause":"Attempting to use client.users.me() without first assigning the return of require('...')().","error":"ReferenceError: client is not defined"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":null,"github":null,"docs":null,"changelog":null,"pypi":null,"npm":"elasticio-rest-node","openapi_spec":null,"status_page":null,"smithery":null,"categories":["storage"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-07","next_check":"2026-09-05","install_tag":null}}