Svelte
rspc can be used on the frontend with Svelte (opens in a new tab) via Tanstack Svelte Query (opens in a new tab) which provides caching, refetching and a lot more.
To get started first install the required packages.
pnpm i @rspc/client # The core client
pnpm i @rspc/svelte-query # The integration
Then you can do the following:
index.svelte
<script lang="ts">
import { createSvelteQueryHooks } from "@rspc/svelte-query";
import type { Procedures } from "../../../../bindings.ts";
const rspc = createSvelteQueryHooks<Procedures>();
const version = rspc.createQuery(["version"]);
</script>
<div>
<p>Using rspc version: {$version.data}</p>
</div>