A unified Bible data SDK, with optional drop-in Scripture components for web pages.
A community project. Bible text from AO Lab's Free Use Bible API, with no API key. YouVersion, fetch.bible, and server-only API.Bible are optional adapters. Use the DOM-free data API on its own, or add the reference finder and web components.
Bible data SDK
Discover versions, books, and chapters, and retrieve Scripture with attribution and display guidance. The data SDK works in a browser, Node, or Bun without components, DOM access, CSS injection, or page-wide component defaults. API.Bible is server-only because its API key is private.
Import /data for async/await, or /data/effect for native Effect programs. Both use the same Effect v4 implementation, validation, errors, and caching. AO Lab is the default; choose a provider to use another source.
Install the package. You do not need to import or directly install Effect for async/await. Effect remains a transitive runtime dependency and contributes to bundle size.
The example returns John 3:16–18 as passage.text, with separate attribution and instructions. See the passage data reference for result fields and supported passage IDs.
Native Effect API
If your application uses Effect, install effect@^4 directly and import from /data/effect. Methods return lazy Effects with the same results and ScriptureError in the failure channel.
The same discovery and passage example, composed as one Effect program:
Use Effect.catchTag("ScriptureError", ...) for expected failures. Layers, RequestPolicy, and service-based scripture programs are exported from /data/effect, not /data. See Effect configuration and custom providers for composition and testing.
Verse of the day
Get a daily verse or short passage with the same attribution, licenses, source limitations, and display instructions as any other passage. Available in /data and /data/effect, including service-based scripture.getVerseOfTheDay() with a BibleSource Layer.
getVerseOfTheDay({ date?, versionId?, calendarSource? }) returns { date, calendarSource: { provider, sourceUrl }, passage }. calendarSource chooses the daily reference calendar, not the Bible text provider; it defaults to "provider", the selected provider's native calendar. The full ScripturePassage is in passage. Pass a real YYYY-MM-DD date, not a timestamp, or omit it for the runtime's local date when the operation executes. On a server, pass the reader's date explicitly if their timezone differs. Invalid dates fail with invalid_reference.
| Provider | Native calendar | Daily selection |
|---|---|---|
| AO Lab | Supported | Its SDK follows a shared, deterministic yearly order with Christian holidays, using an MIT-licensed reference dataset. |
| YouVersion | Supported | Its calendar API accepts day 1-366, with no year parameter. The SDK accepts only dates in the runtime's current year, not historical or future-year lookups. This does not promise a published schedule for future days. |
| fetch.bible | No native calendar documented | Its client API provides Bible text, not daily selections. Opt into the shared calendar. |
| API.Bible | No native calendar documented | Its daily-verse tutorial uses an app-owned reference list, not a calendar endpoint. Opt into the shared calendar with a data adapter. |
Check scripture.capabilities.verseOfTheDay to label or disable a provider-calendar option: true for AO Lab and YouVersion, false for fetch.bible and API.Bible. This reports implementation, not credentials, translation availability, or rights. Without native support, the default call fails with unsupported and makes no calendar request. Existing custom providers remain compatible; an optional BibleDataProvider.getVerseOfTheDay(date) can return an Effect of { passageId, sourceUrl }.
Use the shared reference calendar
Opt in explicitly with any data provider. Only the reference comes from AO Lab; Scripture text still comes from your selected provider and version.
daily.calendarSource identifies the calendar separately from daily.passage.provider. This is AO Lab's selection, not another provider's own daily verse. There is no automatic fallback after authentication, network, or availability failures. Missing content fails with unavailable; the SDK never replaces the verse or translation. The reference list uses standard English/BSB numbering; cross-provider versification differences remain possible, not automatically mapped.
The list contains references, not Scripture text. Its MIT license does not grant translation rights. Follow each translation's license for fetch.bible and AO Lab. YouVersion still requires your public app key, publisher agreements, attribution, and applicable paid-app and AI-use conditions. API.Bible still requires your own server-side credentials, applicable plan and translation permissions, copyright display, FUMS web-display reporting, and refreshing cached content within 30 days. Passage instructions remain intact; no new persistent caching or offline rights are established. Verse art and devotional content are not included.
For the existing <bible-sdk-passage>, set passage-id to daily.passage.passageId and use the same provider and version. The data API does not register components or start an automatic midnight refresh; call it again when your app needs a new day's verse.
Choose a Bible provider
Use AO Lab by default, or select fetch.bible, YouVersion, or API.Bible. All four support the same data API; API.Bible runs only on your server. Each client uses one provider; it never substitutes a translation or falls back to another source.
| Provider | Setup | Default version ID |
|---|---|---|
| AO Lab | No API key. Default provider. | BSB |
| fetch.bible | No API key. Declare your usage. | eng_bsb |
| YouVersion | Requires a public app key. | 3034 |
| API.Bible | Your own private key and official SDK client, server-only. | Explicitly choose an accessible edition. |
API.Bible requires server-side setup
Keep your API.Bible key on your server. For browser components, use your app's backend or a compatible serverless function to fetch passages. You do not need a separate proxy service.
If your site only serves static files, add a server endpoint or choose AO Lab for a browser-only setup without an API key.
Version IDs belong to one provider: BSB, eng_bsb, and 3034 are not interchangeable. Review the selected translation's license before use. Free access and usage filters do not grant commercial, redistribution, or offline rights.
YouVersion has additional paid-app and AI-use conditions. Review the YouVersion requirements before using that adapter.
AO Lab: use the default
AO Lab preserves headings, poetry, and words-of-Jesus formatting in native HTML when supplied by the translation. Its license notice, or the translation name linked to the license, appears below the displayed text. To create a separate provider instance, import createAOLabProvider from @faith-tools/bible-sdk/providers/ao-lab.
Use aoLabProvider, createAOLabProvider(), and provider: "ao-lab" for new code. The old helloaoProvider, createHelloAOProvider(), /providers/helloao import path, and provider: "helloao" input remain supported as deprecated aliases. Daily-verse selection uses calendarSource: "ao-lab"; calendarSource: "helloao" is also a deprecated alias. Returned provider IDs (including event details and daily calendar provenance) remain helloao, and tracing identifiers and upstream URLs stay unchanged. This additive migration does not change the source or its data.
fetch.bible: declare your usage
Set usage.commercial to your application's actual use. The example declares noncommercial use. The derivatives, attributionless, and limitless filters default to false, false, and true. Filters are not legal permission; review each translation's terms. The adapter uses the official collection.
API.Bible: your own server-side client
Browser components use your server. Create an endpoint on your backend or a compatible serverless function. The component requests passages from that endpoint; only your server sends the private key to API.Bible. See the passage component example.
Install the official SDK alongside Bible SDK on a Node 20+ or Bun server. This adapter uses the node export condition; other server runtimes need Node-compatible package resolution:
Each application supplies its own registered API.Bible account/key and applicable licenses. Bible SDK supplies adapter code, not shared-account access. Keep the key in a server secret, never a browser bundle, VITE_* variable, element attribute, URL, or log. The adapter export rejects browser resolution and construction; that does not replace keeping secrets out of client code.
Set upstream maxAttempts: 1 so Effect owns retries and deadlines. Avoid SDK hooks/custom transports that log credentials or response bodies. Choose defaultVersionId from your account's listVersions() results. No edition is chosen automatically. Chapters exclude intro entries; plain text preserves scriptural superscriptions and poetry line breaks, not style-derived indentation, alignment, italics, or small caps. It omits editorial headings and notes. Numbering remains unknown. Incomplete endpoint coverage fails rather than silently claiming the whole range; upstream passages can be limited to 200 verses.
Application obligations: review the Terms, AUP and account agreements, and each translation's metadata. Returned instructions are guidance, not certification of compliance.
- Display reporting: report
reporting.tokenfor each actual web view to FUMS, including cache hits, not fetches/prefetches. The host owns device/session IDs and privacy requirements. No analytics are sent automatically. - Attribution: show attribution and links below Scripture, identify the translation, and provide the required linked copyright/about page. Preserve
publisher.copyrightHtmlandpublisher.infoHtml; sanitize this untrusted upstream HTML before rendering. Keep the visible API.Bible source link. - Caching and removal: discovery/publisher caches refresh after 14 days. Refresh downstream copies by
cache.expiresAt(epoch milliseconds), never retain metadata/content over 30 days without refresh, and honor shorter removal/revocation deadlines. Some requests require removal within 24 hours; termination provisions can require immediate deletion. A TTL is not offline permission. - Plan and content restrictions: Starter is noncommercial even for public-domain editions. Each app owner accepts the required account agreements, including the Statement of Orthodoxy, and checks licenses, content integrity, territorial/export restrictions, and economic sanctions. Violations can lead to suspension/revocation, removal duties, audits, fees, and indemnification.
- DRM and AI: the terms require application-level DRM restricting copying/distribution, printing over 100 verses, territory and device counts, without specifying a universally compliant implementation. A private key alone does not satisfy that obligation. Express Licensing guidance restricts copyrighted and Creative Commons Scripture in LLM prompts as well as training. Public-domain runtime prompts are permitted; confirm training, TTS, and exports separately.
API.Bible in the passage component
The same server provider implements getPassageDisplay(versionId, passageId). It requests native HTML once, validates coverage, sanitizes unsafe markup, and preserves USX classes for poetry, scriptural titles, small caps, italics, and tables. The component loads a reviewed, commit-pinned copy of the official Scripture Styles inside its shadow root. This CSS is optional under API.Bible's guidance, not a required design. Customize it with --scripture-*; theme, verse-number, heading, and direction controls still work. Omit red-letter to keep the official muted .wj styling, use red-letter="on" to color marked words of Jesus red, or use red-letter="off" for the text color. These controls require the translation to supply words-of-Jesus markers. Hiding editorial headings leaves scriptural Psalm titles visible.
Keep the provider on your server and expose safe displays through your own endpoint. Pass a browser provider to defineScripturePassage, not the server provider. There is no private-key attribute or built-in provider="api-bible" string option.
Add your app's authentication, rate limits, edition/access controls, and privacy-aware FUMS integration. This example does not create a public shared-key proxy. The translation picker can use the same browser provider through defineVersionInput({ provider }).
copyrightUrl is required for display, not plain-text data access. Every quotation page gets a visible link. Populate that page with sanitized publisher.copyrightHtml and publisher.infoHtml, the full translation name/abbreviation, the exact current dashboard/Appendix A citation, and a clickable rights-holder link. Raw metadata alone does not guarantee a complete notice. Applicable direct publisher formatting/citation agreements take precedence; resolve conflicts with API.Bible's remaining minimum requirements before use.
scripture-load.detail.reporting carries the FUMS token after rendering; detail.cache.expiresAt carries the absolute refresh deadline. Connect this to your actual-view reporter, including later cached displays. Rendered does not mean visible: hidden/offscreen components and prerenders need host visibility handling. Layout/theme changes do not fire another load event. No analytics are sent automatically. Cached displays refresh on the next load at the deadline; the host must refresh/remove long-lived mounted displays and honor earlier revocations. Expired server data causes an error instead of stale Scripture.
YouVersion: add a public app key
Get a public app key from YouVersion Platform. Replace YOUR_PUBLIC_APP_KEY in this example:
YouVersion requirements
YouVersion has no commercial-use flag. Its Platform terms do not grant Bible-content rights. Check the selected publisher's license and applicable Tool terms.
- Paid applications are permitted subject to conditions, including conspicuously stating that the YouVersion Bible App is free. This is neither blanket permission nor a blanket commercial prohibition.
- The terms prohibit using Tools with AI for open-ended user chat except to retrieve and display Scripture verbatim.
- The terms prohibit using Tools to train, develop, refine, or improve AI. Cases beyond expressly permitted uses need prior written YouVersion approval.
- AI-assisted engineering and content generation have separate permissions and conditions in those terms.
These requirements also appear in returned YouVersion instructions.
Use providers with browser components
With a bundler, pass the same provider object to the components and reference finder. This example uses fetch.bible; use an AO Lab or YouVersion provider object in the same way:
For an individual passage or translation picker, assign element.bibleProvider = provider. Remove any provider attribute because it takes precedence. fetch.bible requires a bundler import; it is not a script-tag provider name.
Script tags support AO Lab by default and YouVersion through explicit settings: