Skip to content

Created/edited by GitHub Copilot; pending human review.

Package imports and exports ​

The toolkit has 3 packages. This page lists each package's import paths and the names each path exports. It's generated from the packages' export maps and type declarations.

Each package ships its own TypeScript types. To choose between the script tag and the packages, or to install a package, see Install and status.

Which release this describes ​

This page documents the code on the main branch. The source stamp is not an npm release or a development snapshot. This copy was built from commit 6fde603.

Install an exact npm version or use a version-pinned npm CDN module. The npm alpha tag moves between reviewed prereleases. It is not a main-build snapshot. Older pinned releases keep their own behavior and can lack APIs added since. Install and status lists package commands and jsDelivr/UNPKG files.

Register the elements ​

Import the web components package root once to register all the elements:

js
import "@sefaria/web-components";

Only the package root registers elements. Element subpaths such as @sefaria/web-components/source-card, @sefaria/web-components/data-source, and @sefaria/web-components/reader-session export types and helpers. Import them alongside the package root, not instead of it.

The client package root re-exports the generated namespaces, contracts, schemas, validators, errors, validation helpers, and client factory. Import createSefariaClient from @sefaria/api-client or @sefaria/api-client/client. Import focused error and validation helpers from @sefaria/api-client/errors and @sefaria/api-client/validation.

@sefaria/api-client ​

Source-backed Sefaria API client with generated contracts, validators, and bounded caching. Package manifest version: 0.1.0-alpha.0. This is not evidence of publication. Reference.

Import pathExports
@sefaria/api-client585 names; see the client reference
@sefaria/api-client/clientSefariaCacheOptions, SefariaClient, SefariaClientOptions, createSefariaClient, requireSefariaClient
@sefaria/api-client/contracts313 names; see the client reference
@sefaria/api-client/errorsContractIssue, SefariaContractError, SefariaContractErrorOptions
@sefaria/api-client/schemas181 names; see the client reference
@sefaria/api-client/validationGeneratedResponseContract, ResponseSelector, ResponseValidationContext, ResponseValidatorLookup, ValidationResult, getResponseContract, getResponseValidator, validateExternalResponse, validateResponse
@sefaria/api-client/validators65 names; see the client reference

@sefaria/text-transform ​

Pure Sefaria text normalization, vocalization, footnote, and preview utilities. Package manifest version: 0.1.0-alpha.0. This is not evidence of publication. Reference.

Import pathExports
@sefaria/text-transformCommentaryReference, NormalizeTextOptions, NormalizedFootnote, NormalizedText, PaseqMode, TextPreview, VocalizationMode, VocalizationOptions, applyVocalization, applyVocalizationToHtml, createTextPreview, normalizeText

@sefaria/web-components ​

Declarative Sefaria web components backed by corrected client payloads and safe text transforms. Package manifest version: 0.1.0-alpha.0. This is not evidence of publication. Reference.

Import pathExports
@sefaria/web-componentsBilingualPairContentLanguage, BilingualPairLayout, BilingualPairSide, BilingualPairSideOrder, BilingualSegmentContentLanguage, BilingualSegmentEditionSelection, BilingualSegmentLayout, BilingualSegmentRequest, BilingualSegmentSide, BilingualSegmentSideOrder, CONNECTIONS_PAGE_SIZE, ConnectionsProjection, ConnectionsRequest, ReaderPane, SefariaBilingualSegment, SefariaConnectionsPanel, SefariaDataLoader, SefariaDataLoaderResponse, SefariaDataSource, SefariaElement, SefariaElementStatus, SefariaLinksLoadRequest, SefariaReader, SefariaSourceCard, SefariaTextLoadRequest, SefariaTextSegment, SourceCardRequest, TextSegmentReferenceData, TextSegmentRequest, TextSegmentSelectedData, TextSegmentSelectedVersion, TextSegmentSelectedVersionInfo, TextSegmentVersionMetadata, TextSegmentVersionSelection, configureSefariaDataSource, sefariaTokenDefaults
@sefaria/web-components/data-sourceSefariaDataLoader, SefariaDataLoaderResponse, SefariaDataSource, SefariaLinksLoadRequest, SefariaTextLoadRequest, configureSefariaDataSource
@sefaria/web-components/bilingual-segmentBilingualSegmentEditionSelection, BilingualSegmentRequest, BilingualSegmentSide
@sefaria/web-components/connections-panelCONNECTIONS_PAGE_SIZE, ConnectionsProjection, ConnectionsRequest
@sefaria/web-components/readerReaderPane, ReaderRecordLoader, ReaderResolvedSource, createSefariaReaderRecordLoader, resolveReaderSource
@sefaria/web-components/reader-sessionReaderBreadcrumb, ReaderConnectionsRecord, ReaderEntryInfo, ReaderOperationHandle, ReaderPinHandle, ReaderPresentation, ReaderPresentationPatch, ReaderSession, ReaderSessionConnectionsSeed, ReaderSessionOptions, ReaderSessionSeed, ReaderSessionSourceSeed, ReaderSessionState, ReaderSourceRecord, ReaderTransition, ReaderTransitionRejection, createReaderSession
@sefaria/web-components/source-cardSourceCardRequest
@sefaria/web-components/text-segmentTextSegmentReferenceData, TextSegmentRequest, TextSegmentSelectedData, TextSegmentSelectedVersion, TextSegmentSelectedVersionInfo, TextSegmentVersionMetadata, TextSegmentVersionSelection

Where to go next ​

Sefaria Frontend ToolkitCommunity-driven with Sefaria backing and support. GitHub Get support

AI-generated documentation.

About this documentation

Like the codebase, this documentation was scaffolded and written with GitHub Copilot. I don't have a background in technical writing, and wanted to get something out there.

Pages that have not undergone any human review are explicitly marked, but the others may also read funny or need work too. Sorry about that.

Please report any issues so they can be prioritized.

Thanks, Avi