Skip to content

Sample JavaScript single-page application using the Kentico Cloud Delivery API to retrieve content

License

Notifications You must be signed in to change notification settings

tomashruby/cloud-sample-app-js

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Kentico Cloud sample JavaScript single-page application

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.

Application setup

  1. Install the latest version of NodeJS and npm. You can download both at https://nodejs.org/en/download/.
  2. Clone the sample application repository.
  3. Navigate to the root folder of the application in the command line.
  4. Type npm install to install required npm packages.
  5. Type npm start to start a development server.
  6. The application opens in your browser at http://localhost:3000.

After starting, the sample application retrieves content from the default Kentico Cloud sample project.

Preview content from your project

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:

  1. In Kentico Cloud, select your project.
  2. Navigate to the Development section.
  3. Copy your Project ID and Preview API key.
  4. Open the src\Client.js file in the sample application folder.
  5. Find the projectId and previewApiKey constants.
  6. Change the values of the constants using the Project ID and Preview API key you copied.
  7. Save the file.

When you now run the application, you will see all project content including the unpublished version of content items.

Content administration

  1. Navigate to https://app.kenticocloud.com in your browser.
  2. Sign in with your credentials.
  3. Manage content in the content administration interface of your sample project.

You can learn more about content editing with Kentico Cloud in the documentation.

Content delivery

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.

About

Sample JavaScript single-page application using the Kentico Cloud Delivery API to retrieve content

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • CSS 71.5%
  • JavaScript 27.5%
  • HTML 1.0%