Data with SvelteKit

SvelteKit is the fastest way to build webapps (according to SvelteKit). Learn more about it at https://kit.svelte.dev/

1. Getting Started

SvelteKit has a great Getting Started guide. Go get SvelteKit installed, then come back here to get your Data tied in.

Get Started

2. Importing Data

Use the REST APIs or copy the link in the developer sidebar () to get a URL for the data you're page needs.

SvelteKit loads data through a load() function in a +page.js file next to your page component (docs are here ).

You can use fetch to load your data like this:

/src/routes/+page.js

This will expose a data variable on your page that you can use like any other value.

/src/routes/+page.svelte

3. Be Happy