The React SDK provides hooks and UI components to integrate Bible content and YouVersion authentication into React applications with minimal setup.
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.
1. Get Your App Key and Configure OAuth
Sign up at platform.youversion.com to get your free App Key
Configure your OAuth redirect URL in your app settings (this should point to your app's main page, not a callback page)
2. Install
npm install @youversion/platform-react-ui
3. Add Provider
Wrap your app's contents with YouVersionProvider (authentication is optional):
import { YouVersionProvider } from '@youversion/platform-react-ui'
function App () {
return (
< YouVersionProvider
appKey = "YOUR_APP_KEY"
includeAuth = { true }
authRedirectUrl = "https://yourapp.com"
>
{ /* Your app */ }
</ YouVersionProvider >
)
}
The authRedirectUrl must match the redirectUrl that you specified in your app settings.
Common mistake: Forgetting to add YouVersionProvider will cause hooks to throw errors. Make sure it wraps your entire app.
4. Display a Verse
import { BibleWidgetView } from '@youversion/platform-react-ui'
function MyComponent () {
return (
< BibleWidgetView
reference = "JHN.3.16"
versionId = { 111 }
/>
)
}
5. Add Authentication Button (Sign in/Sign out) (Optional)
import { YouVersionAuthButton } from '@youversion/platform-react-ui'
function MyComponent () {
return (
< YouVersionAuthButton
permissions = {[SignInWithYouVersionPermission.bibles]}
redirectUrl = "https://yourapp.com"
/>
);
}
6. Use Authentication hook to get user information
import { useYVAuth } from '@youversion/platform-react-ui'
import { YouVersionAuthButton } from '@youversion/platform-react-ui'
function UserProfile () {
const { auth , userInfo } = useYVAuth ();
if (auth.isLoading) {
return < div >Loading...</ div >;
}
if ( ! auth.isAuthenticated) {
return < div >Please sign in</ div >;
}
return (
< div >
< h2 >Welcome, {userInfo?.name}!</ h2 >
< p >Email: {userInfo?.email}</ p >
< p >User ID: {userInfo?.userId}</ p >
< YouVersionAuthButton
mode = "signOut"
redirectUrl = "https://yourapp.com"
/>
</ div >
);
}
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:
npm install @youversion/platform-react-ui @youversion/platform-react-hooks
yarn add @youversion/platform-react-ui @youversion/platform-react-hooks
pnpm add @youversion/platform-react-ui @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.
import { YouVersionProvider } from '@youversion/platform-react-ui'
function App () {
return (
< YouVersionProvider
appKey = "YOUR_APP_KEY"
includeAuth = { true }
authRedirectUrl = "https://yourapp.com"
>
{ /* Your app */ }
</ YouVersionProvider >
)
}
Props:
The YouVersionProvider uses conditional props for TypeScript safety:
// Base props
interface 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 configurations
type 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.
import { BibleWidgetView } from '@youversion/platform-react-ui'
export default function Page () {
return (
< BibleWidgetView
reference = "JHN.3.16"
versionId = { 111 }
background = "light"
/>
)
}
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' ;
};
BibleTextView
Display any Bible passage with proper formatting.
import { BibleTextView } from '@youversion/platform-react-ui'
const BIBLE_VERSION_ID = 111 ;
function MyComponent () {
const version = useVersion ( BIBLE_VERSION_ID );
return (
< BibleTextView
reference = "JHN.3.16"
versionId = { 111 }
fontFamily = "serif"
fontSize = { 20 }
lineHeight = { 1.5 }
/>
)
}
Props:
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 ;
};
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.
import { BibleReader } from '@youversion/platform-react-ui'
function App () {
return (
< div className = "h-screen" >
< BibleReader.Root >
< BibleReader.Content />
< BibleReader.Toolbar />
</ BibleReader.Root >
</ div >
)
}
Props:
type BibleReaderRootProps = {
/** Controlled book ID (3-letter USFM code like "JHN") */
book ?: string ;
/** Default book when uncontrolled */
defaultBook ?: string ;
onBookChange ?: ( book : string ) => void ;
/** Controlled chapter number */
chapter ?: string ;
/** Default chapter when uncontrolled */
defaultChapter ?: string ;
onChapterChange ?: ( chapter : string ) => void ;
/** Controlled version ID */
versionId ?: number ;
/** Default version when uncontrolled (default: 111 - NIV) */
defaultVersionId ?: number ;
onVersionChange ?: ( versionId : number ) => void ;
/** Font customization */
fontFamily ?: string ;
fontSize ?: number ;
lineHeight ?: number ;
/** Toggle verse numbers (default: true) */
showVerseNumbers ?: boolean ;
/** Theme (default: "light") */
background ?: "light" | "dark" ;
children ?: ReactNode ;
};
Sub-components:
BibleReader.Root - Container with context provider
BibleReader.Content - Displays passage text with book/chapter header
BibleReader.Toolbar - Version and chapter picker controls
Examples:
// Dark theme with custom styling
< BibleReader.Root
background = "dark"
fontSize = { 18 }
lineHeight = { 2.0 }
showVerseNumbers = { false }
>
< BibleReader.Toolbar border = "bottom" />
< BibleReader.Content />
</ BibleReader.Root >
// Controlled state
function ControlledReader () {
const [ book , setBook ] = useState ( 'PSA' )
const [ chapter , setChapter ] = useState ( '23' )
return (
< BibleReader.Root
book = {book}
chapter = {chapter}
onBookChange = {setBook}
onChapterChange = {setChapter}
>
< BibleReader.Content />
< BibleReader.Toolbar />
</ BibleReader.Root >
)
}
VerseOfTheDay
Display the YouVersion Verse of the Day.
import { VerseOfTheDay } from '@youversion/platform-react-ui'
function MyApp () {
return < VerseOfTheDay versionId = { 111 } />
}
Props:
type VerseOfTheDayProps = {
/** Bible version ID (default: 111 - NIV) */
versionId ?: number ;
/** Day of year (1-366). Defaults to today */
dayOfYear ?: number ;
/** Show decorative sun icon (default: true) */
showSunIcon ?: boolean ;
/** Show Bible App attribution (default: true) */
showBibleAppAttribution ?: boolean ;
/** Show share button (default: true) */
showShareButton ?: boolean ;
/** Card size (default: "default") */
size ?: "default" | "lg" ;
};
BibleChapterPicker
Popover-based interface for selecting books and chapters.
import { BibleChapterPicker } from '@youversion/platform-react-ui'
export default function Page () {
return (
< BibleChapterPicker.Root
versionId = { 111 }
defaultBook = "JHN"
onBookChange = {( book ) => console. log (book)}
onChapterChange = {( chapter ) => console. log (chapter)}
>
< BibleChapterPicker.Trigger >
Select Chapter
</ BibleChapterPicker.Trigger >
</ BibleChapterPicker.Root >
)
}
BibleChapterPicker.Root
type RootProps = {
book ?: BibleBook [ 'id' ];
defaultBook ?: BibleBook [ 'id' ];
onBookChange ?: ( book : BibleBook [ 'id' ]) => void ;
chapter ?: string ;
defaultChapter ?: string ;
onChapterChange ?: ( chapter : string ) => void ;
versionId : number ;
background ?: 'light' | 'dark' ;
children ?: ReactNode ;
};
See also: BibleBook
BibleChapterPicker.Trigger
The button or component that toggles the Bible Chapter Picker popover.
BibleVersionPicker
Popover-based interface for selecting Bible versions with language filtering and search.
import { BibleVersionPicker } from '@youversion/platform-react-ui'
export default function Page () {
return (
< BibleVersionPicker.Root
versionId = { 111 }
onVersionChange = {( versionId ) => console. log (versionId)}
>
< BibleVersionPicker.Trigger >
Select Version
</ BibleVersionPicker.Trigger >
< BibleVersionPicker.Content />
</ BibleVersionPicker.Root >
)
}
BibleVersionPicker.Root
type RootProps = {
versionId : number ;
onVersionChange ?: ( versionId : number ) => void ;
background ?: 'light' | 'dark' ;
side ?: 'top' | 'right' | 'bottom' | 'left' ;
children ?: ReactNode ;
};
See also: BibleVersion
BibleVersionPicker.Trigger
The button or component that toggles the Bible Version Picker popover. Shows the current version's abbreviation.
BibleVersionPicker.Content
The popover content displaying available versions with language selection, search, and filtering.
YouVersionAuthButton
Pre-styled button for YouVersion authentication with multiple variants and themes that can handle both sign-in and sign-out.
import { YouVersionAuthButton, SignInWithYouVersionPermission } from '@youversion/platform-react-ui'
export default function LoginPage () {
return (
< YouVersionAuthButton
permissions = {[SignInWithYouVersionPermission.bibles]}
redirectUrl = "https://yourapp.com"
onAuthError = {( error ) => console. error ( 'Auth error:' , error)}
/>
)
}
Props:
interface YouVersionAuthButtonProps extends React . ButtonHTMLAttributes < HTMLButtonElement > {
/** OAuth permissions (optional, defaults to empty array) */
permissions ?: SignInWithYouVersionPermissionValues [];
/** OAuth redirect URL (required) */
redirectUrl : string ;
/** Error handler for authentication errors */
onAuthError ?: ( error : Error ) => void ;
/** Button variant (default: "default") */
variant ?: "default" | "outline" ;
/** Button size (default: "default") */
size ?: "default" | "short" | "icon" ;
/** Theme variant (default: "light") */
background ?: "light" | "dark" ;
/** Border radius (default: "rounded") */
radius ?: "rounded" | "rectangular" ;
/** Button mode (default: "auto") */
mode ?: "signIn" | "signOut" | "auto" ;
}
Available Permissions:
enum SignInWithYouVersionPermission {
bibles = 'bibles' ,
highlights = 'highlights' ,
votd = 'votd' ,
demographics = 'demographics' ,
bibleActivity = 'bibleActivity' ,
}
Examples:
// Different variants
< YouVersionAuthButton
variant = "outline"
permissions = {[SignInWithYouVersionPermission.bibles]}
redirectUrl = "https://yourapp.com"
/>
// Dark theme
< YouVersionAuthButton
background = "dark"
permissions = {[SignInWithYouVersionPermission.bibles]}
redirectUrl = "https://yourapp.com"
/>
// Icon only
< YouVersionAuthButton
size = "icon"
permissions = {[SignInWithYouVersionPermission.bibles]}
redirectUrl = "https://yourapp.com"
/>
// Multiple permissions
< YouVersionAuthButton
permissions = {[
SignInWithYouVersionPermission.bibles,
SignInWithYouVersionPermission.highlights,
SignInWithYouVersionPermission.demographics
]}
redirectUrl = "https://yourapp.com"
/>
// Explicit sign-in mode
< YouVersionAuthButton
mode = "signIn"
permissions = {[SignInWithYouVersionPermission.bibles]}
redirectUrl = "https://yourapp.com"
/>
// Explicit sign-out mode
< YouVersionAuthButton
mode = "signOut"
redirectUrl = "https://yourapp.com"
/>
// Auto mode (default) - shows sign-in when not authenticated, sign-out when authenticated
< YouVersionAuthButton
mode = "auto"
permissions = {[SignInWithYouVersionPermission.bibles]}
redirectUrl = "https://yourapp.com"
/>
Authentication Hooks
useYVAuth
Main hook for managing YouVersion authentication state. Provides access to authentication status, user information, and sign-out functionality.
import { useYVAuth } from '@youversion/platform-react-ui'
function UserProfile () {
const { auth , userInfo , signOut } = useYVAuth ();
if (auth.isLoading) {
return < div >Loading...</ div >;
}
if ( ! auth.isAuthenticated) {
return < div >Please sign in</ div >;
}
return (
< div >
< h2 >Welcome, {userInfo?.name}!</ h2 >
< p >Email: {userInfo?.email}</ p >
< p >User ID: {userInfo?.userId}</ p >
< button onClick = {() => signOut ()}>Sign Out</ button >
</ div >
);
}
Return Type:
type UseYVAuthReturn = {
auth : {
isLoading : boolean ;
isAuthenticated : boolean ;
error ?: Error ;
};
userInfo ?: {
name ?: string ;
email ?: string ;
userId ?: string ;
avatarUrl ?: string ;
};
signOut : () => void ;
};
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.
import { useBibleClient } from '@youversion/platform-react-hooks'
function MyComponent () {
const bibleClient = useBibleClient ()
const fetchData = async () => {
const versions = await bibleClient. getVersions ( 'en*' )
}
}
useVersion
Fetches a specific Bible version by ID.
import { useVersion } from '@youversion/platform-react-hooks'
function VersionInfo ({ versionId }) {
const { version , loading , error } = useVersion (versionId)
if (loading) return < div >Loading...</ div >
if (error) return < div >Error: {error.message}</ div >
return (
< div >
< h2 >{version?.title}</ h2 >
< p >{version?.abbreviation}</ p >
</ div >
)
}
export function useVersion (
versionId : number ,
options ?: UseApiDataOptions ,
) : {
version : BibleVersion | null ;
loading : boolean ;
error : Error | null ;
refetch : () => void ;
}
See also: BibleVersion , UseApiDataOptions
useVersions
Fetches Bible versions filtered by language.
import { useVersions } from '@youversion/platform-react-hooks'
function VersionList () {
const { versions , loading , error } = useVersions ( 'en*' )
return (
< div >
{versions?.data. map (( version ) => (
< div key = {version.id}>{version.title}</ div >
))}
</ div >
)
}
export function useVersions (
languageRanges ?: string ,
licenseId ?: string | number ,
options ?: UseApiDataOptions ,
) : {
versions : Collection < BibleVersion > | null ;
loading : boolean ;
error : Error | null ;
refetch : () => void ;
}
See also: BibleVersion , Collection , UseApiDataOptions
useFilteredVersions
Filters versions array by search term and selected language.
import { useFilteredVersions } from '@youversion/platform-react-hooks'
function FilteredVersions () {
const versions = useFilteredVersions (allVersions, searchTerm, selectedLanguage)
}
export function useFilteredVersions (
versions : BibleVersion [],
searchTerm : string ,
selectedLanguage : string ,
) : BibleVersion []
See also: BibleVersion
useBook
Fetches a specific book from a Bible version.
import { useBook } from '@youversion/platform-react-hooks'
function BookInfo ({ versionId , bookCode }) {
const { book , loading , error } = useBook (versionId, bookCode)
return (
< div >
< h2 >{book?.title}</ h2 >
< p >Chapters: {book?.chapters?. length }</ p >
</ div >
)
}
export function useBook (
versionId : number ,
book : string ,
options ?: UseApiDataOptions ,
) : {
book : BibleBook | null ;
loading : boolean ;
error : Error | null ;
refetch : () => void ;
}
See also: BibleBook , UseApiDataOptions
useBooks
Fetches all books from a Bible version.
import { useBooks } from '@youversion/platform-react-hooks'
function BookList ({ versionId }) {
const { books , loading , error } = useBooks (versionId)
return (
< div >
{books?.data. map (( book ) => (
< div key = {book.id}>{book.title}</ div >
))}
</ div >
)
}
export function useBooks (
versionId : number ,
options ?: UseApiDataOptions ,
) : {
books : Collection < BibleBook > | null ;
loading : boolean ;
error : Error | null ;
refetch : () => void ;
}
See also: BibleBook , Collection , UseApiDataOptions
useChapter
Fetches a specific chapter.
import { useChapter } from '@youversion/platform-react-hooks'
function ChapterView ({ versionId , bookCode , chapterNumber }) {
const { chapter , loading , error } = useChapter (versionId, bookCode, chapterNumber)
return < div >{chapter?.title}</ div >
}
export function useChapter (
versionId : number ,
book : string ,
chapter : number ,
options ?: UseApiDataOptions ,
) : {
chapter : BibleChapter | null ;
loading : boolean ;
error : Error | null ;
refetch : () => void ;
}
See also: BibleChapter , UseApiDataOptions
useChapters
Fetches all chapters for a book.
import { useChapters } from '@youversion/platform-react-hooks'
function ChapterList ({ versionId , bookCode }) {
const { chapters , loading , error } = useChapters (versionId, bookCode)
return (
< div >
{chapters?.data. map (( chapter ) => (
< div key = {chapter.id}>{chapter.title}</ div >
))}
</ div >
)
}
export function useChapters (
versionId : number ,
book : string ,
options ?: UseApiDataOptions ,
) : {
chapters : Collection < BibleChapter > | null ;
loading : boolean ;
error : Error | null ;
refetch : () => void ;
}
See also: BibleChapter , Collection , UseApiDataOptions
useVerse
Fetches a specific verse.
import { useVerse } from '@youversion/platform-react-hooks'
function VerseDisplay ({ versionId , bookCode , chapterNumber , verseNumber }) {
const { verse , loading , error } = useVerse (versionId, bookCode, chapterNumber, verseNumber)
return < p >{verse?.reference}</ p >
}
export function useVerse (
versionId : number ,
book : string ,
chapter : number ,
verse : number ,
options ?: UseApiDataOptions ,
) : {
verse : BibleVerse | null ;
loading : boolean ;
error : Error | null ;
refetch : () => void ;
}
See also: BibleVerse , UseApiDataOptions
useVerses
Fetches all verses for a chapter.
import { useVerses } from '@youversion/platform-react-hooks'
function ChapterVerses ({ versionId , bookCode , chapterNumber }) {
const { verses , loading , error } = useVerses (versionId, bookCode, chapterNumber)
return (
< div >
{verses?.data. map (( verse ) => (
< p key = {verse.id}>{verse.reference}</ p >
))}
</ div >
)
}
export function useVerses (
versionId : number ,
book : string ,
chapter : number ,
options ?: UseApiDataOptions ,
) : {
verses : Collection < BibleVerse > | null ;
loading : boolean ;
error : Error | null ;
refetch : () => void ;
}
See also: BibleVerse , Collection , UseApiDataOptions
usePassage
Fetches a Bible passage with formatted content. Recommended for retrieving verse text to preserve formatting.
import { usePassage } from '@youversion/platform-react-hooks'
function BiblePassage ({ versionId , usfm }) {
const { passage , loading , error } = usePassage (versionId, usfm, 'html' , true , false )
if (loading) return < div >Loading...</ div >
return (
< div >
< h2 >{passage?.human_reference}</ h2 >
< div dangerouslySetInnerHTML = {{ __html: passage?.content || '' }} />
</ div >
)
}
type usePassageProps = {
versionId : number ;
usfm : string ;
format ?: 'html' | 'text' ;
include_headings ?: boolean ;
include_notes ?: boolean ;
options ?: UseApiDataOptions ;
};
export function usePassage ( props : usePassageProps ) : {
passage : BiblePassage | null ;
loading : boolean ;
error : Error | null ;
refetch : () => void ;
}
See also: BiblePassage , Collection , UseApiDataOptions
useVerseOfTheDay
Fetches the Verse of the Day.
import { useVerseOfTheDay } from '@youversion/platform-react-hooks'
function DailyVerse () {
const dayOfYear = Math. floor (( new Date () - new Date ( new Date (). getFullYear (), 0 , 0 )) / 86400000 )
const { data : votd , loading , error } = useVerseOfTheDay (dayOfYear)
return < p >Day {votd?.day}: {votd?.passage_id}</ p >
}
export function useVerseOfTheDay (
day : number ,
options ?: UseApiDataOptions ,
) : {
data : VOTD | null ;
loading : boolean ;
error : Error | null ;
refetch : () => void ;
}
See also: VOTD , UseApiDataOptions
useLanguages
Fetches available languages.
import { useLanguages } from '@youversion/platform-react-hooks'
function LanguageList () {
const { languages , loading , error } = useLanguages ({ country: 'US' })
return (
< div >
{languages?.data. map (( language ) => (
< div key = {language.id}>{language.display_names.en}</ div >
))}
</ div >
)
}
export function useLanguages (
options : GetLanguagesOptions ,
apiOptions ?: UseApiDataOptions ,
) : {
languages : Collection < Language > | null ;
loading : boolean ;
error : Error | null ;
refetch : () => void ;
}
See also: Language , Collection , GetLanguagesOptions
Referenced Types
All types are imported from @youversion/platform-core. For complete type definitions and details, see the TypeScript SDK documentation .
Core Types:
Hook Options:
UseApiDataOptions - { enabled?: boolean } - Control hook execution
GetLanguagesOptions - { country: string; page_size?: number; page_token?: string } - Language filtering
Migration from Legacy Authentication
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 permissions 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):
// Old separate providers approach
import { 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):
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.
2. Update Authentication Hook Usage
Before:
import { useAuthentication } from '@youversion/platform-react-ui'
const { isAuthenticated , signOut , userInfo } = useAuthentication ();
After:
import { useYVAuth } from '@youversion/platform-react-ui'
const { auth , signOut , userInfo } = useYVAuth ();
// auth.isAuthenticated, auth.isLoading, auth.error
3. Update SignInButton to YouVersionAuthButton
Before:
< SignInButton
requiredPermissions = {[SignInWithYouVersionPermission.bibles]}
optionalPermissions = {[SignInWithYouVersionPermission.highlights]}
onSuccess = {handleSuccess}
onAuthError = {handleError}
/>
After:
< YouVersionAuthButton
permissions = {[
SignInWithYouVersionPermission.bibles,
SignInWithYouVersionPermission.highlights
]}
redirectUrl = {redirectUrl}
onAuthError = {handleError}
mode = "auto" // Optional: auto (default), signIn, or signOut
// No onSuccess needed - state updates automatically
/>
4. Remove Callback Page
Delete your /auth/callback page/route entirely
Remove any WebAuthenticationStrategy.handleCallback() logic
Update your OAuth app settings to redirect to your main app URL
5. Update Environment Variables
Before:
NEXT_PUBLIC_REDIRECT_URI = https://yourapp.com/auth/callback
After:
NEXT_PUBLIC_REDIRECT_URI = https://yourapp.com
Benefits of New Implementation
✅ Simpler Setup : No callback page required
✅ Enhanced Security : PKCE OAuth flow
✅ 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:
# Required: Your YouVersion Platform App Key
NEXT_PUBLIC_YVP_APP_KEY = your-app-key-here
# Required for Authentication: OAuth redirect URL
NEXT_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_short 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:
function CustomPassage () {
const { passage } = usePassage ( 111 , 'JHN.3.16' )
const { version } = useVersion ( 111 )
return (
< div >
< div dangerouslySetInnerHTML = {{ __html: passage?.content }} />
{version?.copyright_short && (
< p className = "text-sm text-gray-600" >
{version.copyright_short}
</ p >
)}
</ div >
)
}
The copyright text comes from the BibleVersion object:
copyright_short - Brief attribution (use after verses)
copyright_long - 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.
Customization Examples
Custom Bible Reader Font:
[ data-yv-sdk ] {
--yv-reader-font-family : 'Georgia' , 'Times New Roman' , serif ;
--yv-reader-font-size : 20 px ;
--yv-reader-line-height : 1.8 ;
--yv-reader-letter-spacing : 0.02 em ;
}
Last modified on December 12, 2025