Components
Engines
Member Portal

Member Portal Widget

This guide explains how to sign in to Roomstay with the embedded Member Portal Widget.

Examples

import { useState, useEffect } from 'react'
 
import { MemberPortalWidget } from '@roomstay/frontend'
 
function MemberPortalWidgetRenderer() {
  const recent = useRef < HTMLDivElement > null
 
  useEffect(() => {
    if (recent.current) {
      const memberPortalWidget = new MemberPortalWidget(recent.current)
      memberPortalWidget.setConfig({
        // your configs
      })
      memberPortalWidget.start()
    }
  }, [recent])
 
  return (
    <div
      className={`${styles.buttonContainer} ${styles.center}`}
      ref={recent}
    />
  )
}

API

PropertyDescriptionTypeDefaultVersion
companyAn object comprised of important details relating to the company and selected hotelCompany-
authMenuItemCustom auth menu itemobject-
buttonClassThe class name of the buttonstring-
overlayPlacementHow to position the popoverPlacementbottom-end
fallbackPlacementsAllow to specify which position Popper will use on fallback, For more information refer to Popper.js's behavior docs (opens in a new tab)Placement-
onSignedInSpecify a function that will be called after logged infunction(member)-
onSignedOutSpecify a function that will be called after logged outfunction-

Company

PropertyDescriptionTypeDefaultVersion
colorsThe theme specifiedobject-
companyShortstring-
checkoutLinkstring-
hotelstring | object-

Placement

auto | auto-start | auto-end | top | bottom | right | left | top-start | top-end | bottom-start | bottom-end | right-start | right-end | left-start | left-end

IRoomstayMember

interface IRoomstayMember {
  username: string
  email: string
  forename?: string
  surname?: string
  phoneNumber?: string
  address?: {
    address?: string
    city?: string
    zip?: string
    country?: string
  }
  defaultCard: string
  bookings: IRoomstayMemberBooking[]
  cards: IRoomstayMemberCards[]
}