@foxscheduling/shared

v0.2.7

Published

Shared utilities and interfaces for FoxScheduling backend and frontend

Readme

@foxscheduling/shared

Shared TypeScript types and utilities for the Fox Scheduling platform.

This package is the companion to @foxscheduling/sdk. It contains the data types (DTOs, enums, webhook payloads) and helper functions used across Fox Scheduling, so you can share strong typing between your code and the API.

If you just want to call the Partner API, install @foxscheduling/sdk — it re-exports the types you need from this package.

Installation

npm install @foxscheduling/shared
pnpm add @foxscheduling/shared
yarn add @foxscheduling/shared

Requires Node.js 18+. Ships with both ESM and CommonJS builds and bundled type declarations.

Usage

import {
  type BusinessProfileDto,
  type PartnerBookingDto,
  type PartnerEmbedOptions,
  type PartnerWebhookEvent,
  isValidYearMonth,
  partnerPaginate,
} from "@foxscheduling/shared";

// Validate a booking month before querying
if (!isValidYearMonth("2026-06")) {
  throw new Error("month must be YYYY-MM");
}

CommonJS works too:

const { isValidYearMonth } = require("@foxscheduling/shared");

Subpath imports

For smaller imports you can target a subpath directly:

import { isValidYearMonth } from "@foxscheduling/shared/types";
import { buildBookingEmbedUrl } from "@foxscheduling/shared/utils/bookingEmbed";

| Entry point | Contents | | -------------------------------------- | ----------------------------------------- | | @foxscheduling/shared | Everything (types + utils) | | @foxscheduling/shared/types | Type and interface definitions | | @foxscheduling/shared/utils | Utility functions | | @foxscheduling/shared/utils/bookingEmbed | Booking embed URL and snippet builders |

What's inside

  • Partner API typesBusinessProfileDto, PartnerBookingDto, PartnerServiceDto, PartnerCustomerDto, PartnerStaffDto, PartnerPage<T>, and more.
  • WebhooksPartnerWebhookEvent and the PARTNER_WEBHOOK_EVENTS list.
  • EmbeddingPartnerEmbedOptions plus buildBookingEmbedUrl, buildInlineIframeEmbedCode, and buildWidgetScriptSnippet for rendering booking widgets.
  • Helpers — pagination (partnerPaginate, resolvePartnerPageParams), validation (isValidYearMonth), formatting utilities, and shared enums.

License

Proprietary © Fox Scheduling.