SvelteJS Integration

Hello,

I am looking to see if there is any documentation for SvelteJS. I see the JS API integration but I wanted to confirm that is the correct way to go or if there are any other suggestions or recommendations. I am not crazy about what the docs say so could use a little help here! Thanks!

Hello! We don’t currently have any sort of documentation for Svelte at this point. Your best bet will be to use our Javascript documentation until we are able to put something together for Svelte. We hope to look into it and create some resources soon.

In the meantime, if you discover any useful tips for using Prismic & Svelte, then please share them with us here to help anyone else that might be looking to try this out as well. Thanks!

Will do, one of the ways I saw was using graphql-apollo which I will be trying that out with sapper (svelte’s server side framework)

@teddy That’s great, I can’t wait to hear how it goes for you. We’ll look into it as well at some point and try to put together some resources.

1 Like

Still no luck, whether it’s through apollo-graphql or even with the js workaround, could use some direction on this!

Interested in this as well

Hi @teddy and @johan.steinberg, I quickly put together a simple example of a Sapper site using Prismic. You can check it out here. Everything I know about Sapper & Svelte I learned today, so let me know if I’ve missed anything with this example. Hopefully it help you guys get started!

awesome! will take a look!

Working so far, however, I was hoping to see if there may be a GraphQL solution, which I think may be best since we are hoping to hand this off to a junior developer, but this is a great start and I appreciate it.

This is going to be a long term project. We have decided to go back to gatsbyjs as our outsourced team can do gatsby.

I will make this a personal priority project as I see a lot of potential for SvelteJS to be used and update as I can.

1 Like

@teddy Sounds great, let us know if there is anything we can do to help :grinning:

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

FYI, With SvelteKit in beta currently, we've published a tutorial on using Prismic with SvelteKit:

https://prismic.io/blog/svelte-sveltekit-tutorial

We don't have any documentation for implementing previews, yet, but that will be forthcoming.

4 Likes

Hey everyone! Exciting news: we've released our our SvelteKit integration for Slice Machine. Now you can use SvelteKit with Prismic's Slice Machine.

With SvelteKit and Slice Machine, you get:

  • Automatically-typed content
  • Component previews
  • Code snippets
  • Content models saved in code

Learn more in the blog post:

Have fun! And share your creations in the showcase:

Sam