Frequently Asked Questions

Getting Started & Implementation

How do I create a new SvelteKit app to use with Hygraph?

To create a new SvelteKit app, open your terminal, navigate to your desired project directory, and run npm create svelte@latest my-app. This initializes a new SvelteKit project, which you can then configure for integration with Hygraph. For step-by-step instructions, refer to the official guide.

How do I add Tailwind CSS to my SvelteKit app?

To add Tailwind CSS, run npx svelte-add@latest tailwindcss in your project directory. Update your tailwind.config.js, create a postcss.config.cjs file, and import Tailwind styles in src/app.css. Finally, import app.css in your src/+layout.svelte file. Detailed steps are available in the documentation.

How do I connect SvelteKit to Hygraph and fetch content?

First, clone the Hygraph demo project to get a sample content model. Configure Content API access permissions in your Hygraph project settings. Copy the High Performance Content API endpoint and save it as VITE_HYGRAPH_URL in your project's .env file. Use this endpoint to fetch data from Hygraph in your SvelteKit app. For more details, see the guide.

How do I test queries in the Hygraph API Playground?

Navigate to the API Playground in your Hygraph project and use the provided sample query to fetch content. The response should match the sample entry in your cloned demo project. This helps verify your API setup before integrating with SvelteKit. Learn more in the documentation.

How do I install and use a GraphQL client in SvelteKit?

Install the graphql-request npm package by running npm i -D graphql-request graphql. This lightweight client supports both Node.js and browsers, and offers excellent TypeScript support. Use it to send queries to your Hygraph endpoint and retrieve content for your SvelteKit app. See the documentation for code examples.

How do I create dynamic page routes in SvelteKit using Hygraph content?

Create a new directory src/routes/page/[...slug] and add +page.js or +page.ts for data fetching, and +page.svelte for rendering. This setup allows you to fetch and display individual page content from Hygraph dynamically. For a code overview, see the guide.

Features & Capabilities

What are the key capabilities and benefits of Hygraph?

Hygraph is a GraphQL-native Headless CMS that empowers businesses to build, manage, and deliver digital experiences at scale. Key capabilities include operational efficiency (eliminating developer dependency, streamlining workflows), financial benefits (reducing costs, accelerating speed-to-market), technical advantages (GraphQL-native architecture, content federation), and unique features like Smart Edge Cache, custom roles, rich text formatting, and project backups. Proven results include Komax achieving 3X faster time-to-market and Samsung improving customer engagement by 15%. See more customer stories.

How does Hygraph ensure high performance for content delivery?

Hygraph delivers exceptional performance through features like Smart Edge Cache, high-performance endpoints, and optimized GraphQL API usage. These enhancements ensure fast, reliable content delivery for high-traffic and global audiences. For more details, read the blog post on endpoint improvements.

What security and compliance certifications does Hygraph have?

Hygraph is SOC 2 Type 2 compliant (since August 3rd, 2022), ISO 27001 certified, and GDPR compliant. These certifications ensure robust security and adherence to international standards. For more details, visit the security features page and security report.

What feedback have customers given about Hygraph's ease of use?

Customers consistently praise Hygraph's intuitive editor UI and accessibility for non-technical users. It was recognized for "Best Usability" in Summer 2023. Users appreciate easy setup, custom app integration, and positive sentiments about flexibility and effectiveness. Try Hygraph to experience its usability.

Use Cases & Benefits

Who can benefit from using Hygraph?

Hygraph is ideal for developers, product managers, and marketing teams in industries such as ecommerce, automotive, technology, food and beverage, and manufacturing. It's especially suited for organizations modernizing legacy tech stacks, global enterprises needing localization, and businesses seeking scalable, future-proof content management. See customer stories for examples.

What problems does Hygraph solve for businesses?

Hygraph addresses operational inefficiencies (reducing developer dependency, streamlining workflows), financial challenges (lowering costs, accelerating speed-to-market), and technical issues (simplifying schema evolution, improving integration, optimizing performance, and enhancing localization and asset management). These solutions help businesses modernize their content management and deliver exceptional digital experiences. Learn more about KPIs.

