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

@elerahealth/booking-sdk

v1.2.0

Published

Official SDK for integrating Elera Health booking into provider websites with centralized flow control and theming

Readme

@elera/booking-sdk

Official SDK for integrating Elera Health scheduling into provider websites.

What's New in v1.2.0

  • Centralized Flow Control: Elera now controls the booking steps, days shown, and flow behavior
  • Theming Support: Provider websites control colors, fonts, and visual design via CSS variables
  • React Integration: useEleraBooking hook for React/Next.js apps
  • Drop-in Widget: Pre-built widget that works with any website

Installation

npm install @elera/booking-sdk
# or
yarn add @elera/booking-sdk
# or
pnpm add @elera/booking-sdk

Quick Start

Option 1: Drop-in Widget (Easiest - 5 minutes)

Just add the widget to your page and customize with CSS variables:

<!DOCTYPE html>
<html>
<head>
  <style>
    /* Customize to match your brand */
    :root {
      --elera-primary: #FF6B35;           /* Your brand color */
      --elera-font-family: 'Poppins', sans-serif;
      --elera-border-radius: 16px;
    }
  </style>
</head>
<body>
  <div id="booking"></div>
  
  <script src="https://cdn.elera.com/elera-booking-widget.min.js"></script>
  <script>
    EleraBookingWidget.mount('#booking', {
      apiKey: 'elera_your_api_key',
      onComplete: (booking) => {
        console.log('Booked!', booking.booking.confirmationId);
      }
    });
  </script>
</body>
</html>

Option 2: React Integration

import { EleraBookingProvider, useEleraBooking } from '@elera/booking-sdk/react';

function App() {
  return (
    <EleraBookingProvider 
      apiKey="elera_your_api_key"
      onComplete={(booking) => console.log('Booked!', booking)}
    >
      <BookingFlow />
    </EleraBookingProvider>
  );
}

function BookingFlow() {
  const { 
    steps,           // Steps controlled by Elera
    currentStep,     // Current step in the flow
    config,          // Flow configuration
    theme,           // Theme values for styling
    nextStep,
    prevStep,
    selectDate,
    selectTime,
    bookAppointment,
    getCopyText,     // Get customizable text
  } = useEleraBooking();

  return (
    <div style={{ fontFamily: theme.fontFamily }}>
      {/* Your custom UI using Elera's flow */}
      <StepIndicator steps={steps} current={currentStep} />
      
      {currentStep?.id === 'date' && (
        <YourDatePicker 
          daysToShow={config?.days_to_show} 
          onSelect={selectDate}
        />
      )}
      
      {/* ... other steps */}
      
      <button onClick={nextStep}>
        {getCopyText('nextButtonText', 'Continue')}
      </button>
    </div>
  );
}

Option 3: Headless SDK (Full Control)

import { EleraBooking } from '@elera/booking-sdk';

const booking = new EleraBooking('elera_your_api_key', {
  theme: {
    primaryColor: '#FF6B35',
    fontFamily: 'Poppins, sans-serif'
  }
});

// Initialize and get configuration
await booking.initialize();

// Get centrally-controlled flow configuration
const config = booking.getBookingFlowConfig();
console.log('Steps:', config.steps);
console.log('Days to show:', config.days_to_show);
console.log('Insurance enabled:', config.insurance_step_enabled);

// Get enabled steps in order
const steps = booking.getEnabledSteps();
// Returns: [{id: 'date', ...}, {id: 'time', ...}, ...]

// Get customizable copy text
const ctaText = booking.getCopyText('ctaText', 'Book Now');

// Check feature flags
if (booking.isFeatureEnabled('showPricing')) {
  // Show pricing
}

// Get availability
const availability = await booking.getAvailability({
  startDate: '2026-01-15',
  endDate: '2026-01-30'
});

// Book appointment
const result = await booking.bookAppointment({
  date: '2026-01-20',
  time: '10:00',
  patient: {
    firstName: 'John',
    lastName: 'Doe',
    email: '[email protected]',
    phone: '555-123-4567'
  }
});

How It Works

Who Controls What

| Aspect | Controlled By | How | |--------|---------------|-----| | Steps in flow | Elera (central) | config.steps | | Days to show | Elera (central) | config.days_to_show | | Insurance step | Elera (central) | config.insurance_step_enabled | | Button text | Elera (central) | config.copy.ctaText | | Colors | Provider (local) | CSS variables or theme config | | Fonts | Provider (local) | CSS variables or theme config | | Visual design | Provider (local) | Your own CSS/components |

Benefits

  • Elera updates flow → All provider sites get new behavior automatically
  • Add insurance step → Flip a switch, appears on all sites
  • Change copy/text → Updates everywhere instantly
  • Provider keeps brand → Their colors, fonts, design stay intact

CSS Variables Reference

Override these to match your brand:

:root {
  /* Colors */
  --elera-primary: #10b981;           /* Main brand color */
  --elera-primary-hover: #059669;     /* Hover state */
  --elera-text: #1f2937;              /* Text color */
  --elera-text-muted: #6b7280;        /* Secondary text */
  --elera-background: #ffffff;         /* Background */
  --elera-surface: #f9fafb;           /* Card/surface background */
  --elera-border: #e5e7eb;            /* Borders */
  --elera-error: #ef4444;             /* Error states */
  --elera-success: #22c55e;           /* Success states */
  
  /* Typography */
  --elera-font-family: system-ui, sans-serif;
  
  /* Shapes */
  --elera-border-radius: 12px;        /* Cards, containers */
  --elera-button-radius: 8px;         /* Buttons */
  --elera-input-radius: 8px;          /* Inputs */
}

