npm.io
0.1.1 • Published yesterday

@rajveer8875/hy-sdk-1

Licence
MIT
Version
0.1.1
Deps
0
Size
210 kB
Vulns
0
Weekly
0

@rajveer8875/hy-sdk-1

npm version CI

React booking SDK for Rajveer Hotel. Opens a 70vw × 80vh modal overlay on your site (Lean-style) — guests never leave your page.

API base URL and version are inside the SDK. Host apps do not configure backend env vars.


Install

npm install @rajveer8875/hy-sdk-1
# or
pnpm add @rajveer8875/hy-sdk-1
# or
yarn add @rajveer8875/hy-sdk-1

Peer dependencies

Package Version
react ^18 or ^19
react-dom ^18 or ^19

Quick start

import { useState } from "react";
import {
  BookingModal,
  BookingWidget,
} from "@rajveer8875/hy-sdk-1";

export function BookStayButton() {
  const [open, setOpen] = useState(false);

  return (
    <>
      <button type="button" onClick={() => setOpen(true)}>
        Book a stay
      </button>

      <BookingModal open={open} onClose={() => setOpen(false)}>
        <BookingWidget />
      </BookingModal>
    </>
  );
}

Public API

Only these exports are part of the supported surface:

Export Kind Description
BookingModal Component Centered overlay (70vw × 80vh), backdrop + Close
BookingWidget Component Full flow: dates → rooms → guest → Razorpay → done
HotelBookingProvider Component Optional wrapper if you embed the widget inline
HotelSdkOptions Type { hotelId?: number; hotelName?: string }
HotelSdkTheme Type Colors, font, radius
BookingModalProps Type Modal props
HotelBookingProviderProps Type Provider props

Internal client, payments helpers, and API defaults are not exported.


Configuration

Optional hotel options
<BookingModal
  open={open}
  onClose={() => setOpen(false)}
  config={{ hotelId: 1, hotelName: "Rajveer Hotel" }}
>
  <BookingWidget />
</BookingModal>
Optional theme
<BookingModal
  open={open}
  onClose={() => setOpen(false)}
  theme={{
    primaryColor: "#1a4d3e",
    accentColor: "#c4a35a",
    backgroundColor: "#f3efe6",
    fontFamily: 'Georgia, "Times New Roman", serif',
    borderRadius: "10px",
  }}
>
  <BookingWidget />
</BookingModal>

Behavior

  • Modal floats over the host page (dimmed backdrop); Escape / backdrop / Close dismisses it
  • Desktop size: 70vw × 80vh (Razorpay-like); mobile uses a bottom sheet
  • Booking, quote, order, and payment verification call the built-in Dev API from inside the package

Publishing (maintainers)

Publishing is done only via GitHub Actions — do not publish from a laptop with a personal token in git.

Secret
  1. Create an npm Granular Access Token with:
    • Read and write
    • Bypass two-factor authentication enabled
  2. In the GitHub repo: Settings → Secrets and variables → Actions
  3. Add secret name: NPM_TOKEN
Triggers
Event Behavior
Push to main (src / package files) patch bump → npm publish → release commit + tag
Actions → Publish to npm → Run workflow Manual patch / minor / major

Scripts

npm run typecheck
npm run build
npm run dev          # tsup watch

License

MIT Rajveer6000

Keywords