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 🙏

© 2024 – Pkg Stats / Ryan Hefner

karix-api

v1.0.1

Published

Karix.io API wrapper for Node.js

Downloads

3

Readme

karix-api

PayPal Ask me anything Version Downloads Get help on Codementor

Karix.io API wrapper for Node.js

The Karix.io API V2 Reference is a good resource to learn more about these APIs.

:cloud: Installation

# Using npm
npm install --save karix-api

# Using yarn
yarn add karix-api

:clipboard: Example

const Karix = require("karix-api");

var client = new Karix({
    accountId: process.env.KARIX_ACCOUNT_ID
  , accountToken: process.env.KARIX_ACCOUNT_TOKEN

    // This is optional
  , host: process.env.KARIX_HOST || "https://api.karix.io/"
});

client.getSubaccount((err, data) => {
    console.log(err || data);
    // =>
    // {
	//	"objects": [
	//		{
	//		"name": "Beth Smith",
	//		"status": "enabled",
	//		"uid": "7fea9708-ea28-42e9-871f-a07fe7cef72f",
	//		"token": "e664221d-4aed-415b-929b-7edf887e4680",
	//		"is_parent": false,
	//		"created_time": "2017-08-04T09:59:29.660Z",
	//		"updated_time": "2017-08-05T09:59:29.660Z",
	//		"account_type": "prepaid",
	//		"credit_balance": "127.33",
	//		"auto_recharge": false
	//		}
	//	],
	//	"meta": {
	//		"request_uuid": "e54b13f5-0831-40f1-959f-e9c5a8ff2957",
	//		"next": "https://api.karix.co/<resource>/?limit=10&offset=10",
	//		"previous": "string",
	//		"total": 1
	//	}
	//	}
});

client.getSubaccountById({ uid: "7fea9708-ea28-42e9-871f-a07fe7cef72f" }, (err, data) => {
    console.log(err || data);
    // =>
	//	{
	//		"meta": {
	//			"request_uuid": "e54b13f5-0831-40f1-959f-e9c5a8ff2957"
	//		},
	//		"data": {
	//			"name": "Beth Smith",
	//			"status": "enabled",
	//			"uid": "7fea9708-ea28-42e9-871f-a07fe7cef72f",
	//			"token": "e664221d-4aed-415b-929b-7edf887e4680",
	//			"is_parent": false,
	//			"created_time": "2017-08-04T09:59:29.660Z",
	//			"updated_time": "2017-08-05T09:59:29.660Z",
	//			"account_type": "prepaid",
	//			"credit_balance": "127.33",
	//			"auto_recharge": false
	//		}
	//	}
});

:question: Get Help

There are few ways to get help:

  1. Please post questions on Stack Overflow. You can open issues with questions, as long you add a link to your Stack Overflow question.

  2. For bug reports and feature requests, open issues. :bug:

  3. For direct and quick help, you can use Codementor. :rocket:

:memo: Documentation

Karix(options)

Creates the instance of the Karix class.

Params

  • Object options: An object containing:
  • accountId (String): Karix Account ID (mandatory).
  • accountToken (String): Karix Account Token (mandatory)
  • host (String): The karix.io host (default: https://api.karix.io/).

createSubaccount(data, cb)

Create a new subaccount

Params

  • Object data: The Subaccount object as documented here.
  • Function cb: The callback function.

getSubaccount(params, cb)

Get a list of details of all subaccounts, including the main account.

Params

  • Object params: The query params as documented here.
  • Function cb: The callback function.

getSubaccountById(uid, cb)

Get details of an account by its uid. Both main account and subaccounts can be fetched using their uids.

Params

  • String uid: Alphanumeric ID of the subaccount to get.
  • Function cb: The callback function.

patchSubaccount(uid, data, cb)

Edit details of your account or its subaccount

Params

  • String uid: Alphanumeric ID of the subaccount to edit.
  • Object data: The Subaccount object (documented here).
  • Function cb: The callback function.

sendMessage(data, cb)

Send a message to a list of destinations.

Params

  • Object data: The Create Message object data (documented here).
  • Function cb: The callback function.

getMessage(params, cb)

Get list of messages sent or received. Sorted by descending order of created_time (latest messages are first)

Params

  • Object params: The query params (documented here).
  • Function cb: The callback function.

getMessageById(uid, cb)

Get message details by id.

Params

  • String uid: Alphanumeric ID of the message to get.
  • Function cb: The callback function.

getMedia(uid, cb)

Download or Stream media by id

Params

  • String uid: Alphanumeric ID of the media to get.
  • Function cb: The callback function.

createWebhook(data, cb)

Create webhooks to receive Message

Params

  • Object data: The Create Webhook object (documented here).
  • Function cb: The callback function.

getWebhook(params, cb)

Get a list of your webhooks

Params

  • Object params: The query params (documented here).
  • Function cb: The callback function.

getWebhookById(uid, cb)

Get a webhook by ID

Params

  • Object params: Alphanumeric ID of the webhook to get.
  • Function cb: The callback function.

patchWebhook(uid, data, cb)

Edit a webhook

Params

  • String uid: Alphanumeric ID of the webhook to edit.
  • Object data: The request body (documented here).
  • Function cb: The callback function.

deleteWebhookById(uid, cb)

Delete a webhook by ID

Params

  • String uid: Alphanumeric ID of the webhook to delete.
  • Function cb: The callback function.

numberSearch(params, cb)

Query for phone numbers in our inventory.

Params

  • Object params: The query params (documented here).
  • Function cb: The callback function.

rentNumber(data, cb)

Rent a phone number

Params

  • Object data: The Rent Details object (documented here).
  • Function cb: The callback function.

getNumber(params, cb)

Get details of all phone numbers linked to your account.

Params

  • Object params: The query params data (documented here).
  • Function cb: The callback function.

number(number, cb)

Get details of a number

Params

  • Integer number: Number for which details need to be fetched.
  • Function cb: The callback function.

patchNumber(number, data, cb)

Edit phone number belonging to your account

Params

  • Integer number: Number which needs to be edited.
  • Object data: The request body object (documented here).
  • Function cb: The callback function.

unrentNumber(number, cb)

Unrent number from your account

Params

  • Integer number: Number which needs to be unrented.
  • Function cb: The callback function.

:yum: How to contribute

Have an idea? Found a bug? See how to contribute.

:sparkling_heart: Support my projects

I do web services and open-source my used projects as much as I can. I will try to reply to everyone needing help using these projects. It consumes a lot of time and hardwork. You can integrate and use these projects in your applications for free! You can even change the source code and redistribute (even resell it).

However, if you get some profit from this or just want to encourage me to continue creating stuff, there are few ways you can do it:

  • PayPal—You can make one-time donations via PayPal. I'll probably buy a ~~coffee~~ tea. :tea:

  • Support me on Patreon—Set up a recurring monthly donation and you will get interesting news about what I'm doing (things that I don't share with everyone).

  • Bitcoin—You can send me bitcoins at this address (or scanning the code below): 344FWmvxDt6FFFoYoFjftiT3gGus68AqNw

Thank you! :heart:

:scroll: License

[MIT][license]