github electric-sql/electric @electric-sql/docs@0.0.2-beta.0

latest releases: @core/sync-service@1.1.9, @core/elixir-client@0.7.2, @core/sync-service@1.1.8...
pre-release8 months ago

Patch Changes

  • dd5aeab: This PR adds support for function-based options in the TypeScript client's params and headers. Functions can be either synchronous or asynchronous and are resolved in parallel when needed.

    const stream = new ShapeStream({
      url: "http://localhost:3000/v1/shape",
      params: {
        table: "items",
        userId: () => getCurrentUserId(),
        filter: async () => await getUserPreferences(),
      },
      headers: {
        Authorization: async () => `Bearer ${await getAccessToken()}`,
      },
    })

    Common Use Cases

    • Authentication tokens that need to be refreshed
    • User-specific parameters that may change
    • Dynamic filtering based on current state
    • Multi-tenant applications where context determines the request

Don't miss a new electric release

NewReleases is sending notifications on new releases.