SvelteKit Durable Object Local Usage Example

This is a simple example that shows how to use getPlatformProxy with SvelteKit's handle hook to get access to a local Durable Object declared and exposed by a Cloudflare Worker.

To run the example:

  • install the dependencies:

    $ npm i
  • run the worker and the svelteKit application with:

    $ npm start
  • navigate to the svelteKit home (default http://localhost:5173/), you should see the following:

    home

    showing a message that gets fetched from the Worker's durable object and displayed in the SvelteKit application