Get started with Jazz in 10 minutes

This quickstart guide will take you from an empty project to a working app with a simple data model and components to create and display your data.

Create your App

No content available for tab:

Note: Requires Node.js 20+

Install Jazz

The jazz-tools package includes everything you're going to need to build your first Jazz app.

No content available for tab:

Get your free API key

Sign up for a free API key at dashboard.jazz.tools for higher limits or production use, or use your email address as a temporary key to get started quickly.

.env
No content available for tab:

Define your schema

Jazz uses Zod for more simple data types (like strings, numbers, booleans), and its own schemas to create collaborative data structures known as CoValues. CoValues are automatically persisted across your devices and the cloud and synced in real-time. Here we're defining a schema made up of both Zod types and CoValues.

Adding a root to the user's account gives us a container that can be used to keep a track of all the data a user might need to use the app. The migration runs when the user logs in, and ensures the account is properly set up before we try to use it.

src/lib/schema.ts
import { co, z } from "jazz-tools";

export const Band = co.map({
  name: z.string(), // Zod primitive type
});

export const Festival = co.list(Band);

export const JazzFestAccountRoot = co.map({
  myFestival: Festival,
});

export const JazzFestAccount = co
  .account({
    root: JazzFestAccountRoot,
    profile: co.profile(),
  })
  .withMigration((account) => {
    if (!account.$jazz.has('root')) {
      account.$jazz.set('root', {
        myFestival: [],
      });
    }
  });

Add the Jazz Provider

Wrap your app with a provider so components can use Jazz.

src/routes/+layout.svelte
No content available for tab:

Start your app

Moment of truth — time to start your app and see if it works.

No content available for tab:

If everything's going according to plan, you should see the default SvelteKit welcome page!

Not loading?

If you're not seeing the welcome page:

  • Check you wrapped your app with the Jazz Provider in src/routes/+layout.svelte
  • Check your schema is properly defined in src/lib/schema.ts
Still stuck?Ask for help on Discord!

Create data

Let's create a simple form to add a new band to the festival. We'll use the useAccount hook to get the current account and tell Jazz to load the myFestival CoValue by passing a resolve query.

src/lib/components/NewBand.svelte
No content available for tab:

Display your data

Now we've got a way to create data, so let's add a component to display it.

src/lib/components/Festival.svelte
No content available for tab:

Put it all together

You've built all your components, time to put them together.

src/routes/+page.svelte
No content available for tab:

You should now be able to add a band to your festival, and see it appear in the list!

Congratulations! 🎉 You've built your first Jazz app!

You've begun to scratch the surface of what's possible with Jazz. Behind the scenes, your local-first JazzFest app is already securely syncing your data to the cloud in real-time, ready for you to build more and more powerful features.

Next steps