Learn to integrate v0 with Kentico with our step-by-step guide. Discover configuration tips, troubleshooting advice, and best practices for a seamless setup.

Book a call with an Expert
Starting a new venture? Need to upgrade your web app? RapidDev builds application with your growth in mind.
This guide will help you connect your v0 project to Kentico using TypeScript. Follow each step carefully. Since v0 has no terminal, all dependency additions are made via code modifications.
Because v0 does not have a terminal for installations, load the Kentico Delivery SDK via a CDN. Open your main HTML file (for example, index.html) and insert the following script tag just before the closing </body> tag:
<script src="https://unpkg.com/@kentico/kontent-delivery@latest/dist/kontent-delivery.umd.min.js"></script>
This will load the Kentico Delivery SDK as a global object that you can access in your TypeScript code.
Create a new file in your source directory named kenticoConfig.ts. This file stores your Kentico settings. Add the following code snippet:
export const KENTICO_CONFIG = {
projectId: 'yourprojectid_here',
previewApiKey: 'yourpreviewapikeyhere' // Remove or leave empty if not using preview mode
};
Replace yourprojectidhere and yourpreviewapikey_here with your actual Kentico credentials.
Next, create another file named kenticoClient.ts. This file initializes the Kentico client using the global SDK object (loaded from the CDN). Add the following code:
// Ensure the global object is declared for TypeScript
declare var KenticoKontentDelivery: any;
import { KENTICO_CONFIG } from './kenticoConfig';
const client = new KenticoKontentDelivery.DeliveryClient({
projectId: KENTICO_CONFIG.projectId,
previewApiKey: KENTICO_CONFIG.previewApiKey // Omit if not using preview mode
});
export default client;
This code sets up the client that will be used to retrieve content from Kentico.
Create a new file named kenticoService.ts to define functions that interact with Kentico. For example, to fetch items of a specific content type, add the following code:
import client from './kenticoClient';
export function getItems(contentType: string) {
return client.items()
.type(contentType)
.toPromise();
}
This helper function requests items of the provided contentType and returns a promise with the content.
In the part of your application where you need to display or process Kentico content, import and use the service. For example, open the TypeScript file where you manage your page’s data and add:
import { getItems } from './kenticoService';
getItems('article')
.then(response => {
// Process the retrieved Kentico items here.
console.log('Kentico items:', response);
})
.catch(error => {
console.error('Error fetching Kentico items:', error);
});
This snippet retrieves items of the content type “article” and logs them to the console. You can modify the content type and update the rendering logic as needed.
kenticoConfig.ts are correct before testing the integration.By following these steps and inserting the provided code snippets into the specified files, your v0 project will be integrated with Kentico.
When it comes to serving you, we sweat the little things. That’s why our work makes a big impact.