# Subpath map

The package has four entry points. The split is what keeps listing pages server-rendered: the root holds nothing that needs the browser, the server-only code can't leak into a client bundle, and the interactive pieces are marked as client components.

| Import                         | Runs in                 | What it holds                                                                                                                       |
| ------------------------------ | ----------------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
| `@sonordev/re-site-kit`        | Server or client        | Types, the components that render without client JavaScript, format helpers, JSON-LD, the building registry and the market snapshot |
| `@sonordev/re-site-kit/server` | Server only             | The data layer, which reads from Sonor with your `SONOR_API_KEY`                                                                    |
| `@sonordev/re-site-kit/client` | Client (`'use client'`) | The interactive components                                                                                                          |
| `@sonordev/re-site-kit/mcp`    | Server only             | The MCP tool set for a buyer's AI assistant                                                                                         |

Each entry ships ESM, CommonJS and TypeScript declarations.

## `@sonordev/re-site-kit`

Safe to import anywhere, server components included. Nothing here imports server-only code or uses React hooks.

| Export                                                                                                                                                     | Kind      | Docs                                                                                   |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------- | --------- | -------------------------------------------------------------------------------------- |
| `ListingCard`                                                                                                                                              | Component | [Cards and grids](https://sonor.dev/re-site-kit/cards#listingcard)                     |
| `ListingGrid`                                                                                                                                              | Component | [Cards and grids](https://sonor.dev/re-site-kit/cards#listinggrid)                     |
| `ListingDetail`                                                                                                                                            | Component | [Listing pages](https://sonor.dev/re-site-kit/listing-pages#listingdetail)             |
| `ListingSchema`                                                                                                                                            | Component | [Listing pages](https://sonor.dev/re-site-kit/listing-pages#listingschema)             |
| `IdxAttribution`                                                                                                                                           | Component | [IDX compliance](https://sonor.dev/re-site-kit/idx#idxattribution)                     |
| `ListingFilters`                                                                                                                                           | Component | [Search and filters](https://sonor.dev/re-site-kit/search#listingfilters)              |
| `ListingPagination`                                                                                                                                        | Component | [Search and filters](https://sonor.dev/re-site-kit/search#listingpagination)           |
| `formatPrice`, `formatSpecs`, `formatLocation`, `formatStreet`                                                                                             | Functions | [Formatting and JSON-LD](https://sonor.dev/re-site-kit/formatting#display-text)        |
| `buildListingJsonLd`, `safeJsonLdString`                                                                                                                   | Functions | [Formatting and JSON-LD](https://sonor.dev/re-site-kit/formatting#buildlistingjsonld)  |
| `buildingRegistry`                                                                                                                                         | Function  | [Buildings and the registry](https://sonor.dev/re-site-kit/buildings#buildingregistry) |
| `summarizeListings`, `monthlyHoa`                                                                                                                          | Functions | [Market snapshot](https://sonor.dev/re-site-kit/market-snapshot)                       |
| `RealEstateListing`, `ListingStatus`, `ListingType`, `PropertyType`, `ListingOpenHouse`, `ListingBuildingRef`                                              | Types     | [Types](https://sonor.dev/re-site-kit/types)                                           |
| `SearchListingsOptions`, `GetListingsOptions`, `ListingSearchResult`, `ListingPaginationInfo`                                                              | Types     | [Types](https://sonor.dev/re-site-kit/types#search)                                    |
| `GetHotListingsOptions`, `HotListingEntry`, `HotListingsResult`                                                                                            | Types     | [Types](https://sonor.dev/re-site-kit/types#hot-properties)                            |
| `BuildingSummary`, `BuildingRegistryEntry`, `ListingStats`, `ListingJsonLdOptions`                                                                         | Types     | [Types](https://sonor.dev/re-site-kit/types)                                           |
| `ListingCardProps`, `ListingGridProps`, `ListingDetailProps`, `ListingSchemaProps`, `IdxAttributionProps`, `ListingFiltersProps`, `ListingPaginationProps` | Types     | [Types](https://sonor.dev/re-site-kit/types#component-props)                           |

## `@sonordev/re-site-kit/server`

Server components, `generateMetadata`, `generateStaticParams` and route handlers only. It imports `server-only`, so importing it from a client component fails the build rather than leaking the data layer into the browser.

| Export                                               | Returns                              | Docs                                                                                         |
| ---------------------------------------------------- | ------------------------------------ | -------------------------------------------------------------------------------------------- |
| `searchListings(options?, fetchOptions?)`            | `Promise<ListingSearchResult>`       | [Search and filters](https://sonor.dev/re-site-kit/search#searchlistings)                    |
| `getListings(options?)`                              | `Promise<RealEstateListing[]>`       | [Search and filters](https://sonor.dev/re-site-kit/search#getlistings)                       |
| `getListing(slug, options?, fetchOptions?)`          | `Promise<RealEstateListing \| null>` | [Listing pages](https://sonor.dev/re-site-kit/listing-pages#getlisting)                      |
| `getListingParams(options?)`                         | `Promise<{ slug: string }[]>`        | [Listing pages](https://sonor.dev/re-site-kit/listing-pages#getlistingparams)                |
| `listingMetadata(listing, options?)`                 | `Metadata`                           | [Listing pages](https://sonor.dev/re-site-kit/listing-pages#listingmetadata)                 |
| `getHotListings(options?)`                           | `Promise<HotListingEntry[]>`         | [Hot properties](https://sonor.dev/re-site-kit/hot-listings#read-the-ranking-gethotlistings) |
| `getBuildingListings(slug, options?, fetchOptions?)` | `Promise<ListingSearchResult>`       | [Buildings](https://sonor.dev/re-site-kit/buildings#getbuildinglistings)                     |
| `getBuildingSummaries(options?, fetchOptions?)`      | `Promise<BuildingSummary[]>`         | [Buildings](https://sonor.dev/re-site-kit/buildings#a-building-index)                        |

Every fetcher goes through site-kit's server fetcher (`serverApiFetch` from `@sonordev/site-kit/server`), so there's one key, one retry policy and one caching policy across the site. None of them throws: a failure returns an empty result or `null` and logs a warning.

## `@sonordev/re-site-kit/client`

Client components, marked `'use client'`. You can render them straight from a server component; Next handles the boundary.

| Export                                             | Docs                                                                                        |
| -------------------------------------------------- | ------------------------------------------------------------------------------------------- |
| `ListingGallery` and `ListingGalleryProps`         | [Listing pages](https://sonor.dev/re-site-kit/listing-pages#listinggallery)                 |
| `ListingInquiryForm` and `ListingInquiryFormProps` | [Inquiry forms](https://sonor.dev/re-site-kit/inquiry-forms)                                |
| `ListingViewTracker` and `ListingViewTrackerProps` | [Hot properties](https://sonor.dev/re-site-kit/hot-listings#count-views-listingviewtracker) |

These aren't re-exported from the package root on purpose. If they were, importing anything from the root would pull client code into every page that shows a listing.

## `@sonordev/re-site-kit/mcp`

Server only (it imports `server-only`): the showing request is sent with your server's `SONOR_API_KEY`, which must never reach a browser.

| Export                                         | Docs                                                                   |
| ---------------------------------------------- | ---------------------------------------------------------------------- |
| `realEstateMcpTools(options)`                  | [MCP tools](https://sonor.dev/re-site-kit/mcp)                         |
| `realEstateMcpServerInfo(options, overrides?)` | [MCP tools](https://sonor.dev/re-site-kit/mcp#realestatemcpserverinfo) |
| `RealEstateMcpOptions` (type)                  | [MCP tools](https://sonor.dev/re-site-kit/mcp#options)                 |

## Peer dependencies

| Package              | Range                                         |
| -------------------- | --------------------------------------------- |
| `@sonordev/site-kit` | `>=4.3.0` (the MCP tools need 6.4.0 or later) |
| `next`               | `>=14.0.0`                                    |
| `react`, `react-dom` | `>=18.0.0`                                    |

These are the kit's own ranges. site-kit sets its own, narrower Next.js and React requirements, so in practice your site runs whatever versions its site-kit release supports.

The kit imports from these site-kit entry points: `@sonordev/site-kit/server` (the data layer and the showing request's config), `@sonordev/site-kit/client` (analytics events and conversions), `@sonordev/site-kit/forms` (`ManagedForm`) and `@sonordev/site-kit/mcp` (tool types). It never bundles site-kit; your site's own install provides it.
