# cuongcds/advero-sdk architecture

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

- Interactive diagram: https://gitdiagram.com/cuongcds/advero-sdk
- Repository: https://github.com/cuongcds/advero-sdk

## Overview

Advero SDK is a browser-side library publishers initialize and call to request and display ads in page slots. Its main flow optionally waits for a slot to approach the viewport, fetches a placement’s ad from a configured Ad Serving Engine, and renders an advertiser creative or placeholder. Advertiser creatives also get a disclosure badge and viewability measurement. The runtime is implemented in one source file; the README documents some behavior whose implementation lines were not included in the excerpt.

Main entry points: [`src/index.js`](https://github.com/cuongcds/advero-sdk/blob/main/src/index.js) (SDK API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_integration["Publisher integration"]
  node_sdk["SDK API<br/>[index.js]"]
  node_slot["Slot resolution<br/>[index.js]"]
  node_lazy["Lazy gate<br/>[index.js]"]
end

subgraph group_delivery["Ad delivery"]
  node_engine["Ad Serving Engine"]
  node_response["Ad response"]
  node_beacon["View beacon endpoint"]
end

subgraph group_presentation["Rendering and measurement"]
  node_creative["Creative rendering<br/>[index.js]"]
  node_badge["Disclosure badge<br/>[index.js]"]
  node_asset["Badge icon asset"]
  node_viewability["Viewability tracking<br/>[index.js]"]
end

node_publisher(("Publisher site"))

node_publisher -->|"configures and calls"| node_sdk
node_sdk -->|"resolves slot"| node_slot
node_sdk -->|"optionally awaits"| node_lazy
node_sdk -->|"fetches ad"| node_engine
node_engine -->|"returns creative data"| node_response
node_response -->|"supplies render data"| node_creative
node_creative -->|"adds for advertisers"| node_badge
node_badge -->|"loads icon"| node_asset
node_creative -->|"starts measurement"| node_viewability
node_viewability -->|"sends view beacon"| node_beacon

click node_sdk "https://github.com/cuongcds/advero-sdk/blob/main/src/index.js"
click node_slot "https://github.com/cuongcds/advero-sdk/blob/main/src/index.js"
click node_lazy "https://github.com/cuongcds/advero-sdk/blob/main/src/index.js"
click node_creative "https://github.com/cuongcds/advero-sdk/blob/main/src/index.js"
click node_badge "https://github.com/cuongcds/advero-sdk/blob/main/src/index.js"
click node_viewability "https://github.com/cuongcds/advero-sdk/blob/main/src/index.js"

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_sdk,node_slot,node_lazy toneBlue
class node_engine,node_response,node_beacon toneAmber
class node_creative,node_badge,node_asset,node_viewability toneMint
class node_publisher toneIndigo
```

## Components

### Publisher integration

- [SDK API](https://github.com/cuongcds/advero-sdk/blob/main/src/index.js): `src/index.js`
- [Slot resolution](https://github.com/cuongcds/advero-sdk/blob/main/src/index.js): `src/index.js`
- [Lazy gate](https://github.com/cuongcds/advero-sdk/blob/main/src/index.js): `src/index.js`

### Ad delivery

- **Ad Serving Engine**
- **Ad response**
- **View beacon endpoint**

### Rendering and measurement

- [Creative rendering](https://github.com/cuongcds/advero-sdk/blob/main/src/index.js): `src/index.js`
- [Disclosure badge](https://github.com/cuongcds/advero-sdk/blob/main/src/index.js): `src/index.js`
- **Badge icon asset**
- [Viewability tracking](https://github.com/cuongcds/advero-sdk/blob/main/src/index.js): `src/index.js`

### Other components

- **Publisher site**

## Connections

- Publisher site → SDK API: configures and calls (evidence: `README.md`)
- SDK API → Slot resolution: resolves slot (evidence: `src/index.js`)
- SDK API → Lazy gate: optionally awaits (evidence: `src/index.js`)
- SDK API → Ad Serving Engine: fetches ad (evidence: `README.md`)
- Ad Serving Engine → Ad response: returns creative data (evidence: `README.md`)
- Ad response → Creative rendering: supplies render data (evidence: `README.md`)
- Creative rendering → Disclosure badge: adds for advertisers (evidence: `src/index.js`)
- Disclosure badge → Badge icon asset: loads icon (evidence: `src/index.js`)
- Creative rendering → Viewability tracking: starts measurement (evidence: `src/index.js`)
- Viewability tracking → View beacon endpoint: sends view beacon (evidence: `README.md`)
