@rechat/sdk
v2.0.3
Published
The Rechat SDK lets you add Rechat real-estate features — listing search, an interactive map, listing cards, and lead capture — to any website.
Keywords
Readme
Rechat SDK
The Rechat SDK lets you add Rechat real-estate features — listing search, an interactive map, listing cards, and lead capture — to any website.
There are two ways to use it, and you can mix them:
- Web Components — drop-in HTML tags (
<rechat-listings>,<rechat-map>, …) that render a full listing search experience. No framework required. - JavaScript SDK — a small
Rechat.Sdk()class for lead capture, activity tracking, and read access to listings, agents, and testimonials from your own code.
Both ship in one file loaded from a CDN:
<link rel="stylesheet" href="https://unpkg.com/@rechat/sdk@latest/dist/rechat.min.css">
<script src="https://unpkg.com/@rechat/sdk@latest/dist/rechat.min.js"></script>That's it — the custom elements register themselves and Rechat is available globally.
Documentation
- Installation — loading the SDK, pinning versions.
Web Components
- Overview — structure and the component catalog.
- Attribute Reference — every attribute on every element.
- Custom Markup (Templates) — render your own HTML with
{{ … }}placeholders. - Theming — named themes and CSS variables.
- Events — DOM events for fetches, clicks, and errors.
- Sign-in & Saved Searches — visitor accounts on portal sites.
JavaScript SDK
- Overview — settings, portals, offline sync.
- Lead Capture — create leads directly or bind an HTML form.
- Lead Tracker — record visitor activity on a lead's timeline.
- Listings — listing search and counts.
- Agents — the brand's agent roster.
- Testimonials — the brand's testimonials.
The Widget Builder
Prefer not to hand-write tags? Use the Widget Builder bundled with these docs. It's a visual tool where you pick a widget (Listings, or a standalone Search Form), adjust filters and theme, preview it live, and copy the ready-to-paste embed code.
At a glance
A listing-search widget:
<rechat-root brand_id="YOUR_BRAND_ID">
<rechat-listings>
<rechat-listing-details></rechat-listing-details>
<rechat-map-filter></rechat-map-filter>
<rechat-map></rechat-map>
<rechat-map-listings-grid></rechat-map-listings-grid>
<rechat-listings-pagination></rechat-listings-pagination>
</rechat-listings>
</rechat-root>Lead capture from code:
const sdk = new Rechat.Sdk()
sdk.Leads.capture(
{ lead_channel: '2c55e69d-adbe-42d9-97a5-bedb43783b80' },
{ first_name: 'John', last_name: 'Doe', email: '[email protected]' },
)