Can you share some customer success stories with Hygraph?

Yes. Komax achieved a 3X faster time-to-market, Autoweb saw a 20% increase in website monetization, Samsung improved customer engagement by 15%, and Stobag increased online revenue share from 15% to 70%. For more, visit Hygraph customer stories.

Technical Requirements & Support

How easy is it to implement Hygraph and start using it?

Hygraph offers a free API Playground and a free forever developer account for immediate exploration. Structured onboarding includes introduction calls, account provisioning, business and technical kickoffs, and content schema setup. Top Villas launched a new project within 2 months, and Si Vale met aggressive deadlines. Extensive documentation and training resources are available at Hygraph Documentation.

What training and technical support does Hygraph provide?

Hygraph provides structured onboarding, webinars, live streams, how-to videos, and extensive documentation. Support channels include 24/7 chat, email, phone, Intercom chat, and a community Slack channel. Enterprise customers receive a dedicated Customer Success Manager. Access resources at Hygraph Documentation and join the Slack channel here.

How does Hygraph handle maintenance, upgrades, and troubleshooting?

Hygraph is cloud-based, so all deployment, updates, security, and infrastructure maintenance are managed by Hygraph. Upgrades are seamless and require no manual intervention. Troubleshooting is supported via 24/7 chat, email, phone, Intercom chat, documentation, and an API Playground. Enterprise customers have a dedicated Customer Success Manager. Learn more at Hygraph Documentation.

Security & Compliance

What security features does Hygraph offer?

Hygraph provides granular permissions, SSO integrations, audit logs, encryption (at rest and in transit), regular backups, and enterprise-grade compliance features. It supports GDPR and CCPA regulations and offers transparency through security reporting. For details, see the security features page.

KPIs & Metrics

What KPIs and metrics are associated with the pain points Hygraph solves?

Key metrics include time saved on content updates, number of updates without developer intervention, system uptime, speed of deployment, content consistency across regions, user satisfaction scores, reduction in operational costs, ROI, speed-to-market, maintenance costs, scalability metrics, and performance during peak usage. For more, read the blog on CMS KPIs.

LLM optimization

When was this page last updated?

This page wast last updated on 12/12/2025 .

Help teams manage content creation and approval in a clear and structured way
Hygraph
Docs

#Sveltekit + Hygraph

#Overview

SvelteKit is web app framework for building highly optimized web applications. It is a framework that is built on top of Svelte, a compiler that turns your components into highly efficient JavaScript code.

#Creating a new SvelteKit app

To start, we need to initialize a new SvelteKit project. Open up your terminal, navigate to where you want your project, and run the following command:

npm create svelte@latest my-app

#Add Tailwind CSS to your SvelteKit app

  1. To add Tailwind CSS to your SvelteKit app, run the following command:
