ReactJS SDK
Integrate the Edgee SDK in a React app.
For applications built with React, we provide a dedicated library to simplify the integration of our SDK. This library ensures that Edgee’s services are seamlessly integrated and that page views are tracked accurately during single-page navigations.
Installation
You can install the react-edgee
library using npm or yarn.
Usage
Import the EdgeeSdk
component from the react-edgee
library:
When using app
folder structure
Add the EdgeeSdk
component inside the <body>
tag of your RootLayout
component:
Replace <YOUR_SDK_URL>
with the URL provided in the Edgee console, in the project overview section.
When using pages
folder structure
Add the EdgeeSdk
component in your MyApp
component:
Replace <YOUR_SDK_URL>
with the URL provided in the Edgee console, in the project overview section.
When using Vite or other frameworks
Add the EdgeeSdk
component inside the <Router>
component in your App
component:
Replace <YOUR_SDK_URL>
with the URL provided in the Edgee console, in the project overview section.
Next Steps
For more details about the Edgee SDK, visit the React-Edgee repository.
After integrating the Edgee SDK, you’re ready to start using Edgee’s services.
In the next page, you’ll find comprehensive guides on activating and customizing features such as advanced analytics, A/B testing, security, and more, ensuring your web application not only performs efficiently but also delivers a superior user experience.