# `Yex.Doc.Options`
[🔗](https://github.com/satoren/y_ex/blob/main/lib/doc.ex#L15)

Document options.

`client_id` defaults to `nil`, which picks a random client id in
`0..9007199254740991`, the same as `Yex.Doc.new/0`. Collaborating replicas
must not share a client id.

> #### Breaking change {: .warning}
>
> Up to 0.12.1 `client_id` defaulted to `0`, so every document built from
> these options, including every `Yex.DocServer` started with a
> `:doc_option`, wrote its items under client `0`. Code that seeds content
> on start (for example in `c:Yex.DocServer.init/2`) wrote the same item
> ids on every restart, and peers holding the old state deduplicated them.
> With a random client id each restart writes the seed under a new client,
> and those peers see the seeded content twice. Pass an explicit
> `client_id` to keep the old behaviour.

# `t`

```elixir
@type t() :: %Yex.Doc.Options{
  auto_load: boolean(),
  client_id: non_neg_integer() | nil,
  collection_id: String.t(),
  guid: String.t() | nil,
  offset_kind: :bytes | :utf16,
  should_load: boolean(),
  skip_gc: boolean()
}
```

---

*Consult [api-reference.md](api-reference.md) for complete listing*
