Exciting release!Introducing "safe npm". Learn more
Socket
Log inDemoInstall

eh-api-client

Package Overview
Dependencies
4
Maintainers
2
Versions
93
Issues
File Explorer

Advanced tools

eh-api-client

Node.js rest client

    0.49.0latest
    GitHub

Version published
Maintainers
2
Weekly downloads
671
decreased by-18.27%

Weekly downloads

Readme

Source

Require

var ClientFactory = require("eh-api-client"); var factory = new ClientFactory("http://someservice.com/v1"); // initialize new factory with root API url

Getting client for user

var client = factory.getClient(50, "web"); // get client for userId = 50 and app = "web"

Getting client for guest user

var client = factory.getClient(0, "web"); // you can pass 0/null/undefined/"" as first argument to initialize guest client

Events

request-done

Emitted when request is done without any network error. Event data:

{ method, url, options, statusCode }

network-error

Emitted when network error has occured. Event data:

{ method, url, options, err }

FAQs

Last updated on 13 Jan 2023

Did you know?

Socket installs a Github app to automatically flag issues on every pull request and report the health of your dependencies. Find out what is inside your node modules and prevent malicious activity before you update the dependencies.

Install Socket
Socket
support@socket.devSocket SOC 2 Logo

Product

  • Package Issues
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc