Skip to main content
Version: 5.9.0

Transport configuration

Server connection settings are described by the ChatTransportConfig model.

Detailed configuration

init(rest: String, webSocket: String, dataStore: String, dataStoreHTTPHeaders: [String: String]? = nil, newRoutesEnabled: Bool = true, apiVersion: APIVersion = .api17)

For full address configuration (for example, in-house installations) specify the URLs of the main server components:

FieldTypeRequiredDescription
restStringYesREST API URL of the backend (for example, https://your-host.edna.io)
webSocketStringYesWebSocket gateway URL (for example, wss://your-host.edna.io/socket)
dataStoreStringYesFiles and media storage URL (for example, https://your-host.edna.io/files)
dataStoreHTTPHeaders[String: String]?No (default nil)HTTP headers for DataStore. After init stored as public var [String: String] (non-optional) — assign [:] to clear
newRoutesEnabledBoolNo (default true)Use the new REST endpoint path for message history. Set to false for servers with legacy routing
apiVersionAPIVersionNo (default .api17)Backend API version. See the API versions table below
let chatTransportConfig = ChatTransportConfig(
rest: "https://your-host.edna.io",
webSocket: "wss://your-host.edna.io/socket",
dataStore: "https://your-host.edna.io/files"
)

Cloud constructor

init(cloudHost host: String, apiVersion: APIVersion = .api17)

For cloud edna Chat Center customers a simplified constructor is available — only the host name is required:

FieldTypeRequiredDescription
cloudHostStringYesHost name in name.edna.io format (without https://)
apiVersionAPIVersionNo (default .api17)Backend API version
let chatTransportConfig = ChatTransportConfig(cloudHost: "your-host.edna.io")

The SDK builds the addresses automatically:

  • REST: https://{host}
  • WebSocket: wss://{host}/socket
  • DataStore: https://{host}/files
Where to get connection parameters

Connection addresses and providerUid are issued during integration. If you don't have them — contact support@edna.io.

Invalid cloudHost fails silently

If cloudHost is given a string from which a valid URL cannot be built (typo, empty string, invalid characters), the SDK initializes without an explicit error, but authorize and all network requests fail silently — with no delegate events.

Validate cloudHost during testing and log chatTransportConfig.debugDescription right after creation. With a valid host the output is:

newRoutesEnabled: true
apiVersion: api17
dataStoreHTTPHeaders: [:]
restURL: https://your-host.edna.io
webSocketURL: wss://your-host.edna.io/socket
dataStoreURL: https://your-host.edna.io/files

With an invalid host the output contains file:// in restURL / webSocketURL / dataStoreURL — that is the indicator that validation failed.

In the detailed constructor (init(rest:webSocket:dataStore:...)) invalid URLs trigger assertionFailure (process crash) in debug builds. In release builds assertionFailure is silent and the SDK initializes with the same file:// placeholders. The cloud constructor does not crash in either debug or release.

Parameter availability

ParameterDetailed constructorCloud constructorMutation after init
rest, webSocket, dataStore✅ requiredbuilt from cloudHost automaticallylet, not allowed
apiVersion✅ optional✅ optionalpublic var — mutate on the instance
dataStoreHTTPHeaders✅ optional❌ not via initpublic var — mutate on the instance
newRoutesEnabled✅ optional❌ not via initpublic var — mutate on the instance

Example of mutating dataStoreHTTPHeaders after creation via the cloud constructor:

var config = ChatTransportConfig(cloudHost: "your-host.edna.io")
config.dataStoreHTTPHeaders = ["X-Auth": "token"]

API versions

The apiVersion parameter selects the backend API version, which determines the available functionality. Refer to the edna ChatCenter server documentation to determine the required API version:

ValueVersionFunctionality
.api1717Baseline (ChatCenter 6.x+)
.api1818Personal data notifications
.api1919Button-based surveys
.api2020Client unblock notification (CLIENT_UNBLOCKED)
.api2121Survey comments
API version compatibility

For a detailed description of API version compatibility with feature sets, see the edna ChatCenter server documentation.

How to determine the current API version on the server

The SDK does not auto-discover the API version — the client application must know it at build time. Ways to determine the version:

  1. Ask edna during integration. Support will inform you of the required APIVersion for your tenant/environment.
  2. Server documentation. The edna ChatCenter installation documentation lists the API version supported by the current server release.

What happens on mismatch

The headerdoc of APIVersion states only the general rule: "On mismatch some features may not work or respond with an error." The exact behavior (which endpoints return an error, which silently ignore unknown fields) is defined on the server side — see the edna ChatCenter documentation.

If, after a server upgrade in production, some features stop working — first verify that apiVersion in the SDK has been raised to the matching value and the app has been rebuilt with the new version.