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

@dineator/sdk

v1.0.13

Published

Official JavaScript/TypeScript SDK for the Dineator Restaurant Management API

Readme

@dineator/sdk

Official JavaScript & TypeScript SDK for the Dineator Restaurant Management API.

npm version License: MIT


Installation

npm install @dineator/sdk
# or
yarn add @dineator/sdk

CDN (browser)

<script src="https://unpkg.com/@dineator/[email protected]/dist/dineator.min.js"></script>

Quick Start

import { Dineator } from '@dineator/sdk';

const client = new Dineator({
  apiUrl: 'https://api.dineator.com',
});

// 1. Login (automatically stores the token)
const { accessToken, refreshToken } = await client.auth.login({
  email: '[email protected]',
  password: 'SecurePassword123!',
});

// 2. Get the public menu (no auth needed)
const menu = await client.menu.getPublic('my-restaurant-slug');

// 3. Place a customer order
const order = await client.orders.placePublic('my-restaurant-slug', {
  orderType: 'DINE_IN',
  tableId: 'table-uuid',
  customerName: 'Jane Doe',
  items: [{ menuItemId: 'item-uuid', quantity: 2 }],
});

API Reference

new Dineator(config)

| Option | Type | Description | |---|---|---| | apiUrl | string | Base URL — https://api.dineator.com for production | | token | string? | Optional initial JWT token |

const client = new Dineator({
  apiUrl: 'https://api.dineator.com',
  token: 'your-jwt-token', // optional — can be set later via client.setToken()
});

client.auth

| Method | Auth | Description | |---|---|---| | auth.login(body) | None | Authenticate; sets token automatically | | auth.register(body) | None | Create a tenant + admin account | | auth.refresh(refreshToken) | None | Refresh access token | | auth.me() | Bearer | Get current user profile | | auth.logout() | Bearer | Invalidate refresh token | | auth.forgotPassword(body) | None | Send password reset email | | auth.resetPassword(body) | None | Reset password with token | | auth.sendMagicLink(body) | None | Send magic link email | | auth.verifyMagicLink(body) | None | Verify magic link, get tokens |


client.menu

| Method | Auth | Description | |---|---|---| | menu.getPublic(slug) | None | Full public menu | | menu.listCategories() | Bearer | List categories | | menu.createCategory(body) | Bearer | Create category | | menu.updateCategory(id, body) | Bearer | Update category | | menu.deleteCategory(id) | Bearer | Delete category | | menu.listItems() | Bearer | List menu items | | menu.createItem(body) | Bearer | Create item | | menu.updateItem(id, body) | Bearer | Update item | | menu.deleteItem(id) | Bearer | Delete item | | menu.createModifierGroup(itemId, body) | Bearer | Add modifier group | | menu.updateModifierGroup(itemId, groupId, body) | Bearer | Update modifier group | | menu.deleteModifierGroup(itemId, groupId) | Bearer | Delete modifier group | | menu.createModifier(itemId, groupId, body) | Bearer | Add modifier | | menu.updateModifier(itemId, groupId, modifierId, body) | Bearer | Update modifier | | menu.deleteModifier(itemId, groupId, modifierId) | Bearer | Delete modifier |


client.orders

| Method | Auth | Description | |---|---|---| | orders.placePublic(slug, body) | None | Customer-facing order placement | | orders.trackPublic(orderId) | None | Track order status | | orders.appendItems(orderId, body) | None | Add items to existing order | | orders.placeAdmin(body) | Bearer | Staff POS order (bypasses business hours) | | orders.list() | Bearer | List all orders | | orders.listKitchen() | Bearer | Kitchen display orders | | orders.updateStatus(id, body) | Bearer | Update order status | | orders.updateItems(id, body) | Bearer | Modify order items | | orders.splitBill(id, body) | Bearer | Split bill into two orders |

Order Status Flow: PENDING → CONFIRMED → PREPARING → READY → DELIVERED → COMPLETED


