Sveltekit starter with Contentful

The combination of Sveltekit with Contentful lets you build static websites and SSR apps with Svelte.

What is Sveltekit?

Sveltekit is a full-stack web framework built on top of Svelte that lets you create static sites and server-side-rendered (SSR) apps. It’s designed to be fast with a minimal footprint.

1

Clone our Sveltekit project

Our Sveltekit starter shows you how to create an example company page with nested routes, dynamic routes, and uses the Contentful GraphQL API to fetch content.

Run the following commands in your terminal to clone our Contentful Sveltekit starter and install dependencies.

2

Create account and secrets

Create a Contentful account with an empty space. Go to your Contentful space, then

3

Create environment file

Rename the .env.example at the root of your project to .env

In the new .env file replace

YOUR_SPACE_ID

YOUR_DELIVERY_TOKEN

YOUR_MANAGEMENT_ACCESS_TOKEN

with the values from the previous step.

4

Import our content model

The project comes with a Contentful set up command that imports the required content model and adds sample content to your space.


Run the following command to import the content model:

5

Run the project locally

This will start the development server and open the app in a new browser tab.
The page will reload when you make changes.

6

Deploy

Deploy your project.

For an easy to way to deploy it, use Vercel. Just don't forget to change the repository to your own after you've made changes.

Deploy with Vercel.

Starter guides

Your stack, your rules - power your projects with a fully extensible content platform

Get hands-on with guided tutorials, videos, and starter toolkits tailored for the languages and frameworks you use every day.

    View starter guides
    Sveltekit Starter with Contentful | Contentful