This Kontent.ai Learn project was bootstrapped with Create React App. The project demonstrates how to preview content from a Kontent.ai environment and how to annotate HTML markup to use the Kontent.ai Smart Link SDK.
This project shows the minimum code necessary to prepare your app for Web Spotlight.
To run this app against your Kontent.ai project, take the Hello Web Spotlight path in Kontent.ai Learn and specify the following environment variables in your .env.local
:
REACT_APP_KONTENT_AI_ENVIRONMENT_ID
with your Kontent.ai environment ID.REACT_APP_KONTENT_AI_PREVIEW_API_KEY
with your Kontent.ai Delivery API key with permission for content preview.
The environment variables are included in the build. Do not use in production.
In the project directory, you can run:
Runs the app in the development mode.
Open http://localhost:3000 to view it in the browser.
The page will reload if you make edits.
You will also see any lint errors in the console.
Builds the app for production to the build
folder.
It correctly bundles React in production mode and optimizes the build for the best performance.
The build is minified and the filenames include the hashes.
Your app is ready to be deployed!
See the section about deployment for more information.
Install Surge.sh on your device via npm i -g surge
and then run surge
to deploy the app.
You can learn more about Kontent.ai development and best practices in Kontent.ai Learn.
To learn React, check out the Create React App documentation and React documentation.