diff --git a/docs/collections/electric-collection.md b/docs/collections/electric-collection.md index 228098762..f5a475bb9 100644 --- a/docs/collections/electric-collection.md +++ b/docs/collections/electric-collection.md @@ -187,9 +187,9 @@ async function generateTxId(tx) { Electric is typically deployed behind a proxy server that handles shape configuration, authentication and authorization. This provides better security and allows you to control what data users can access without exposing Electric to the client. -Here is an example proxy implementation using TanStack Starter: +Here is an example proxy implementation using TanStack Start: -```js +```typescript import { createServerFileRoute } from "@tanstack/react-start/server" import { ELECTRIC_PROTOCOL_QUERY_PARAMS } from "@electric-sql/client" @@ -311,7 +311,7 @@ Manually wait for a specific transaction ID to be synchronized: // Wait for specific txid await todosCollection.utils.awaitTxId(12345) -// With custom timeout (default is 30 seconds) +// With custom timeout (default is 5 seconds) await todosCollection.utils.awaitTxId(12345, 10000) ``` diff --git a/packages/db/skills/db-core/collection-setup/references/electric-adapter.md b/packages/db/skills/db-core/collection-setup/references/electric-adapter.md index c575db064..38f0e07b2 100644 --- a/packages/db/skills/db-core/collection-setup/references/electric-adapter.md +++ b/packages/db/skills/db-core/collection-setup/references/electric-adapter.md @@ -78,7 +78,7 @@ onInsert: async ({ transaction }) => { ## Utility Methods (`collection.utils`) -- `awaitTxId(txid, timeout?)` -- wait for txid in Electric stream; default timeout 30s +- `awaitTxId(txid, timeout?)` -- wait for txid in Electric stream; default timeout 5s - `awaitMatch(matchFn, timeout?)` -- wait for message matching predicate; default timeout 3000ms ### Helper Exports