The React SDK provides hooks and UI components to integrate Bible content and YouVersion authentication into React applications with minimal setup.
See the source on GitHub.
Two React packages are available:
@youversion/platform-react-ui - Fully styled components (includes hooks and authentication)
@youversion/platform-react-hooks - Headless data hooks only
Most developers should start with platform-react-ui which includes both.
Getting Started
Get a working Bible verse display with authentication in your app in under 5 minutes.
That's it! You now have Bible content with optional YouVersion authentication in your app.
If you need more flexibility of layout and styles, you can use BibleTextView along with appropriate
custom components of your own to display the verse reference and necessary attribution.
Requirements
React 19.1.0 or higher
react-dom 19.1.0 or higher
Installation
Install the packages with your preferred package manager:
You don't need to install both packages, the platform-react-hooks will get installed with the platform-react-ui as it is a dependency.
Code
npm install @youversion/platform-react-ui
Code
npm install @youversion/platform-react-hooks
Code
yarn add @youversion/platform-react-ui
Code
yarn add @youversion/platform-react-hooks
Code
pnpm add @youversion/platform-react-ui
Code
pnpm add @youversion/platform-react-hooks
Providers
YouVersionProvider
Required provider that configures the YouVersion Platform SDK. Wrap all your code which accesses YouVersion Platform features with YouVersionProvider. Authentication is optional and can be enabled with the includeAuth prop. If you set includeAuth={true} you must provide an authRedirectUrl.
Your authRedirectUrl must be in your Callback URI list in your app settings.
The YouVersionProvider uses conditional props for TypeScript safety:
Code
// Base propsinterface YouVersionProviderPropsBase { children: ReactNode; appKey: string; apiHost?: string;}// With authentication (authRedirectUrl becomes required when includeAuth is true)interface YouVersionProviderPropsWithAuth extends YouVersionProviderPropsBase { authRedirectUrl: string; includeAuth: true;}// Without authentication (authRedirectUrl cannot be used when includeAuth is false)interface YouVersionProviderPropsWithoutAuth extends YouVersionProviderPropsBase { includeAuth?: false; authRedirectUrl?: never;}// Final type is a union of the two configurationstype YouVersionProviderProps = YouVersionProviderPropsWithAuth | YouVersionProviderPropsWithoutAuth;
Components
The UI package includes fully styled, production-ready components for common Bible integration patterns.
BibleWidgetView
Pre-styled widget displaying a Bible passage with reference, text, and attribution.
Code
import { BibleWidgetView } from '@youversion/platform-react-ui'export default function Page() { return ( <BibleWidgetView reference="JHN.3.16" versionId={111} background="light" /> )}
Types
type BibleWidgetViewProps = { /** USFM passage reference (e.g., "JHN.3.16") */ reference: string; /** Bible version identifier */ versionId: number; /** Theme variant: light or dark */ background?: 'light' | 'dark';};
type BibleTextViewProps = { /** USFM reference (e.g., "JHN.3.16" or "PSA.23.1-6") */ reference: string; /** Bible version ID */ versionId: number; /** Font customization */ fontFamily?: string; fontSize?: number; lineHeight?: number; /** Show verse numbers (default: true) */ showVerseNumbers?: boolean; /** Show footnotes (default: true) */ renderNotes?: boolean;};
Important: When using the BibleTextView component, you are responsible for
displaying any required Bible version copyright notice, as required by the license.
This component gives you full flexibility over layout, so be sure to add copyright
or attribution credits yourself where appropriate in your UI.
If you want these credits handled for you automatically, use the BibleWidgetView component instead.
BibleReader
A complete Bible reading experience with version picker, chapter navigation, and customizable text display.
JWT Token Management: User information is extracted directly from JWT tokens, eliminating the need for separate API calls. The authentication uses PKCE (Proof Key for Code Exchange) OAuth flow for enhanced security.
Bible Content Hooks
useBibleClient
Returns a configured BibleClient instance for direct API calls.
If you're upgrading from a previous version that used YVPProvider and callback-based authentication, follow these steps:
Breaking Changes Summary
Provider Change: BibleSDKProvider → YouVersionProvider (complete replacement, no backwards compatibility)
Authentication Provider: YVPProvider eliminated - auth now integrated into YouVersionProvider
Hook Change: useAuthentication() → useYVAuth()
SignInButton Props: Simplified scopes and removed success callbacks
No Callback Page: OAuth redirects directly to your app (no /auth/callback needed)
JWT-based User Info: User information extracted from tokens (no /auth/me API calls)
Step-by-Step Migration
1. Update Your Provider
Before (Legacy SDK):
Code
// Old separate providers approachimport { YVPProvider, BibleSDKProvider } from '@youversion/platform-react-ui'<YVPProvider config={{ appKey, redirectUri }}> <BibleSDKProvider appKey={appKey}> {children} </BibleSDKProvider></YVPProvider>// OR just Bible content without auth<BibleSDKProvider appKey={appKey}> {children}</BibleSDKProvider>
After (Current SDK):
Code
import { YouVersionProvider } from '@youversion/platform-react-ui'// With authentication<YouVersionProvider appKey={appKey} includeAuth={true} authRedirectUrl={redirectUri}> {children}</YouVersionProvider>// Bible content only (no auth)<YouVersionProvider appKey={appKey}> {children}</YouVersionProvider>
Breaking Change: Neither BibleSDKProvider nor YVPProvider exist in the current version. You must migrate to YouVersionProvider.
✅ Better Performance: Direct JWT parsing, no additional API calls
✅ Unified Provider: Single provider for all features
✅ Automatic State Management: Authentication state updates automatically
Environment Variables
For Next.js applications, add these environment variables:
Code
# Required: Your YouVersion Platform App KeyNEXT_PUBLIC_YVP_APP_KEY=your-app-key-here# Required for Authentication: OAuth redirect URLNEXT_PUBLIC_REDIRECT_URI=https://yourapp.com# Optional: API host (defaults to api.youversion.com)NEXT_PUBLIC_YVP_API_HOST=api.youversion.com
Important: The redirect URI should point to your main application page, not a callback page. Make sure this matches the redirect URL configured in your YouVersion Platform app settings.
Copyright & Attribution
Legal requirement: You must display copyright attribution when showing Bible content. Most Bible translations are copyrighted works.
The UI components BibleWidgetView, BibleReader.Content, and VerseOfTheDay automatically
display copyright from version.copyright after the passage text.
If you're displaying scripture without using one of those components,
you are responsible for displaying appropriate attribution yourself. For example:
The copyright text comes from the BibleVersion object:
copyright - Brief attribution (use after verses)
promotional_content - Full copyright notice (use in settings/about pages)
Theming
The React SDK uses scoped CSS variables prefixed with --yv- to avoid conflicts with your app.
Passing Your App's Theme
Pass your app's theme to YouVersionProvider using the theme prop. This allows SDK components to automatically match your app's light/dark mode:
Code
import { YouVersionProvider } from '@youversion/platform-react-ui'function App() { const [theme, setTheme] = useState<'light' | 'dark'>('light') return ( <YouVersionProvider appKey="YOUR_APP_KEY" theme={theme} > {/* SDK components will automatically use the correct theme */} <BibleWidgetView reference="JHN.3.16" versionId={111} /> </YouVersionProvider> )}
When theme is set on the provider, all child components will inherit it. You can still override the theme on individual components using their background prop:
Code
<YouVersionProvider appKey="YOUR_APP_KEY" theme="dark"> {/* Uses dark theme from provider */} <BibleWidgetView reference="JHN.3.16" versionId={111} /> {/* Overrides to light theme */} <BibleReader.Root background="light"> <BibleReader.Content /> </BibleReader.Root></YouVersionProvider>