# Architecture

> **TL;DR** — Wandura copies the films and fitness collections it licenses to you into **your own video space** on its video platform. Your server reads that space with its own key and hands playback links to your app. Films play with the licensed Player SDK. Your server reads the metadata the platform does not hold from Wandura's API. You decide which viewer may watch what. The older path, one ticket per episode from `POST /playback`, is frozen: it keeps working for apps already on it, but new integrations use their own space.

## The pieces
```mermaid
flowchart LR
  subgraph You["Your systems"]
    App["Your app<br/>Player SDK for films"]
    BE["Your backend<br/>keys, paywall"]
    DB["Your database"]
  end
  subgraph W["Wandura"]
    Space["Your own space<br/>on the video platform"]
    API["Delivery API<br/>metadata"]
  end
  BE -->|"list videos, playback info<br/>(space key)"| Space
  BE -->|"metadata (API key)"| API
  BE --> DB
  App -->|"play request"| BE
  BE -->|"playback link"| App
  App -->|"stream"| Space
```

| Piece | Runs | Talks to | Holds |
|---|---|---|---|
| Space reader | Your backend | Your own space | Your space key, which reads, plays and edits your space only |
| Metadata sync | Your backend, on a schedule or when Wandura notifies it | Wandura's Delivery API, for example `GET /series` | A `metadata:read` key; writes your film tables |
| App | Viewer's phone | Your backend, then your space to play | The playback link for the episode being watched |
| Player SDK | Inside your app, for films | Your own space | Its licence file |
| Creatives sync (optional) | Your backend | `GET /creatives` | A `creatives:export` key |

One play, step by step: [Your own video space · How it works](https://docs.wandura.ai/developers/concepts/own-space#how-it-works).

## Who does what
| Area | Wandura | Your team |
|---|---|---|
| Films | Produces, encodes and protects every film. Copies the films and fitness collections it licenses to you into your space, with titles, images and subtitles. | Shows them in your app. You may edit titles, descriptions, playlists and images in your space; Wandura leaves your edits alone. |
| Rights | Grants your organisation a licence per film, with an optional window. Copies only licensed content into your space, and removes it when the licence ends. | Follows any other limits of your contract (for example countries). Drops ended content from your app: [When rights end](https://docs.wandura.ai/developers/production/rights-end). |
| Viewers and money | Nothing: Wandura has no viewer identity. | Accounts, sign-in, paywall, free episodes, coins, subscriptions, refunds, viewer support. |
| Keys | Issues your space key, and a new one if it leaks. Your Admins and Developers create, rotate and revoke their own Wandura API keys. | Keeps every key on your servers. Tells Wandura at once if the space key may have leaked. |
| Player | Registers your app IDs and issues the Player SDK licence (your organisation pays for it). | Integrates the Player SDK in each app that plays films. |
| Playback | Sets up your space with a playback domain that belongs to your organisation alone. | Gets playback links from your space, only for episodes the viewer may watch. |
| Usage | The video platform counts plays, bytes, storage and transcoding per space. Wandura bills from those same numbers. | Asks for one playback domain per app if you need numbers per app. |

## How your app plays films
|  | **Your own video space** |
|---|---|
| For | Every partner app that shows Wandura films or fitness clips |
| Content list | Read from your own space with your key. Metadata the platform does not hold (cast, artwork, each episode's video ID in your space) comes from Wandura's API, which can also notify your server when a series changes: [Metadata](https://docs.wandura.ai/developers/concepts/own-space#metadata). |
| Playback | Links your server gets from your space, on your own playback domain |
| Player | The Player SDK (licensed) for films; any standard player for fitness clips |
| Licence check | Only licensed content is copied into your space |
| Start with | [Your own video space](https://docs.wandura.ai/developers/concepts/own-space) |

Wandura sets up each space with you; ask in your team's Discord channel to start. If you are starting a new integration, it uses your own space.

### Frozen paths
Two older paths keep working, and apps already on them need change nothing. Wandura is no longer adding to them, and new integrations should not start on them:

- **Through Wandura**: one ticket per episode from `POST /playback`. See [Playback and tickets](https://docs.wandura.ai/developers/concepts/playback).
- **Open video**: signed MP4 links from `GET /videos`. See [Open video](https://docs.wandura.ai/developers/concepts/open-video).

## Related
- [Before you start](https://docs.wandura.ai/developers/before-you-start)
- [Your own video space](https://docs.wandura.ai/developers/concepts/own-space)
- [Security](https://docs.wandura.ai/developers/concepts/security): the trust boundary.
- [Canonical API behaviour](https://docs.wandura.ai/developers/reference/behaviour)
