Registry / storage / elasticio-rest-node

elasticio-rest-node

JSON →
library2.0.0jsnpmunverified

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.

npm install elasticio-rest-node
INSTALL
IMPORT
SIG · ELASTICIO-REST-NOD
E
elasticio-rest-node
storagejavascriptv2.0.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
✓ const client = require('elasticio-rest-node')('YOUR_EMAIL', 'YOUR_API_KEY');
✗ import client from 'elasticio-rest-node';
Package does not ship ESM; use CommonJS require. The function returns an API client instance.
client.users.me
✓ const client = require('elasticio-rest-node')(email, key); client.users.me().then(console.log);
✗ client.users.me(function(user) { ... });
Methods return Promises; callbacks are not supported.
client.repos.retrieve
✓ const client = require('elasticio-rest-node')(email, key); client.repos.retrieve('id').then(repo => {});
✗ client.repos.retrieve('id', callback);
Retrieve methods are async and return promises.

Initialize client with email and API key, then fetch the current user's details.

const client = require('elasticio-rest-node')('YOUR_EMAIL', 'YOUR_API_KEY'); client.users.me() .then((user) => { console.log('Authenticated user:', user); }) .catch((err) => { console.error('Authentication failed:', err); });
Debug
Known issues
breakingVersion 2.0.0 dropped support for Node <12.13.0. If using older Node versions, stay on 1.x.
fix
Upgrade Node to >=12.13.0 or pin elasticio-rest-node to version 1.x.
affects: >=2.0.0
deprecatedThe 'api-key' authentication scheme is deprecated in favor of OAuth2 tokens for new projects.
fix
Consider migrating to OAuth2 authentication using the Elastic.io web UI.
affects: >=2.0.0
gotchaAll API methods return Promises; using them synchronously (e.g., with await outside async function) will cause unhandled rejections.
fix
Wrap calls in async functions or use .catch() to handle errors.
affects: >=1.0.0
gotchaThe constructor expects exactly two arguments (email, API key). Passing no arguments or extra arguments may throw without clear error.
fix
Always call client = require('elasticio-rest-node')(email, key);.
affects: >=1.0.0
Errors
Common errors & fixes
Cannot find module 'elasticio-rest-node'
Package not installed or missing from node_modules.
fix
Run 'npm install elasticio-rest-node' (yes, the package name has a hyphen).
TypeError: require(...) is not a function
Using the module incorrectly as a constructor without arguments, or double-wrapping.
fix
Use const client = require('elasticio-rest-node')(email, key); not require('elasticio-rest-node').Client(...).
Unauthorized: Invalid API key
Incorrect email or API key, or key has been rotated.
fix
Verify your credentials in the Elastic.io dashboard. If using an API key, ensure it's still valid.
ReferenceError: client is not defined
Attempting to use client.users.me() without first assigning the return of require('...')().
fix
Assign the result: const client = require('elasticio-rest-node')(email, key);
Upgrade
Version history
2.0.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
24 hits · last 30 days
node
22
Resources
elasticio-rest-node — npm install elasticio-rest-node · libregistry