client.reservations

| Method | Auth | Description | |---|---|---| | reservations.create(slug, body) | None | Create a reservation | | reservations.checkAvailability(slug, params) | None | Check time slot availability | | reservations.getPortalData(slug) | None | Booking widget data | | reservations.list() | Bearer | List all reservations | | reservations.updateStatus(id, body) | Bearer | Confirm/cancel/complete |


client.tables · client.floors

Standard CRUD operations for physical restaurant layout management.


client.analytics

| Method | Auth | Description | |---|---|---| | analytics.getDashboard({ range }) | Bearer (Manager+) | KPIs for 1d, 7d, 30d, 90d | | analytics.export({ range, format }) | Bearer (Manager+) | Export as csv or json | | analytics.refreshSnapshot() | Bearer (Admin+) | Trigger snapshot refresh |


client.theme

| Method | Auth | Description | |---|---|---| | theme.get(restaurantId) | None | Get theme config | | theme.update(restaurantId, body) | Bearer (Admin+) | Update theme tokens | | theme.reset(restaurantId) | Bearer (Admin+) | Reset to defaults | | theme.applyTemplate(restaurantId, body) | Bearer (Admin) | Apply Super Admin template | | theme.generateAi(body) | Bearer (Super Admin) | AI-generated theme tokens | | theme.generateVariants(body) | Bearer (Super Admin) | Generate 3–5 AI theme variants | | theme.refineVariant(body) | Bearer (Super Admin) | Refine variant with feedback |


client.promotions

| Method | Auth | Description | |---|---|---| | promotions.getActiveOffers(restaurantId) | None | Active offers | | promotions.validateCoupon(restaurantId, body) | None | Validate coupon at checkout | | promotions.listCoupons() | Bearer | List coupons | | promotions.createCoupon(body) | Bearer | Create coupon | | promotions.updateCoupon(id, body) | Bearer | Update coupon | | promotions.deleteCoupon(id) | Bearer | Delete coupon | | promotions.listOffers() | Bearer | List offers | | promotions.createOffer(body) | Bearer | Create offer | | promotions.updateOffer(id, body) | Bearer | Update offer | | promotions.deleteOffer(id) | Bearer | Delete offer |


client.qr

| Method | Auth | Description | |---|---|---| | qr.list() | Bearer | List QR codes | | qr.generate(body) | Bearer | Generate QR code | | qr.delete(id) | Bearer | Delete QR code |


Error Handling

All errors throw a DineatorError:

import { Dineator, DineatorError } from '@dineator/sdk';

try {
  await client.orders.placePublic('slug', { /* invalid body */ });
} catch (err) {
  if (err instanceof DineatorError) {
    console.log(err.status);   // 422
    console.log(err.code);     // "VALIDATION_ERROR"
    console.log(err.message);  // Human-readable description
  }
}

| Status | Code | Meaning | |---|---|---| | 400 | VALIDATION_ERROR | Request body schema failed | | 401 | UNAUTHORIZED | Missing or expired token | | 403 | FORBIDDEN | Insufficient role/permission | | 404 | NOT_FOUND | Resource not found | | 409 | CONFLICT | Unique constraint (e.g. duplicate slug) | | 422 | UNPROCESSABLE | Business rule violation | | 429 | RATE_LIMITED | Too many requests | | 500 | INTERNAL_ERROR | Server error |


Rate Limits

| Endpoint | Limit | Window | |---|---|---| | POST /auth/login | 10 requests | 15 min | | POST /auth/register | 5 requests | 1 hour | | POST /auth/magic-link | 5 requests | 15 min | | All other endpoints | 200 requests | 15 min |

Implement exponential backoff on 429 RATE_LIMITED responses.


TypeScript

Full TypeScript support is built in — no @types package needed.

import type { MenuItem, Order, ThemeConfig } from '@dineator/sdk';

All request bodies and responses are typed.


Links


License

MIT © Dineator Engineering