Manually 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.
You can install the react-edgee
library using npm or yarn.
Import the EdgeeSdk
component from the react-edgee
library:
app
folder structureAdd the EdgeeSdk
component inside the <head>
tag of your RootLayout
component:
Replace <YOUR_SDK_URL>
with the URL provided in the Edgee console, in the project overview section.
pages
folder structureAdd the EdgeeSdk
component in your MyApp
component:
Replace <YOUR_SDK_URL>
with the URL provided in the Edgee console, in the project overview section.
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.
useEdgeeDataCollection
)The useEdgeeDataCollection
hook simplifies event tracking by providing direct access to the Edgee Data Collection SDK methods.
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.