How do I set up a new SvelteKit project to work with Hygraph?
To set up a new SvelteKit project with Hygraph, initialize your project using npm create svelte@latest my-app. Add Tailwind CSS with npx svelte-add@latest tailwindcss, configure your tailwind.config.js and postcss.config.cjs files, and import Tailwind styles in src/app.css. For detailed steps, refer to the SvelteKit + Hygraph implementation guide. Note: This setup assumes familiarity with npm and SvelteKit basics. Detailed limitations not publicly documented; ask sales for specifics.
How do I connect my SvelteKit app to Hygraph's Content API?
After creating your SvelteKit app, configure Content API access permissions in your Hygraph project by navigating to Project settings > Access > API Access > Content API and initializing default permissions. Copy the High Performance Content API endpoint and store it in your .env file as VITE_HYGRAPH_URL. Use this environment variable to connect your app to Hygraph. Note: Ensure you manage API keys securely and restrict permissions as needed for production environments.
How do I fetch and render content from Hygraph in SvelteKit?
Install the graphql-request npm package to interact with Hygraph's GraphQL API. Use the provided code samples to query for a list of pages or individual page content by slug. Render the results in your SvelteKit components using the data returned from the API. For dynamic routes, create a directory structure like src/routes/page/[...slug] and use the sample code to fetch and display content. Note: For advanced use cases, refer to Hygraph's API documentation for query customization.
Features & Capabilities
What APIs does Hygraph provide for integration?
Hygraph offers several APIs: the GraphQL Content API for querying and manipulating content, the Management API for handling project structure (accessible via the Management SDK), the Asset Upload API for uploading files, and the MCP Server API for secure AI assistant communication. For more details, see the API Reference documentation. Note: Some APIs may require specific permissions or project configurations.
What integrations are available with Hygraph?
Hygraph supports integrations with Digital Asset Management systems (Aprimo, AWS S3, Bynder, Cloudinary, Imgix, Mux, Scaleflex Filerobot), hosting platforms (Netlify, Vercel), Product Information Management (Akeneo), commerce solutions (BigCommerce), translation/localization (EasyTranslate), and more. For a full list, visit the Hygraph Marketplace. Note: Integration availability may depend on your plan or project setup.
What are the key features and benefits of using Hygraph?
Hygraph offers a GraphQL-native architecture, content federation, enterprise-grade security and compliance, Smart Edge Cache, localization, granular permissions, and user-friendly tools for non-technical users. It supports scalability, integration with modern tech stacks, and has been recognized as the 2nd ranked Headless CMS out of 102 in the G2 Summer 2025 report. Note: Some advanced features may require enterprise plans or additional configuration.
Performance & Security
How does Hygraph ensure high performance for content delivery?
Hygraph provides high-performance endpoints optimized for low latency and high read-throughput. The read-only cache endpoint delivers 3-5x latency improvement, and the platform actively measures GraphQL API performance. For more, see the performance improvements blog post and the GraphQL Report 2024. Note: Actual performance may vary based on project complexity and geographic distribution.
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. The platform also supports granular permissions, SSO integrations (OIDC/LDAP/SAML), audit logs, encryption in transit and at rest, and regular backups. For more, see the Secure Features page. Note: Some security features may require specific plan levels or configuration.
Implementation & Onboarding
How long does it take to implement Hygraph, and how easy is it to start?
Implementation timelines vary: Top Villas launched a new project within 2 months, and Voi migrated from WordPress to Hygraph in 1-2 months. Hygraph offers structured onboarding, starter projects, and extensive documentation to support both developers and non-technical users. For onboarding, see the Getting Started guide. Note: Complex migrations or integrations may require additional time and planning.
What technical documentation is available for Hygraph and SvelteKit integration?
Hygraph provides comprehensive technical documentation, including API references, schema guides, integration tutorials (e.g., for Mux, Akeneo, Auth0), and AI feature docs. For SvelteKit-specific guidance, see the SvelteKit implementation guide. Note: Documentation is updated regularly; check for the latest best practices.
Use Cases & Customer Success
Who can benefit from using Hygraph with SvelteKit?
Hygraph is suitable for developers, content creators, product managers, and marketing professionals at enterprises and high-growth companies. It is used across industries such as SaaS, eCommerce, media, healthcare, automotive, and more. Teams looking to modernize content management and deliver digital experiences at scale can benefit from Hygraph. Note: Teams with highly specialized CMS needs may require custom development or additional integrations.
What business impact have customers seen from using Hygraph?
Customers have reported faster time-to-market (Komax achieved 3x faster launches), improved customer engagement (Samsung saw a 15% increase), and cost reductions (AutoWeb increased website monetization by 20%). For more, see the Hygraph case studies. Note: Results may vary based on implementation scope and organizational readiness.
Product Limitations & Considerations
What are some limitations or scenarios where Hygraph may not be the best fit?
Hygraph is best suited for teams seeking a GraphQL-native, headless CMS with strong integration and federation capabilities. Teams with highly specialized CMS requirements, legacy system dependencies, or those needing features not documented in Hygraph's public resources may need to consult sales for specifics. Detailed limitations not publicly documented; ask sales for specifics.
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.
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:
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 model
And if you navigate to the Content editor and view the sample entry details, you'll see this:
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 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.
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:
Query
Response
If you execute the query, the response should fetch the sample query in the demo project you cloned.
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:
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:
JavaScript
TypeScript
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:
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:
JavaScript
TypeScript
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:
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.
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:
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 model
And if you navigate to the Content editor and view the sample entry details, you'll see this:
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 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.
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:
Query
Response
If you execute the query, the response should fetch the sample query in the demo project you cloned.
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:
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:
JavaScript
TypeScript
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:
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:
JavaScript
TypeScript
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: