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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@karmalicious/karma-api-js

v0.1.0

Published

Official JavaScript/TypeScript SDK for Karma Common API

Readme

@karmalicious/karma-api-js

Official JavaScript/TypeScript SDK for the Karma Common API.

Installation

npm install @karmalicious/karma-api-js
# or
yarn add @karmalicious/karma-api-js

Quick Start

import { Configuration, InventoryApi } from '@karmalicious/karma-api-js'

// Initialize configuration
const config = new Configuration({
  basePath: 'https://common-api.karmalicious.com',
  apiKey: 'karma_live_your_api_key_here',
  headers: {
    'X-API-Key': 'karma_live_your_api_key_here'
  }
})

// Create API instances
const inventoryApi = new InventoryApi(config)

// Use the API
async function getInventory() {
  try {
    const response = await inventoryApi.getInventoryItems({
      locationId: 100,
      page: 1,
      limit: 50
    })
    console.log(response)
  } catch (error) {
    console.error('Error fetching inventory:', error)
  }
}

getInventory()

Available APIs

  • InventoryApi - Menu items, products, and modifiers
  • OrdersApi - Customer orders and order management
  • SchedulesApi - Operating hours and special schedules
  • ChannelsApi - Sales channels (dine-in, takeaway, delivery)
  • MenuLayoutsApi - Menu structure and organization
  • WebhooksApi - Webhook subscriptions and event notifications
  • ApiKeysApi - Authentication keys and permissions
  • VariantGroupsApi - Product options and modifiers
  • CustomTagsApi - Labels and categorization
  • CoursingsApi - Multi-course meal sequencing
  • AlertsApi - System notifications and warnings
  • TablesApi - Restaurant table management
  • TableGroupsApi - Table grouping and floor plans
  • LocationMapsApi - Floor plans and seating layouts
  • TabsApi - Customer tabs and running bills
  • TerminalsApi - Payment terminal management
  • VouchersApi - Discount vouchers and promotions
  • ArticlesApi - Changelog and release notes

Authentication

All API requests require an API key. You can generate API keys through the Karma Merchant Dashboard.

const config = new Configuration({
  basePath: 'https://common-api.karmalicious.com',
  headers: {
    'X-API-Key': 'your_api_key_here'
  }
})

Error Handling

import { ResponseError } from '@karmalicious/karma-api-js'

try {
  const response = await inventoryApi.getInventoryItems({ locationId: 100 })
} catch (error) {
  if (error instanceof ResponseError) {
    const errorBody = await error.response.json()
    console.error('API Error:', errorBody)
  } else {
    console.error('Unexpected error:', error)
  }
}

TypeScript Support

This SDK is written in TypeScript and provides full type definitions for all API endpoints and models.

import { InventoryItem, CreateOrderRequest } from '@karmalicious/karma-api-js'

const item: InventoryItem = {
  id: 123,
  title: 'Burger',
  basePrice: 9900, // prices in cents
  // ... fully typed!
}

Environments

// Production
const prodConfig = new Configuration({
  basePath: 'https://common-api.karmalicious.com',
  headers: { 'X-API-Key': 'karma_live_...' }
})

// Development
const devConfig = new Configuration({
  basePath: 'https://common-api-dev.karmalicious.com',
  headers: { 'X-API-Key': 'karma_dev_...' }
})

// Local
const localConfig = new Configuration({
  basePath: 'http://localhost:8080',
  headers: { 'X-API-Key': 'karma_dev_...' }
})

Documentation

Full API documentation is available at:

  • Production: https://common-api.karmalicious.com/docs
  • Development: https://common-api-dev.karmalicious.com/docs

License

MIT

Support

For support, email [email protected] or visit our GitHub repository.