> For the complete documentation index, see [llms.txt](https://docs.ecommerce.seb.ee/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ecommerce.seb.ee/integration/mobile-sdk/ios-sdk/reference/configuration.md).

# Configuration

Every Configuration initializer and property, with defaults and meanings.

`Configuration` / `EGWConfiguration`

Holds the hosts the SDK talks to and the behavioural settings for a `PaymentKit`. All properties are immutable; create a new instance to change one.

***

## Initializers

```swift
init(apiBaseURL: URL?,
     checkoutAPIBaseURL: URL? = nil,
     checkoutBaseURL: URL? = nil,
     environment: Environment,
     requestTimeout: TimeInterval = 30,
     loggingEnabled: Bool = false)
```

Two convenience forms are also available:

```swift
init(apiBaseURL: URL?, environment: Environment)

init(apiBaseURL: URL?,
     checkoutAPIBaseURL: URL?,
     checkoutBaseURL: URL?,
     environment: Environment)
```

Objective-C selectors:

```objc
- initWithApiBaseURL:checkoutAPIBaseURL:checkoutBaseURL:environment:requestTimeout:loggingEnabled:
- initWithApiBaseURL:environment:
- initWithApiBaseURL:checkoutAPIBaseURL:checkoutBaseURL:environment:
```

***

## Properties

| Property             | Type           | Default | Description                                                                                                                                                                                                                                                                                      |
| -------------------- | -------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `apiBaseURL`         | `URL?`         | none    | The backend the SDK asks for the payment status. The SDK appends `/checkout/api/egw/v1/payments/{paymentId}`. `nil` means no lookup is attempted and every payment finishes `.unresolved`, unless a custom `PaymentStatusResolving` was supplied.                                                |
| `checkoutAPIBaseURL` | `URL?`         | `nil`   | The client-facing checkout API used by the native card form for card session and 3-D Secure calls. The SDK appends `/checkout/api/egw/v1/payments/{paymentId}/…` and authorises every call with the payment's verification key, sent as `Authorization: Bearer`. Required by `startCardPayment`. |
| `checkoutBaseURL`    | `URL?`         | `nil`   | The checkout page host. Serves the card encryption key and the page a 3-D Secure challenge result is posted back to. Required by `startCardPayment`.                                                                                                                                             |
| `environment`        | `Environment`  | none    | Informational. Changes no URL; carried so your own code and logs can tell sandbox from live.                                                                                                                                                                                                     |
| `requestTimeout`     | `TimeInterval` | `30`    | Bounds the SDK's own API requests. A value of zero or less is treated as 30 seconds. Neither web view is timed out, because a shopper reading a bank's confirmation screen is not a stalled request.                                                                                             |
| `loggingEnabled`     | `Bool`         | `false` | Logs flow milestones through `os_log`. Never logs bodies, card data, credentials, or full URLs.                                                                                                                                                                                                  |

None of the three URLs is derived from another. Set each one explicitly.

### Which flow reads which URL

|                      | Hosted checkout            | Native card form                     |
| -------------------- | -------------------------- | ------------------------------------ |
| `apiBaseURL`         | Used for the status lookup | Used for the status lookup, optional |
| `checkoutAPIBaseURL` | Not used                   | Required                             |
| `checkoutBaseURL`    | Not used                   | Required                             |

***

## Environment

`Environment` / `EGWEnvironment`

| Case       | Objective-C             | Raw value |
| ---------- | ----------------------- | --------- |
| `.sandbox` | `EGWEnvironmentSandbox` | `0`       |
| `.live`    | `EGWEnvironmentLive`    | `1`       |

***

## Examples

Hosted checkout only:

```swift
let configuration = Configuration(
    apiBaseURL: URL(string: "https://your-backend.example.com"),
    environment: .sandbox
)
```

With the native card form:

```swift
let configuration = Configuration(
    apiBaseURL: URL(string: "https://your-backend.example.com"),
    checkoutAPIBaseURL: URL(string: "https://sandbox-api.example.com"),
    checkoutBaseURL: URL(string: "https://sandbox-checkout.example.com"),
    environment: .sandbox,
    requestTimeout: 30,
    loggingEnabled: false
)
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.ecommerce.seb.ee/integration/mobile-sdk/ios-sdk/reference/configuration.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
