This is a sample website written in JavaScript utilizing the Kentico Cloud Delivery API to manage and retrieve content. You can register your account for free at https://app.kenticocloud.com. For a brief walkthrough, read Running the React sample app on our Developer Hub.
- Install the latest version of NodeJS and npm. You can download both at https://nodejs.org/en/download/.
- Clone the sample application repository.
- Navigate to the root folder of the application in the command line.
- Type
npm install
to install required npm packages. - Type
npm start
to start a development server. - The application opens in your browser at http://localhost:3000.
After starting, the sample application retrieves content from the default Kentico Cloud sample project.
At the first run of the app, you'll be presented with a configuration page. It will allow you to connect the app to your Kentico Cloud project or create a new one. You'll also be able to start a trial and convert to a free plan when the trial expires.
Alternatively, you can connect your project manually as per the chapter below.
If you want to change the source Kentico Cloud project, follow these steps:
- In Kentico Cloud, choose Project settings from the app menu.
- Under Development, choose API keys.
- Copy your Project ID
- Open the
src\Client.js
file in the sample application folder. - Find the
projectId
constant. - Change the values of the constant using the Project ID key you copied.
- Save the file.
When you now run the sample application, the application retrieves content from your project.
Deploy, explore and change the app directly in the browser.
If you already have a Kentico Cloud account and you want to connect the sample application to a project of your own, you need to provide your Project ID and your Preview API key to authorize requests to the Delivery Preview API. For example, you can connect the application to your modified version of the sample project.
To preview content in the sample application, follow these steps:
- In Kentico Cloud, choose Project settings from the app menu.
- Under Development, choose API keys.
- Copy your Project ID and Preview API key.
- Open the
src\Client.js
file in the sample application folder. - Find the
projectId
andpreviewApiKey
constants. - Change the values of the constants using the Project ID and Preview API key you copied.
- Save the file.
When you now run the application, you will see all project content including the unpublished version of content items.
- Navigate to https://app.kenticocloud.com in your browser.
- Sign in with your credentials.
- Manage content in the content administration interface of your sample project.
You can learn more about content editing with Kentico Cloud in the documentation.
You can retrieve content either through the Kentico Cloud Delivery SDKs or the Kentico Cloud Delivery API:
- For published content, use
https://deliver.kenticocloud.com/PROJECT_ID/items
. - For unpublished content, use
https://preview-deliver.kenticocloud.com/PROJECT_ID/items
.
For more info about the API, see the API reference.
You can find the Delivery and other SDKs at https://github.com/Kentico.
You can use eg. surge to deploy your app live. Check out the step-by-step guide on our blog.
We would like to express our thanks to the following people who contributed and made the project possible:
Would you like to become a hero too? Pick an issue and send us a pull request!