You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+37-6Lines changed: 37 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -203,11 +203,44 @@ See the `Phoenix.Sync.Writer` module docs for more information.
203
203
`Phoenix.Sync` can be used in two modes:
204
204
205
205
1.`:embedded` where Electric is included as an application dependency and Phoenix.Sync consumes data internally using Elixir APIs
206
-
2.`:http` where Electric does _not_ need to be included as an application dependency and Phoenix.Sync consumes data from an external Electric service using it's [HTTP API](https://electric-sql.com/docs/api/http)
207
206
208
-
### Embedded mode
207
+
In `:embedded`mode, Electric does not expose an HTTP API (internally or externally). Messages are streamed internally between Electric and Phoenix.Sync using Elixir function APIs. The only HTTP API for sync is that exposed via your Phoenix Router using the `sync/2` macro and `sync_render/3` function.
209
208
210
-
In `:embedded` mode, Electric must be included an application dependency but does not expose an HTTP API (internally or externally). Messages are streamed internally between Electric and Phoenix.Sync using Elixir function APIs. The only HTTP API for sync is that exposed via your Phoenix Router using the `sync/2` macro and `sync_render/3` function.
209
+
2.`:http` where Electric does _not_ need to be included as an application dependency and Phoenix.Sync consumes data from an external Electric service using it's [HTTP API](https://electric-sql.com/docs/api/http). As for `embedded` mode, the only HTTP API for sync is that exposed via `Phoenix.Sync.Router.sync/2` and `Phoenix.Sync.Controller.sync_render/3`.
210
+
211
+
### Using Igniter
212
+
213
+
`Phoenix.Sync` supports [`Igniter`](https://hexdocs.pm/igniter/readme.html) for automatic configuration of your application.
214
+
215
+
Add Igniter to an existing Elixir project by adding it to your dependencies in mix.exs:
216
+
217
+
```elixir
218
+
{:igniter, "~> 0.6", only: [:dev, :test]}
219
+
```
220
+
221
+
Then use it to install `Phoenix.Sync` in `embedded` mode:
In `:http` mode, Electric does not need to be included as an application dependency. Instead, Phoenix.Sync consumes data from an external Electric service over HTTP.
0 commit comments