API Reference

EleraBooking Class

Constructor

new EleraBooking(apiKey: string, config?: EleraBookingConfig)

| Parameter | Type | Description | |-----------|------|-------------| | apiKey | string | Your provider API key (starts with elera_) | | config.baseUrl | string | Override API URL (for testing) | | config.timeout | number | Request timeout in ms (default: 30000) | | config.theme | EleraTheme \| 'inherit' \| 'none' | Theme configuration | | config.enablePixel | boolean | Enable Meta Pixel tracking (default: true) | | config.onEvent | function | Event callback for analytics |

Methods

initialize(): Promise<ProviderContext>

Initialize the SDK and fetch provider/flow configuration.

getBookingFlowConfig(): BookingFlowConfig | undefined

Get the centrally-controlled flow configuration.

getEnabledSteps(): BookingFlowStep[]

Get enabled steps sorted by order.

getCopyText(key: string, defaultValue?: string): string

Get customizable copy text with fallback.

isFeatureEnabled(feature: string): boolean

Check if a feature flag is enabled.

getTheme(): EleraTheme

Get resolved theme (merged with defaults).

applyThemeToElement(element: HTMLElement): void

Apply theme as CSS variables to an element.

getThemeCSS(): string

Generate CSS string with all theme variables.

getAvailability(options?): Promise<AvailabilityResponse>

Get available time slots.

bookAppointment(options): Promise<BookingResponse>

Book an appointment.

trackSlotSelected(date: string, time: string): string

Track when a slot is selected.

BookingFlowConfig

interface BookingFlowConfig {
  steps: BookingFlowStep[];           // Flow steps
  days_to_show: number;               // Days in calendar (default: 14)
  max_days_out: number;               // Max booking horizon (default: 60)
  time_slot_interval_minutes: number; // Slot interval (default: 30)
  insurance_step_enabled: boolean;    // Show insurance step
  insurance_step_required: boolean;   // Require insurance
  intake_form_enabled: boolean;       // Show intake form
  copy: BookingFlowCopy;              // Customizable text
  features: BookingFlowFeatures;      // Feature flags
}

BookingFlowStep

interface BookingFlowStep {
  id: string;           // 'date' | 'time' | 'insurance' | 'contact' | 'confirm'
  title: string;        // Display title
  description?: string; // Optional description
  enabled: boolean;     // Is step enabled
  order: number;        // Order in flow (1-based)
  required?: boolean;   // Is step required
}

EleraTheme

interface EleraTheme {
  primaryColor?: string;
  primaryHoverColor?: string;
  textColor?: string;
  textMutedColor?: string;
  backgroundColor?: string;
  surfaceColor?: string;
  borderColor?: string;
  errorColor?: string;
  successColor?: string;
  fontFamily?: string;
  borderRadius?: string;
  buttonRadius?: string;
  inputRadius?: string;
}

React Hooks

useEleraBooking

Main hook for booking state and actions:

const {
  // State
  sdk,                // SDK instance
  providerContext,    // Provider metadata
  config,             // Flow configuration
  steps,              // Enabled steps
  currentStep,        // Current step
  currentStepIndex,   // Current step index
  theme,              // Resolved theme
  isLoading,          // Loading state
  error,              // Error if any
  isInitialized,      // SDK initialized
  availability,       // Available slots
  selectedDate,       // Selected date
  selectedTime,       // Selected time
  patientInfo,        // Patient info collected
  bookingResult,      // Booking result
  isBooking,          // Booking in progress
  
  // Actions
  goToStep,           // Go to step by id
  nextStep,           // Next step
  prevStep,           // Previous step
  canProceed,         // Can proceed to next
  selectDate,         // Select date and fetch availability
  selectTime,         // Select time slot
  updatePatientInfo,  // Update patient info
  bookAppointment,    // Complete booking
  reset,              // Reset flow
  getCopyText,        // Get copy text
  isFeatureEnabled,   // Check feature flag
  fetchAvailability,  // Fetch availability
} = useEleraBooking();

Helper Hooks

// Get just the theme
const theme = useEleraTheme();

// Get booking flow config
const config = useBookingFlowConfig();

// Get step navigation
const { currentStep, nextStep, prevStep, isLastStep } = useStepNavigation();

Widget Options

interface WidgetOptions {
  apiKey: string;                                    // Required
  config?: EleraBookingConfig;                       // SDK config
  onComplete?: (booking: BookingResponse) => void;  // Success callback
  onError?: (error: Error) => void;                 // Error callback
  onStepChange?: (step: BookingFlowStep) => void;   // Step change callback
  className?: string;                               // Custom CSS class
}

Analytics & Tracking

The SDK includes built-in Meta Pixel tracking:

| Event | When Fired | Data Included | |-------|------------|---------------| | PageView | After initialize() | Provider context | | ViewContent | After initialize() | Provider, specialty, state | | Schedule | When slot selected | Date, time, provider | | Lead | When booking completes | Appointment value, confirmation |

Events are automatically deduplicated between client-side Pixel and server-side Conversions API.

Getting Your API Key

  1. Log in to your Elera Health provider dashboard
  2. Go to Settings → API Keys
  3. Click "Generate New Key"
  4. Copy the key (starts with elera_)

Support

  • Documentation: https://docs.elera.com/sdk
  • Issues: https://github.com/elerahealth/booking-sdk/issues
  • Email: [email protected]