npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

mixnode-node-sdk

v1.0.0

Published

Mixnode Node.js SDK

Readme

Mixnode Node.js SDK

Overview

The Mixnode Node.js SDK allows you to easily integrate the Mixnode REST APIs into your Node.js application.

Requirements

  • Node.js version 4 and above.
  • A Mixnode API key from a registered user on the Mixnode portal.

Installation

npm install mixnode-node-sdk --save

Tutorial

Follow this tutorial to see a step-by-step guide and examples of how to use the Mixnode Node.js SDK.

Get the API key from Mixnode portal

  • Create an account on Mixnode.
  • If already registered, then login and navigate to api key page.
  • Dashboard -> Choose API from left menu -> Note the API key.
  • Or, directly navigate to https://www.mixnode.com/account/api to find your API key.

Authentication

This SDK comes with basic authentication over HTTPS which requires you to pass your Mixnode API key using a config file or as a json object during SQL client instantiation.

Basic Authentication

This type of token is given directly to the application.

var Mixnode = require('mixnode-node-sdk');

// Create an instance of the Mixnode SQL Client
const SQLClient = new Mixnode.SQLClient({
    api_key: 'XXXXXX' // add your API KEY here; available at https://www.mixnode.com/account/api
});

Note that api_key can also be passed as a JSON object in a config file to avoid specifying the key in the code. Please see Examples

Quick Start


const Mixnode = require('./../src/index');
const config = require('./config.js');

const SQLClient = new Mixnode.SQLClient(config);

// Gets 10 urls and their title from homepages table
SQLClient.execute('SELECT url, title from homepages LIMIT 10')
.then((response) => {
	console.log(response);
}).catch((err) => {
	console.log(err);
});

SQLClient's execute functionality

SQLClient.execute is an asynchronous operation which returns a promise object either resolving as a response or error which could then be obtained using then or catch statements.

SQLClient.execute can accept upto four parameters : query, vars (optional), inputLimit (optional), timeout (optional). Please see various Examples for usage details.
SQLClient.execute(query).then((response) => {
	// Do somethere here with the response
}).catch((err) => {
	// Do something with the exception
});
SQLClient.execute(query, vars).then((response) => {
	// Do somethere here with the response
}).catch((err) => {
	// Do something with the exception
});
SQLClient.execute(query, vars, inputLimit).then((response) => {
	// Do somethere here with the response
}).catch((err) => {
	// Do something with the exception
});
SQLClient.execute(query, vars, timeout).then((response) => {
	// Do somethere here with the response
}).catch((err) => {
	// Do something with the exception
});
SQLClient.execute(query, vars, inputLimit, timeout).then((response) => {
	// Do somethere here with the response
}).catch((err) => {
	// Do something with the exception
});

SDK debugging

  • Turning on the debug mode logs the HTTP requests being sent to the Mixnode API.
  • This is useful to verify if the queries being sent are correct.
  • This is useful to verify if the execution is in progress.
/* Setting debug to true logs the state of the application.
Do not use this in production.
*/
Mixnode.setDebug(true);

SDK error explanation

SQLClient.execute(query).then((response) => {
	// Do somethere here with the response
}).catch((error) => {
	// Do something with the exception
});
Error attributes
  • error.code => Mixnode specified error code.
  • error.statusCode => Http status code of the error.
  • error.message => Message received from backend or due to exception caused in SDK code.
  • error.name => SDK specified generic name of the error.
  • error.status => Status of the query at the time of the error.
  • error.stack => Stack trace of the error

Examples: Mixnode SQL Client

Examples

SQL API Documentation

You can get the full documentation for the API on the Mixnode SQL API reference

Support

[email protected]