# ScriptureFlow JavaScript examples

These dependency-free Node.js examples use the built-in `fetch` API. Use Node.js 18 or newer.

```bash
node examples/javascript/get-verse.js
node examples/javascript/quick-verse.js
```

- [`get-verse.js`](get-verse.js) looks up John 3:16 in `en-kjv` with `URLSearchParams`.
- [`quick-verse.js`](quick-verse.js) requests a runtime-selected verse that may differ between runs.

Both examples check the HTTP response, the ScriptureFlow JSON `ok` field, and the required `reference`, `version`, and `text` fields. They exit with a clear error instead of inventing or substituting Scripture text.

No API key is required during public preview. Discover exact, case-sensitive version keys from <https://scriptureflow-api-preview.pages.dev/translations.json>. Some translations may be partial, so verify available books before building broader workflows.

The examples default to <https://scriptureflow-api-preview.pages.dev> and `en-kjv`. For local error-handling tests, you may override `SCRIPTUREFLOW_BASE_URL` or `SCRIPTUREFLOW_VERSION`.
