Provider Setup
Before using any hooks, wrap your app withYouVersionProvider:
Get an App Key: Register your application at the YouVersion Developer Portal to obtain an app key.
Hook Pattern
All data fetching hooks return a consistent shape:- data: The fetched data (null while loading or on error)
- loading: Boolean indicating if the request is in progress
- error: Error object if the request failed (null otherwise)
- refetch: Function to manually trigger a refetch
Fetching Passages
TheusePassage hook fetches a Bible passage by reference:
Conditional Fetching
Use theenabled option to control when the hook fetches data:
Fetching Bible Versions
TheuseVersions hook fetches available Bible versions:
Multiple Languages
Fetching a Single Version
TheuseVersion hook fetches metadata for a specific version:
Fetching Books
TheuseBooks hook fetches all books in a Bible version:
Verse of the Day
TheuseVerseOfTheDay hook fetches the daily verse:
Fetching Languages
TheuseLanguages hook fetches available Bible languages:
Filtered Versions
TheuseFilteredVersions hook provides advanced filtering:
Accessing API Clients
For advanced use cases, access the underlying API clients:Error Handling
Handle errors gracefully across your app:Performance: Manual Refetching
All hooks provide arefetch function for manual data updates:
Complete Example
Here’s a complete component combining multiple hooks:Next Steps
Displaying Bible Text
Learn how to render Bible passages
User Authentication
Implement YouVersion authentication
