Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add SvelteKit to serve docs #571

Merged
merged 1 commit into from
Nov 9, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions pages/docs/sdk/serve.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ We provide framework-specific bindings to make this easy for common platforms:
- [Next.js](#framework-next-js)
- [Redwood](#framework-redwood)
- [Remix](#framework-remix)
- [SvelteKit](#framework-sveltekit)
- [Custom](#custom-frameworks)

Each of these bindings wrap our base API which implemnts the core logic, so adding support for new
Expand Down Expand Up @@ -535,6 +536,21 @@ const handler = serve(inngest, [...fns], {

For more information, check out the [Streaming](/docs/streaming) page.

## Framework: SvelteKit <VersionBadge version="v3.5.0+" />

Add the following to `./src/routes/api/inngest/+server.ts`:

<CodeGroup>
```ts {{ title: "v3" }}
import { functions, inngest } from '$lib/inngest';
import { serve } from 'inngest/sveltekit';

export const { GET, POST, PUT } = serve({ client: inngest, functions });
```
</CodeGroup>

See the [SvelteKit example](https://github.com/inngest/inngest-js/tree/main/examples/framework-sveltekit) for more information.

## Reference

For more information about the `serve` handler, read the [the reference guide](/docs/reference/serve), which includes:
Expand Down
Loading