Skip to content

Backend Integration and Content Consumption

Child sites only read from the backend. They never write to it. All reads go through the /api/v1/client route group, which requires an API key for access.

Every request must include the API key:

GET /api/v1/client/posts?page=1
x-api-key: your-api-key-here

Or as a query param:

GET /api/v1/client/posts?page=1&api_key=your-api-key-here

The API key is set in news-server/.env as API_KEY. Child sites read it from their own .env (e.g. VITE_API_KEY).

EndpointPurpose
GET /api/v1/client/posts?page=1Paginated list of published articles
GET /api/v1/client/article/:slugSingle article by slug
GET /api/v1/client/allAll published articles (no pagination)
GET /api/v1/client/partner-articlesArticles from RSS-aggregated publishers

Articles imported from publisher RSS feeds include source metadata. Child sites should display this to readers:

{
"isAggregated": true,
"source": "CryptoNews Weekly",
"sourceUrl": "https://cryptonewsweekly.com/article/bitcoin-rally"
}