Subpath map
Every entry point the package publishes, where each one can run, and everything it exports. Each entry ships as ESM and CommonJS with type declarations.
At a glance
| Import | Runs in | What's there |
|---|---|---|
@sonordev/agency-site-kit | Server | Everything: the layout, brand and API utilities, every type, and everything in /portfolio |
@sonordev/agency-site-kit/portfolio | Anywhere | The pure rules and the case study types |
@sonordev/agency-site-kit/portfolio/pure | Anywhere | The same pure rules, without the types or PORTFOLIO_SECTION_TYPES |
@sonordev/agency-site-kit/portfolio/server | Server | The fetchers, Next.js helpers and errors, plus every pure rule |
@sonordev/agency-site-kit/layout | Server | AgencySiteKitLayout and its props type |
@sonordev/agency-site-kit/revalidate | Route handler | createRevalidateHandler |
@sonordev/agency-site-kit/preview | Route handler | createPortfolioPreviewHandler |
Anywhere means no React, no network and no server guard: a server
component, a client component, a plain module or a test runner can all import
it. Server entries pull in @sonordev/site-kit's server-only guard, so
importing one from a client component fails the build (on purpose: that's
what keeps your API key out of the browser). Route handler entries use
next/cache or next/headers, so they belong in app/**/route.ts.
In a client component, import rules from /portfolio and types with
import type from wherever they live.
@sonordev/agency-site-kit/portfolio
The rules every renderer shares, and the types.
| Group | Exports |
|---|---|
| Proof | curatePortfolioProof, curateHeroKpis, curateResultItems, gateMetricsDeltas, headlineKpi, metricCredit, metricNote, formatMetricValue |
| Provenance contract | METRIC_SOURCES, isHeadlineMetric, metricSourceLabel, metricSourceProblem, formatAttribution, shortAttribution |
| Sections | PORTFOLIO_SECTION_ORDER, PORTFOLIO_SECTION_TYPES, orderedSections, sectionData, projectBrandColor |
| Devices | shouldRenderSoloDevice, resolveSoloScreenshot, isSoftwareCategory |
| JSON-LD | buildPortfolioJsonLd, jsonLdString |
| Images and labels | resolvePortfolioImage, formatCategoryLabel, formatServiceTag, formatIsoDate |
| Paths | sanitizeSiteArchitectureData, humanizeArchPageEntry |
| Types | PortfolioItem, PortfolioItemFull, PortfolioListResponse, PortfolioSection, PortfolioSectionType, PortfolioSectionData, PortfolioSectionDataMap, PortfolioKPI, MetricsDelta, MetricsSnapshot, MetricSource, MetricAttribution, every section's data type (PortfolioHeroData through PortfolioCTAData), PortfolioLighthouseScores, ProofRecord, HeadlineKpi, SoloDeviceInput, PortfolioJsonLdOptions, ResolvedPortfolioImage |
Pages: Proof and provenance, Sections and devices, Images, labels and paths, JSON-LD, Types.
@sonordev/agency-site-kit/portfolio/pure
The same functions and constants as /portfolio, and the helper types
(HeadlineKpi, SoloDeviceInput, PortfolioJsonLdOptions,
ResolvedPortfolioImage), without the case study types,
MetricSource, MetricAttribution or PORTFOLIO_SECTION_TYPES. It exists
for code that already imports it; new code can use /portfolio.
@sonordev/agency-site-kit/portfolio/server
| Group | Exports |
|---|---|
| Fetchers | getPortfolioItems, getPortfolioItem, getPortfolioCategories, getProofRecords, getPortfolioBrandConfig |
| Next.js helpers | generatePortfolioMetadata, generatePortfolioStaticParams, generatePortfolioCategoryStaticParams, generatePortfolioIndexMetadata, generatePortfolioSitemapEntries, slugifyCategory |
| Errors | PortfolioApiError, PortfolioContractError, assertPortfolioItemShape |
| Cache | PORTFOLIO_CACHE_TAG ('portfolio') |
| Types | PortfolioSitemapEntry, and the helper types from /portfolio/pure |
| Rules | Every function and constant from /portfolio/pure, so a server component needs one import |
It doesn't export the case study types; take those from /portfolio. See
Fetching.
@sonordev/agency-site-kit
The root entry. It includes everything in /portfolio, plus:
| Group | Exports |
|---|---|
| Layout | AgencySiteKitLayout (its props type is in /layout) |
| Brand | generateBrandCSS, mergeBrandConfig, hexToRgb, DEFAULT_BRAND_CONFIG, DEFAULT_DARK_MODE |
| API | apiFetch, apiGet, getApiConfig |
| Types | BrandConfig, SanityImageRef, PortfolioConfigResponse, and the item-level types inside sections: PortfolioChallengeItem, PortfolioStrategyPhase, PortfolioResultItem, PortfolioTechItem, PortfolioServiceItem, PortfolioGalleryImage, PortfolioTeamMember, PortfolioAnnotation, PortfolioMetricsDataPoint, PortfolioFunnelStage |
It doesn't include the fetchers, the route handlers or
PORTFOLIO_CACHE_TAG. See Brand layout and
Fetching.
@sonordev/agency-site-kit/layout
AgencySiteKitLayout and AgencySiteKitLayoutProps. See
Brand layout.
@sonordev/agency-site-kit/revalidate
createRevalidateHandler, CreateRevalidateHandlerOptions and
PORTFOLIO_CACHE_TAG. See Live updates and preview.
@sonordev/agency-site-kit/preview
createPortfolioPreviewHandler and PortfolioPreviewHandlerOptions. See
Live updates and preview.
Also in the package
| Path | What it is |
|---|---|
agency-site-kit-setup (bin) | The setup CLI. See Quickstart. |
templates/ | The files the CLI copies into a site, laid out the way they land |
Peer dependencies
| Package | Version |
|---|---|
@sonordev/site-kit | >= 6.5.0 |
next | >= 14.0.0 |
react, react-dom | >= 18.0.0 |
@sonordev/site-kit is never bundled into the kit: your site's one install
provides it, so the two always agree.