https://github.com/ctnicholas/liveblocks-vercel-database-sync
https://github.com/ctnicholas/liveblocks-vercel-database-sync
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/ctnicholas/liveblocks-vercel-database-sync
- Owner: CTNicholas
- Created: 2023-04-30T22:12:02.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2023-05-02T15:27:56.000Z (about 3 years ago)
- Last Synced: 2025-03-20T21:46:26.357Z (about 1 year ago)
- Language: TypeScript
- Homepage:
- Size: 228 KB
- Stars: 13
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
https://user-images.githubusercontent.com/33033422/235533924-823133e2-3f9b-4f62-8c4c-8e5918585995.mp4
## Vercel database + Liveblocks sync demo
This demo shows you how to use SvelteKit to sync
a [Vercel database](https://vercel.com/blog/vercel-storage#vercel-postgres-complex-data-made-easy) with your
Liveblocks [conflict-free data](https://liveblocks.io/conflict-free-data-types),
using [webhooks](https://liveblocks.io/docs/guides/webhooks).
### Set up Liveblocks
- Install all dependencies with `npm install`
- Create an account on [liveblocks.io](https://liveblocks.io/dashboard)
- Copy your **secret** key from the [dashboard](https://liveblocks.io/dashboard/apikeys)
- Create an `.env.local` file and add your **secret** key as the `VITE_LIVEBLOCKS_SECRET_KEY` environment
variable
- Set up your StorageUpdatedEvent [webhook](https://liveblocks.io/docs/guides/webhooks) on the webhooks [dashboard](https://liveblocks.io/dashboard/)
- Add the **signing secret** from this page to `.env.local` as the `VITE_WEBHOOK_SECRET` enrivonment variable
- Run `npm run dev` and go to [http://localhost:5173](http://localhost:5173)