@midvash/bible-data
TypeScript / JavaScript SDK for the bible-data dataset — fetch verses, chapters, and books.
Typed API over the bible-data dataset, published on npm as @midvash/bible-data. Works in Node 18+ (native fetch), in browsers, and in edge runtimes (Cloudflare Workers, Vercel Edge). Exposes functions like getVerse(slug, book, chapter, verse), getChapter, getBook, getBible, and getVersionMetadata, plus constants like ALL_VERSION_SLUGS, VERSIONS_BY_LANGUAGE, KNOWN_LANGUAGES, and BOOK_IDS. Accepts custom configuration via configure({ baseUrl, fetch }) — useful to pin a specific dataset release or to inject a fetch with caching, retries, or mocking. Books are identified by OSIS codes (Gen, Exod, …, Rev). MIT license. Texts served by the library follow each version's individual license (declared in bible-data).
- getVerse / getChapter / getBook / getBible
- Constants ALL_VERSION_SLUGS, VERSIONS_BY_LANGUAGE, BOOK_IDS
- Configurable: custom baseUrl, custom fetch
- Works in Node, browser, and edge runtimes
- Full TypeScript types
- Zero dependencies
npm install @midvash/bible-data import { getVerse, getChapter, getBook } from '@midvash/bible-data';
// John 3:16 in the King James Version
const verse = await getVerse('kjv', 'John', 3, 16);
console.log(verse.text);
// "For God so loved the world, that he gave his only begotten Son..."
// All of John 3 in the World English Bible
const chapter = await getChapter('web', 'John', 3);
// The whole book of Genesis in Latin (Vulgate)
const genesis = await getBook('vulg', 'Gen'); Found a bug, missing data, or want to add something? Pull requests and issues are welcome at github.com/midvash/bible-data-js .