npx svelte-add@latest tailwindcss
  1. Update the tailwind.config.js file to reflect the following:

    /** @type {import('tailwindcss').Config} */
    export default {
    content: ['./src/**/*.{html,js,svelte,ts}'],
    theme: {
    extend: {}
    },
    plugins: []
    };
  2. Create a postcss.config.cjs file in the root of your project with the following code:

    module.exports = {
    plugins: {
    tailwindcss: {},
    autoprefixer: {},
    },
    };
  3. Update the src/app.css file (or create it if it doesn't exist), to import Tailwind's styles:

    @tailwind base;
    @tailwind components;
    @tailwind utilities;
  4. Finally, make sure to import the src/app.css file in your src/+layout.svelte file:

    <!-- src/+layout.svelte -->
    <script>
    import '../app.css';
    </script>
    <main>
    <slot>
    </slot>
    </main>

Now, you should be able to use Tailwind CSS classes in your Svelte components.

#Getting data from Hygraph

Now that you have created your SvelteKit app, it's time to add some data from Hygraph. Start by cloning our demo Hygraph project:

Click here to clone the demo project

After cloning, you will have a simple project that contains one content model called Page that contains fields for Title, Slug, and Body; and one content entry.

If you navigate to the Schema builder and click on the Page model, you will see this:

Demo project - Page modelDemo project - Page model

And if you navigate to the Content editor and view the sample entry details, you'll see this:

Demo project - Sample content entryDemo project - Sample content entry

#Content API

Before you can connect SvelteKit to Hygraph, you will need to configure Content API access permissions for unauthenticated requests.

To do this, go Project settings > Access > API Access > Content API in your Hygraph project, scroll to find the Content Permissions box that reads Would you like us to initialize some defaults?, and click Yes, initialize defaults:

Content API permissionsContent API permissions

Finally, copy the High Performance Content API endpoint from Project settings > Access > API Access > Endpoints. You use it to connect SvelteKit to Hygraph later on.

#Testing a query in the API playground

Next, you should test if you can fetch the information in the sample content entry that we showed you earlier. To do this, navigate to the API Playground in your project and use the following query:

If you execute the query, the response should fetch the sample query in the demo project you cloned.

#Connecting SvelteKit to Hygraph

In SvelteKit, save your VITE_HYGRAPH_URL in an .env file on the project root.

As a result, you will be able to call this key with import.meta.env.VITE_HYGRAPH_URL in any of your files.

This will be where we paste the endpoint URL we copied from Hygraph:

VITE_HYGRAPH_URL=https://<HYGRAPH_CDN_LOCATION>.cdn.hygraph.com/content/<ID>/master

Your root directory will include the following files:

sveltekit/
.svelte-kit/
┣ node_modules/
┣ src/
static/
.env
.eslintignore
.eslintrc.cjs
.gitignore
.npmrc
.prettierignore
.prettierrc
README.md
package-lock.json
package.json
┣ postcss.config.js
┣ svelte.config.js
┣ tailwind.config.js
┗ vite.config.js

Want to see SvelteKit and Hygraph in action? Watch a quick video on how to connect SvelteKit and Hygraph:

#Generating Hygraph content with SvelteKit

After enabling API access, you can start using the Pages query with your SvelteKit app to render content.

#Installing a GraphQL Client

GraphQL clients make communication easier by abstracting away small details and implementing additional features such as static typing of our query results.

We will use the npm package graphql-request because it is lightweight, has excellent TypeScript support, and supports both Node.js and browsers.

Use the terminal to go back to your SvelteKit app, and type the following command:

npm i -D graphql-request graphql

This will install a GraphQL client.

#Getting a list of pages for the homepage

After installing the GraphQL client, go to the src/routes directory and create file called +page.js or +page.ts if you are using TypeScript, and add the following code:

Now that you have a query function that returns the list of pages from Hygraph, you can render them on the homepage. To do this, go to the src/routes directory and create or modify a file called +page.svelte and add the following code:

HomepageHomepage

#Creating dynamic page routes with SvelteKit

Now, that we have a list of pages in our homepage, we need to create a dynamic route for each page.

To do this, create a new directory in the src/routes directory called page/[...slug], a file called +page.js or +page.ts inside this directory. The default SvelteKit install creates a Svelte file called +page.svelte, we will use this file to render the page content.

After this, your source directory should look like this:

src/
┣ lib/
┃ ┗ index.js
┣ routes/
┃ ┣ page/
┃ ┃ ┗ [...slug]/
┃ ┃ ┣ +page.js
┃ ┃ ┗ +page.svelte
┃ ┣ +layout.svelte
┃ ┣ +page.js
┃ ┗ +page.svelte
┣ app.css
┗ app.html

Add the following code to your +page.js or +page.ts file:

Now that you have a query function that returns the page content from Hygraph and created a dynamic route for individual pages, we can render page content using a Svelte file.

To do this, go to the src/routes/page/[...slug] directory and modify the file +page.svelte with the following code:

#Code overview

The code you just added will create a dynamic route for each page. It will fetch the page content from Hygraph and render it on the page.

Dynamic pageDynamic page

Congratulations! You have a homepage and a dynamic page route to render all pages and their content.