# `BaileysEx.Connection.Config`
[🔗](https://github.com/jeffhuen/baileys_ex/blob/main/lib/baileys_ex/connection/config.ex#L1)

Connection configuration defaults and platform mapping.

`print_qr_in_terminal` remains only as a compatibility knob with Baileys rc.9.
It is deprecated and does not print QR codes automatically; consumers should
handle `connection.update.qr` themselves.

# `browser`

```elixir
@type browser() :: {String.t(), String.t(), String.t()}
```

# `cached_group_metadata_fun`

```elixir
@type cached_group_metadata_fun() :: (String.t() -&gt; map() | {:ok, map()} | nil)
```

# `platform`

```elixir
@type platform() ::
  :CHROME
  | :FIREFOX
  | :SAFARI
  | :EDGE
  | :OPERA
  | :DESKTOP
  | :DARWIN
  | :WIN32
  | :LINUX
  | :UNKNOWN
```

# `reconnect_policy`

```elixir
@type reconnect_policy() :: :disabled | :restart_required | :all_non_logged_out
```

# `should_sync_history_message_fun`

```elixir
@type should_sync_history_message_fun() :: (map() -&gt; boolean())
```

# `t`

```elixir
@type t() :: %BaileysEx.Connection.Config{
  browser: browser(),
  cached_group_metadata: cached_group_metadata_fun() | nil,
  connect_timeout_ms: pos_integer(),
  country_code: String.t(),
  default_query_timeout_ms: pos_integer(),
  enable_auto_session_recreation: boolean(),
  enable_recent_message_cache: boolean(),
  fire_init_queries: boolean(),
  initial_sync_timeout_ms: pos_integer(),
  keep_alive_interval_ms: pos_integer(),
  mark_online_on_connect: boolean(),
  max_msg_retry_count: pos_integer(),
  max_retries: non_neg_integer(),
  pairing_qr_initial_timeout_ms: pos_integer(),
  pairing_qr_refresh_timeout_ms: pos_integer(),
  pairing_qr_timeout_ms: pos_integer() | nil,
  print_qr_in_terminal: boolean(),
  reconnect_policy: reconnect_policy(),
  retry_delay_ms: pos_integer(),
  retry_request_delay_ms: pos_integer(),
  should_sync_history_message: should_sync_history_message_fun(),
  sync_full_history: boolean(),
  validate_patch_macs: boolean(),
  validate_snapshot_macs: boolean(),
  version: version(),
  ws_url: String.t()
}
```

# `version`

```elixir
@type version() :: [non_neg_integer()]
```

# `default_should_sync_history_message`

```elixir
@spec default_should_sync_history_message(map()) :: boolean()
```

Default logic to determine if a history sync message should be processed.
By default, only non-FULL syncs are processed inline.

# `device_props_platform_type`

```elixir
@spec device_props_platform_type(String.t()) :: non_neg_integer()
```

Returns the numeric device property platform type for a given browser string.
Defaults to 1 (`CHROME`) if missing.

# `new`

```elixir
@spec new(keyword()) :: t()
```

Create a new `Config` with default options.
Accepts a keyword list of overrides.

# `pairing_qr_initial_timeout`

```elixir
@spec pairing_qr_initial_timeout(t()) :: pos_integer()
```

Returns the effective initial QR timeout, honoring the Baileys-style
single override when configured.

# `pairing_qr_refresh_timeout`

```elixir
@spec pairing_qr_refresh_timeout(t()) :: pos_integer()
```

Returns the effective QR refresh timeout, honoring the Baileys-style
single override when configured.

# `platform_id`

```elixir
@spec platform_id(String.t()) :: String.t()
```

Returns the platform ID block identifier for device properties based on browser name.

# `platform_type`

```elixir
@spec platform_type(String.t()) :: platform()
```

Returns the internal platform symbol for a given browser name string.
Returns `:UNKNOWN` if the browser name is not recognized.

# `should_reconnect?`

```elixir
@spec should_reconnect?(t(), term(), non_neg_integer()) :: boolean()
```

Returns whether the runtime should auto-reconnect for the given disconnect
reason and upcoming retry attempt.

# `web_sub_platform`

```elixir
@spec web_sub_platform(t()) :: non_neg_integer()
```

Returns the numeric sub-platform ID for web client features (e.g. Mac/Windows).

---

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