diff --git a/README.md b/README.md index da78a56347..b26b9b9a19 100644 --- a/README.md +++ b/README.md @@ -70,8 +70,10 @@ import { useShape } from '@electric-sql/react' function Component() { const { data } = useShape({ url: `http://localhost:3000/v1/shape`, - table: `foo`, - where: `title LIKE 'foo%'`, + params: { + table: `foo`, + where: `title LIKE 'foo%'` + } }) return JSON.stringify(data) diff --git a/examples/remix-basic/app/routes/_index.tsx b/examples/remix-basic/app/routes/_index.tsx index d2d708055a..6bc1be99c7 100644 --- a/examples/remix-basic/app/routes/_index.tsx +++ b/examples/remix-basic/app/routes/_index.tsx @@ -8,7 +8,9 @@ import { matchStream } from "../match-stream" const itemShape = () => { return { url: new URL(`/shape-proxy`, window.location.origin).href, - table: `items`, + params: { + table: `items`, + }, } } diff --git a/examples/tanstack-example/src/Example.tsx b/examples/tanstack-example/src/Example.tsx index 1430a1f1e4..37d44f2a18 100644 --- a/examples/tanstack-example/src/Example.tsx +++ b/examples/tanstack-example/src/Example.tsx @@ -15,7 +15,9 @@ const baseApiUrl = `http://localhost:3001` const itemShape = () => ({ url: new URL(`/v1/shape`, baseUrl).href, - table: `items`, + params: { + table: `items`, + }, }) async function createItem(newId: string) { diff --git a/website/docs/guides/deployment.md b/website/docs/guides/deployment.md index 616171f2d7..ab8335167c 100644 --- a/website/docs/guides/deployment.md +++ b/website/docs/guides/deployment.md @@ -151,7 +151,9 @@ You can then connect your app to Electric [over HTTP](/docs/api/http). Typically ```ts const stream = new ShapeStream({ url: `https://your-electric-service.example.com/v1/shape`, - table: 'foo' + params: { + table: `foo` + } }) const shape = new Shape(stream) ``` diff --git a/website/docs/guides/shapes.md b/website/docs/guides/shapes.md index de34277388..22efa2f470 100644 --- a/website/docs/guides/shapes.md +++ b/website/docs/guides/shapes.md @@ -124,7 +124,9 @@ import { ShapeStream, Shape } from '@electric-sql/client' const stream = new ShapeStream({ url: `http://localhost:3000/v1/shape`, - table: `foo`, + params: { + table: `foo` + } }) const shape = new Shape(stream) diff --git a/website/docs/integrations/cloudflare.md b/website/docs/integrations/cloudflare.md index aa85d7a0ca..c4620729ce 100644 --- a/website/docs/integrations/cloudflare.md +++ b/website/docs/integrations/cloudflare.md @@ -82,7 +82,9 @@ export default { const stream = new ShapeStream({ url: `${ELECTRIC_URL}/v1/shape`, - table: 'routes' + params: { + table: 'routes' + } }) const shape = new Shape(stream) const routes = await shape.value diff --git a/website/docs/integrations/expo.md b/website/docs/integrations/expo.md index 528765a3d4..d511346e15 100644 --- a/website/docs/integrations/expo.md +++ b/website/docs/integrations/expo.md @@ -35,7 +35,9 @@ const ELECTRIC_URL = 'https://my-electric-sync-service.example.com' export default function HomeScreen() { const { isLoading, data } = useShape({ url: `${ELECTRIC_URL}/v1/shape`, - table: 'items' + params: { + table: 'items' + } }) if (isLoading) { diff --git a/website/docs/integrations/netlify.md b/website/docs/integrations/netlify.md index 2e1286b03c..91c28993ec 100644 --- a/website/docs/integrations/netlify.md +++ b/website/docs/integrations/netlify.md @@ -39,7 +39,9 @@ const ELECTRIC_URL = process.env.ELECTRIC_URL const stream = new ShapeStream({ url: `${ELECTRIC_URL}/v1/shape`, - table: 'items' + params: { + table: 'items' + } }) ``` diff --git a/website/docs/integrations/supabase.md b/website/docs/integrations/supabase.md index 10b3635c28..14b0138c30 100644 --- a/website/docs/integrations/supabase.md +++ b/website/docs/integrations/supabase.md @@ -93,7 +93,9 @@ import { Shape, ShapeStream } from 'npm:@electric-sql/client' Deno.serve(async (req) => { const stream = new ShapeStream({ url: '[YOUR_ELECTRIC_URL]/v1/shape', - table: 'items' + params: { + table: 'items' + } }) const shape = new Shape(stream) const items = [...await shape.value] diff --git a/website/docs/quickstart.md b/website/docs/quickstart.md index a249c75e6e..93a62b1945 100644 --- a/website/docs/quickstart.md +++ b/website/docs/quickstart.md @@ -167,7 +167,9 @@ import { useShape } from '@electric-sql/react' function Component() { const { data } = useShape({ url: `http://localhost:3000/v1/shape`, - table: `foo` + params: { + table: `foo` + } }) return ( diff --git a/website/src/partials/home-cta.md b/website/src/partials/home-cta.md index df7385bd96..96a1504083 100644 --- a/website/src/partials/home-cta.md +++ b/website/src/partials/home-cta.md @@ -25,7 +25,9 @@ import { useShape } from '@electric-sql/react' const Component = () => { const { data } = useShape({ url: `${BASE_URL}/v1/shape`, - table: `items` + params: { + table: `items` + } }) return ( diff --git a/website/use-cases/state-transfer.md b/website/use-cases/state-transfer.md index 59c84ac04b..4f89cb7b55 100644 --- a/website/use-cases/state-transfer.md +++ b/website/use-cases/state-transfer.md @@ -89,7 +89,9 @@ import { useShape } from '@electric-sql/react' const Component = () => { const { data } = useShape({ url: `${BASE_URL}/v1/shape`, - table: `items` + params: { + table: `items` + } }) return (