@bible-engine/client
TypeScript icon, indicating that this package has built-in type declarations

1.4.6 • Public • Published

@bible-engine/client

Install

The package can be installed via yarn or npm as usual.

Usage (local database with server fallback)

import { BibleEngineClient } from '@bible-engine/client';

const beClient = new BibleEngineClient({
    bibleEngineConnectionOptions: {
        type: 'capacitor',
        driver: this.sqlite, // specific for the capacitor-typeorm-driver, you have to pass the sqlite driver
        journalMode: 'WAL',
        name: 'bibleEngine',
        database: `bibles_${environment.dbBiblesVersion}`,
        synchronize: false,
        logging: ['error'],
    },
    apiBaseUrl: 'https://bible-engine.example.test/api', // the URL to the BibleEngine server
});

// access data from where it's available
const bibleData = await beClient.getReferenceRange({ ... });

// access local BibleEngine directly
const localVersions = await beClient.localBibleEngine.getVersions('en');

// access server directly (you can use intellisense to get a list of all available api methods)
const remoteVersions = await beClient.remoteApi.getVersions('en');

Usage (remote only)

If you only want to access BibleEngine through a server, it is enough to use the API client directly:

import { BibleApi } from '@bible-engine/client';

const beApi = new BibleApi(apiBaseUrl);
const bibleData = await beApi.getReferenceRage({...});

Dependencies (1)

Dev Dependencies (0)

    Package Sidebar

    Install

    npm i @bible-engine/client

    Weekly Downloads

    5

    Version

    1.4.6

    License

    none

    Unpacked Size

    43.9 kB

    Total Files

    21

    Last publish

    Collaborators

    • troyhonegger
    • emmaus
    • danbennett42