# cuongcds/advero-node architecture

> Architecture diagram of the GitHub repository cuongcds/advero-node, 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-node
- Repository: https://github.com/cuongcds/advero-node

## Overview

advero-node is a server-side TypeScript client for Advero’s API, authenticated with an organization API key and secret. A caller constructs the client, then uses its methods to manage publisher properties and placements, browse and quote marketplace inventory, manage wallet state, create and start campaigns, and retrieve reports. These are capabilities of one client module, not separate runtime services. The excerpts show request handling and error construction; endpoint coverage is also documented in the README. No backend implementation is included in this repository.

Main entry points: [`src/client.ts`](https://github.com/cuongcds/advero-node/blob/main/src/client.ts) (AdveroClient), [`src/errors.ts`](https://github.com/cuongcds/advero-node/blob/main/src/errors.ts) (API exception), [`src/types.ts`](https://github.com/cuongcds/advero-node/blob/main/src/types.ts) (Request and response types)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["API client"]
  node_client["AdveroClient<br/>[client.ts]"]
end

subgraph group_capabilities["API capabilities"]
  node_properties["Properties and placements<br/>[client.ts]"]
  node_pricing["Pricing plans<br/>[client.ts]"]
  node_marketplace["Marketplace inventory<br/>[client.ts]"]
  node_wallet["Wallet<br/>[client.ts]"]
  node_campaigns["Campaigns and line items<br/>[client.ts]"]
  node_creatives["Creatives<br/>[client.ts]"]
  node_reports["Reports<br/>[client.ts]"]
end

subgraph group_contracts["Types and errors"]
  node_errors["API exception<br/>[errors.ts]"]
  node_types["Request and response types<br/>[types.ts]"]
end

node_caller(("Node.js caller"))
node_api{{"Advero API"}}

node_caller -->|"calls methods"| node_client
node_client -->|"sends HTTP requests"| node_api
node_client -->|"throws on API errors"| node_errors
node_client -->|"uses types"| node_types

click node_client "https://github.com/cuongcds/advero-node/blob/main/src/client.ts"
click node_properties "https://github.com/cuongcds/advero-node/blob/main/src/client.ts"
click node_pricing "https://github.com/cuongcds/advero-node/blob/main/src/client.ts"
click node_marketplace "https://github.com/cuongcds/advero-node/blob/main/src/client.ts"
click node_wallet "https://github.com/cuongcds/advero-node/blob/main/src/client.ts"
click node_campaigns "https://github.com/cuongcds/advero-node/blob/main/src/client.ts"
click node_creatives "https://github.com/cuongcds/advero-node/blob/main/src/client.ts"
click node_reports "https://github.com/cuongcds/advero-node/blob/main/src/client.ts"
click node_errors "https://github.com/cuongcds/advero-node/blob/main/src/errors.ts"
click node_types "https://github.com/cuongcds/advero-node/blob/main/src/types.ts"

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_client toneBlue
class node_properties,node_pricing,node_marketplace,node_wallet,node_campaigns,node_creatives,node_reports toneAmber
class node_errors,node_types,node_api toneMint
class node_caller toneIndigo
```

## Components

### API client

- [AdveroClient](https://github.com/cuongcds/advero-node/blob/main/src/client.ts): `src/client.ts`

### API capabilities

- [Properties and placements](https://github.com/cuongcds/advero-node/blob/main/src/client.ts): `src/client.ts`
- [Pricing plans](https://github.com/cuongcds/advero-node/blob/main/src/client.ts): `src/client.ts`
- [Marketplace inventory](https://github.com/cuongcds/advero-node/blob/main/src/client.ts): `src/client.ts`
- [Wallet](https://github.com/cuongcds/advero-node/blob/main/src/client.ts): `src/client.ts`
- [Campaigns and line items](https://github.com/cuongcds/advero-node/blob/main/src/client.ts): `src/client.ts`
- [Creatives](https://github.com/cuongcds/advero-node/blob/main/src/client.ts): `src/client.ts`
- [Reports](https://github.com/cuongcds/advero-node/blob/main/src/client.ts): `src/client.ts`

### Types and errors

- [API exception](https://github.com/cuongcds/advero-node/blob/main/src/errors.ts): `src/errors.ts`
- [Request and response types](https://github.com/cuongcds/advero-node/blob/main/src/types.ts): `src/types.ts`

### Other components

- **Node.js caller**
- **Advero API**

## Connections

- Node.js caller → AdveroClient: calls methods (evidence: `README.md`)
- AdveroClient → Advero API: sends HTTP requests (evidence: `src/client.ts`)
- AdveroClient → API exception: throws on API errors (evidence: `src/client.ts`)
- AdveroClient → Request and response types: uses types (evidence: `src/client.ts`)
