# Release Notes — Social Platforms, Availability & Brand Automation

**Date:** 2026-09-07  
**Scope:** Threads / Pinterest / TikTok, env feature flags, country availability, publish validation, brand website autofill preservation

---

## Previous Version

### What existed
- Central `SOCIAL_PLATFORM_REGISTRY` with LinkedIn, Facebook, Instagram, YouTube **implemented**
- Env kill-switches: `SOCIAL_MEDIA_ENABLED`, `{PLATFORM}_ENABLED`
- OAuth connect + publish for Meta / LinkedIn / YouTube
- Website Intelligence → Brand Profile “fill empty fields” (no overwrite of user values)
- Confirmed Business Context gate for AI generation
- Image + FFmpeg video generation pipeline

### Incomplete / static
- Threads, Pinterest, TikTok marked **Coming soon** (UI placeholders only)
- No country/region platform gating
- No centralized pre-publish media rules API
- Caption limits incomplete for new platforms
- “Coming Soon” shown for platforms that were never wired

### Known limitations
- LinkedIn Company Page posting not implemented
- Facebook personal profile posting not supported by Meta APIs
- MariaDB schema may need migration 005+ (JSON fallback works)
- Public HTTPS image URLs required for Meta/Threads/Pinterest image publish from local/dev

---

## Current Version

### Implemented
1. **Platform registry expansion** — media rules, destinations, blocked/supported countries per platform
2. **Env feature control** — Threads / Pinterest / TikTok gated by `*_ENABLED` + OAuth credentials (default **off**)
3. **Threads** — OAuth (`threads.net`) + Graph publish (text/image)
4. **Pinterest** — OAuth + Pin create (image required, board auto-create)
5. **TikTok** — OAuth + inbox video upload (Content Posting API; finish-in-app when direct publish not audited)
6. **Country availability** — `resolvePlatformCountryAvailability()`; TikTok blocked in `IN` by default; overridable via `PLATFORM_BLOCKED_COUNTRIES_*` / `PLATFORM_ALLOWED_COUNTRIES_*`
7. **Pre-publish validation** — `validateContentForPlatform` + `POST /api/social/validate-content`
8. **Connected Accounts UI** — hides country-blocked / unimplemented platforms; removes “Coming Soon” for wired platforms; connect routes for new OAuth providers
9. **Publish hub** — wires Threads / Pinterest / TikTok into `publishPostToPlatforms` with country + content gates
10. **Brand autofill** — preserved existing website → empty-field fill priority (user > website > inference)

### Configuration / environment
See `.env.example` for:
- `THREADS_*`, `PINTEREST_*`, `TIKTOK_*`
- `PLATFORM_BLOCKED_COUNTRIES_TIKTOK`, `PLATFORM_ALLOWED_COUNTRIES_*`

### Tests
- `npx tsx scripts/test-social-config.ts` (extended registry asserts)
- `npx tsx scripts/test-platform-availability.ts` (country + media validation)

---

## Team update (shareable)

> We finished wiring Threads, Pinterest, and TikTok behind env flags (off by default), added country-based platform availability (TikTok blocked in India by default, overridable), and centralized pre-publish media/content validation. Connected Accounts no longer shows Coming Soon for these platforms—only Disabled / Missing credentials / Ready. Brand website autofill still never overwrites user-entered fields. Enable a platform with `*_ENABLED=true` plus OAuth app credentials, then connect from the UI.
