# shushinde/aepsdk-edge-ios architecture

> Architecture diagram of the GitHub repository shushinde/aepsdk-edge-ios, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-06). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/shushinde/aepsdk-edge-ios
- Repository: https://github.com/shushinde/aepsdk-edge-ios

## Overview

AEPEdge is a mobile SDK extension that sends app experience and consent data to Adobe Experience Edge, then exposes response content and completion/error callbacks. The principal flow is app API → Edge event coordination → queued hit processing → request construction and network transport → response handling. The runtime also manages batching, consent-gated sending, shared state, and persisted response-store payloads. Source excerpts and the SOURCE INDEX support the internal links shown; identity, Core, and the remote Edge service are external dependencies, with some integration details documented only in the README.

Main entry points: [`Sources/Edge.swift`](https://github.com/shushinde/aepsdk-edge-ios/blob/main/Sources/Edge.swift) (Edge event coordinator), [`Sources/EdgeNetworkHandlers/EdgeHitProcessor.swift`](https://github.com/shushinde/aepsdk-edge-ios/blob/main/Sources/EdgeNetworkHandlers/EdgeHitProcessor.swift) (Hit processor), [`Sources/EdgeNetworkHandlers/EdgeNetworkService.swift`](https://github.com/shushinde/aepsdk-edge-ios/blob/main/Sources/EdgeNetworkHandlers/EdgeNetworkService.swift) (Network service), [`Sources/EdgeNetworkHandlers/EdgeBatchingHitQueue.swift`](https://github.com/shushinde/aepsdk-edge-ios/blob/main/Sources/EdgeNetworkHandlers/EdgeBatchingHitQueue.swift) (Batch hit queue)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["SDK entry and state"]
  node_edge_api["Public Edge API"]
  node_edge["Edge event coordinator<br/>[Edge.swift]"]
  node_state["Consent and Edge state<br/>[EdgeState.swift]"]
  node_events["Experience events"]
  node_shared_state["Shared-state reader"]
end

subgraph group_pipeline["Event delivery"]
  node_hit_queue["Batch hit queue"]
  node_batch_config["Batching configuration"]
  node_processor["Hit processor"]
end

subgraph group_network["Network exchange"]
  node_request_builder["Request builder"]
  node_endpoint["Endpoint selection<br/>[EdgeEndpoint.swift]"]
  node_network_service["Network service"]
end

subgraph group_response["Response and persistence"]
  node_response_handler["Network response handler"]
  node_completion["Completion manager"]
  node_store_manager[("Response payload store")]
  node_handles["Event response handles"]
end

node_app(("Mobile app"))
node_core["AEPCore / AEPServices"]
node_identity["Edge Identity"]
node_edge_network(("Adobe Edge Network"))

node_app -->|"submits events"| node_edge_api
node_edge_api -->|"delegates to"| node_edge
node_edge -.->|"accepts events"| node_events
node_edge -->|"updates state"| node_state
node_edge -->|"reads shared state"| node_shared_state
node_edge -->|"enqueues hits"| node_hit_queue
node_core -.->|"delivers events"| node_edge
node_identity -.->|"provides identity state"| node_shared_state
node_state -->|"applies consent"| node_hit_queue
node_batch_config -.->|"configures batching"| node_hit_queue
node_hit_queue -->|"processes hits"| node_processor
node_processor -->|"builds requests"| node_request_builder
node_processor -->|"sends hits"| node_network_service
node_processor -->|"registers pending events"| node_response_handler
node_request_builder -->|"reads stored payloads"| node_store_manager
node_network_service -->|"selects endpoint"| node_endpoint
node_network_service -->|"posts requests"| node_edge_network
node_edge_network -.->|"returns response"| node_network_service
node_response_handler -->|"completes events"| node_completion
node_response_handler -->|"persists payloads"| node_store_manager
node_completion -->|"delivers handles"| node_handles

click node_edge_api "https://github.com/shushinde/aepsdk-edge-ios/blob/main/Sources/Edge%2BPublicAPI.swift"
click node_edge "https://github.com/shushinde/aepsdk-edge-ios/blob/main/Sources/Edge.swift"
click node_state "https://github.com/shushinde/aepsdk-edge-ios/blob/main/Sources/EdgeState.swift"
click node_events "https://github.com/shushinde/aepsdk-edge-ios/blob/main/Sources/ExperienceEvent.swift"
click node_shared_state "https://github.com/shushinde/aepsdk-edge-ios/blob/main/Sources/EdgeNetworkHandlers/SharedStateReader.swift"
click node_hit_queue "https://github.com/shushinde/aepsdk-edge-ios/blob/main/Sources/EdgeNetworkHandlers/EdgeBatchingHitQueue.swift"
click node_batch_config "https://github.com/shushinde/aepsdk-edge-ios/blob/main/Sources/EdgeNetworkHandlers/EdgeBatchingConfig.swift"
click node_processor "https://github.com/shushinde/aepsdk-edge-ios/blob/main/Sources/EdgeNetworkHandlers/EdgeHitProcessor.swift"
click node_request_builder "https://github.com/shushinde/aepsdk-edge-ios/blob/main/Sources/EdgeNetworkHandlers/RequestBuilder.swift"
click node_endpoint "https://github.com/shushinde/aepsdk-edge-ios/blob/main/Sources/EdgeNetworkHandlers/EdgeEndpoint.swift"
click node_network_service "https://github.com/shushinde/aepsdk-edge-ios/blob/main/Sources/EdgeNetworkHandlers/EdgeNetworkService.swift"
click node_response_handler "https://github.com/shushinde/aepsdk-edge-ios/blob/main/Sources/EdgeNetworkHandlers/NetworkResponseHandler.swift"
click node_completion "https://github.com/shushinde/aepsdk-edge-ios/blob/main/Sources/EdgeNetworkHandlers/CompletionHandlersManager.swift"
click node_store_manager "https://github.com/shushinde/aepsdk-edge-ios/blob/main/Sources/EdgeNetworkHandlers/StoreResponsePayloadManager.swift"
click node_handles "https://github.com/shushinde/aepsdk-edge-ios/blob/main/Sources/EdgeEventHandle.swift"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_edge_api,node_edge,node_state,node_events,node_shared_state toneBlue
class node_hit_queue,node_batch_config,node_processor toneAmber
class node_request_builder,node_endpoint,node_network_service toneMint
class node_response_handler,node_completion,node_store_manager,node_handles toneRose
class node_app,node_core,node_identity,node_edge_network toneIndigo
```

## Components

### SDK entry and state

- [Public Edge API](https://github.com/shushinde/aepsdk-edge-ios/blob/main/Sources/Edge%2BPublicAPI.swift): `Sources/Edge+PublicAPI.swift`
- [Edge event coordinator](https://github.com/shushinde/aepsdk-edge-ios/blob/main/Sources/Edge.swift): `Sources/Edge.swift`
- [Consent and Edge state](https://github.com/shushinde/aepsdk-edge-ios/blob/main/Sources/EdgeState.swift): `Sources/EdgeState.swift`
- [Experience events](https://github.com/shushinde/aepsdk-edge-ios/blob/main/Sources/ExperienceEvent.swift): `Sources/ExperienceEvent.swift`
- [Shared-state reader](https://github.com/shushinde/aepsdk-edge-ios/blob/main/Sources/EdgeNetworkHandlers/SharedStateReader.swift): `Sources/EdgeNetworkHandlers/SharedStateReader.swift`

### Event delivery

- [Batch hit queue](https://github.com/shushinde/aepsdk-edge-ios/blob/main/Sources/EdgeNetworkHandlers/EdgeBatchingHitQueue.swift): `Sources/EdgeNetworkHandlers/EdgeBatchingHitQueue.swift`
- [Batching configuration](https://github.com/shushinde/aepsdk-edge-ios/blob/main/Sources/EdgeNetworkHandlers/EdgeBatchingConfig.swift): `Sources/EdgeNetworkHandlers/EdgeBatchingConfig.swift`
- [Hit processor](https://github.com/shushinde/aepsdk-edge-ios/blob/main/Sources/EdgeNetworkHandlers/EdgeHitProcessor.swift): `Sources/EdgeNetworkHandlers/EdgeHitProcessor.swift`

### Network exchange

- [Request builder](https://github.com/shushinde/aepsdk-edge-ios/blob/main/Sources/EdgeNetworkHandlers/RequestBuilder.swift): `Sources/EdgeNetworkHandlers/RequestBuilder.swift`
- [Endpoint selection](https://github.com/shushinde/aepsdk-edge-ios/blob/main/Sources/EdgeNetworkHandlers/EdgeEndpoint.swift): `Sources/EdgeNetworkHandlers/EdgeEndpoint.swift`
- [Network service](https://github.com/shushinde/aepsdk-edge-ios/blob/main/Sources/EdgeNetworkHandlers/EdgeNetworkService.swift): `Sources/EdgeNetworkHandlers/EdgeNetworkService.swift`

### Response and persistence

- [Network response handler](https://github.com/shushinde/aepsdk-edge-ios/blob/main/Sources/EdgeNetworkHandlers/NetworkResponseHandler.swift): `Sources/EdgeNetworkHandlers/NetworkResponseHandler.swift`
- [Completion manager](https://github.com/shushinde/aepsdk-edge-ios/blob/main/Sources/EdgeNetworkHandlers/CompletionHandlersManager.swift): `Sources/EdgeNetworkHandlers/CompletionHandlersManager.swift`
- [Response payload store](https://github.com/shushinde/aepsdk-edge-ios/blob/main/Sources/EdgeNetworkHandlers/StoreResponsePayloadManager.swift): `Sources/EdgeNetworkHandlers/StoreResponsePayloadManager.swift`
- [Event response handles](https://github.com/shushinde/aepsdk-edge-ios/blob/main/Sources/EdgeEventHandle.swift): `Sources/EdgeEventHandle.swift`

### Other components

- **Mobile app**
- **AEPCore / AEPServices**
- **Edge Identity**
- **Adobe Edge Network**

## Connections

- Mobile app → Public Edge API: submits events (evidence: `Sources/Edge+PublicAPI.swift`)
- Public Edge API → Edge event coordinator: delegates to (evidence: `Sources/Edge+PublicAPI.swift`)
- Edge event coordinator → Experience events: accepts events
- Edge event coordinator → Consent and Edge state: updates state (evidence: `Sources/Edge.swift`)
- Edge event coordinator → Shared-state reader: reads shared state (evidence: `Sources/Edge.swift`)
- Edge event coordinator → Batch hit queue: enqueues hits (evidence: `Sources/Edge.swift`)
- AEPCore / AEPServices → Edge event coordinator: delivers events (evidence: `README.md`)
- Edge Identity → Shared-state reader: provides identity state (evidence: `README.md`)
- Consent and Edge state → Batch hit queue: applies consent (evidence: `Sources/EdgeState.swift`)
- Batching configuration → Batch hit queue: configures batching (evidence: `Sources/EdgeNetworkHandlers/EdgeBatchingHitQueue.swift`)
- Batch hit queue → Hit processor: processes hits (evidence: `Sources/EdgeNetworkHandlers/EdgeBatchingHitQueue.swift`)
- Hit processor → Request builder: builds requests (evidence: `Sources/EdgeNetworkHandlers/EdgeHitProcessor.swift`)
- Hit processor → Network service: sends hits (evidence: `Sources/EdgeNetworkHandlers/EdgeHitProcessor.swift`)
- Hit processor → Network response handler: registers pending events (evidence: `Sources/EdgeNetworkHandlers/EdgeHitProcessor.swift`)
- Request builder → Response payload store: reads stored payloads (evidence: `Sources/EdgeNetworkHandlers/RequestBuilder.swift`)
- Network service → Endpoint selection: selects endpoint (evidence: `Sources/EdgeNetworkHandlers/EdgeNetworkService.swift`)
- Network service → Adobe Edge Network: posts requests (evidence: `Sources/EdgeNetworkHandlers/EdgeNetworkService.swift`)
- Adobe Edge Network → Network service: returns response
- Network response handler → Completion manager: completes events (evidence: `Sources/EdgeNetworkHandlers/NetworkResponseHandler.swift`)
- Network response handler → Response payload store: persists payloads (evidence: `Sources/EdgeNetworkHandlers/NetworkResponseHandler.swift`)
- Completion manager → Event response handles: delivers handles (evidence: `Sources/EdgeNetworkHandlers/CompletionHandlersManager.swift`)
