--- title: "Embedded learning for React web applications" slug: "embedded-learning-for-react-web-applications" description: "Learn how to integrate Docebo's embedded learning in your React app with code examples and modules for a seamless training experience." tags: ["React web applications", "Building blocks", "Embedded learning"] updated: 2025-09-11T09:47:29Z published: 2025-09-11T09:47:29Z canonical: "developer.docebo.com/embedded-learning-for-react-web-applications" --- > ## Documentation Index > Fetch the complete documentation index at: https://developer.docebo.com/llms.txt > Use this file to discover all available pages before exploring further. # Embedded learning for React web applications > [!WARNING] > Disclaimer > > The code samples contained in this article should be considered as examples only and may require further additions or changes to work in your environment. Docebo does not provide support for the content of this article. > > If you are looking for React Native code examples for the embedded learning mobile SDK, please see [Embedded learning for React Native](/v1/docs/embedded-learning-for-react-native). ## Introduction Docebo embedded learning allows you to integrate an instance of your Docebo platform in various platforms such as Web or [Mobile](/v1/docs/embedded-learning-mobile-sdk) ([iOS](/v1/docs/embedded-learning-for-ios), [Android](/v1/docs/embedded-learning-for-android) or [React Native](/v1/docs/embedded-learning-for-react-native)) mobile applications and more. The Docebo platform instance opens when the user clicks on a button or interacts with an element - such as a link, or a string - in your application. When embedded learning opens, the platform instance shows the training content you, as the Superadmin, have selected for the user based on the action the user is performing, in order to provide the best learning on the fly experience, enriching it with ad hoc training. Depending on the embedded learning configuration, users can be automatically provisioned so that their learning in the flow of work is not an event interrupted by the need to log in. This document is a technical guide on how to insert embedded learning building blocks into your React 18.0.0 web application, it contains three examples of files: - Embedded learning module: - A React hook that injects the kernel URL and sets the `DSDK` object - A context provider that holds the `DSDK` object - A component to be used only in areas of your application where embedded learning is used - Example component - Example application ## Embedded learning in your React web application ### Embedded learning module This example contains code that provides: - A React hook that injects the kernel URL and sets the `DSDK` object. - A context provider that holds the `DSDK` object. - A component that should be added only where embedded learning is used in the app > [!TIP] > Tip: > > If you follow these examples and save this code as a file, in order for the following examples to work properly, it should be named `EmbeddedLearningModule` and reside in the same folder as the subsequent code examples, otherwise you will need to adjust the path and filenames of the `import` statements in the last two code example blocks. ```javascript /* This hook injects the kernel bundle into the DOM head only once and when loaded starts the kernel React 18.0.0 */ import {createContext, useEffect, useState} from "react"; const useDoceboEmbeddedLearning = (kernelUrl, domain, renewToken, setDsdk) => {    return useEffect(() => {        /*        If the