Hello Meghalaya Share

POST JSON to /api/share with either itemApiUrl (full URL) or preferred itemApiPath (path + query only). For itemApiPath, server builds final URL from OTT_API_BASE_URL and optional OTT_API_AUTH_TOKEN. Allowed hosts include preprodapi.hellomeghalaya.in, ottapi.hellomeghalaya.in, the host from OTT_API_BASE_URL, plus optional hosts from OTT_API_ALLOWED_HOSTS. Title, description, and image are read from the API (display_title and image from data.thumbnails; description from data.short_description → data.description → last_episode.short_description only, preferring xl_image_16_9 then xl_image_2_3, xl_image_1_1, then medium/small sizes). Medium CDN paths are upgraded to xl_image_16_9 for share posters. New sharePageUrl paths use a short z1 gzip payload so Facebook and browsers are less likely to truncate long Malayalam URLs; older eyJ… links still work. facebookShareUrl and twitterShareUrl use sharePageUrl for the link card. For Android X ACTION_SEND, use androidTwitterShare (twitterShareText, twitterShareUrl page link, title, description, imageUrl (same-origin /api/og-image/… only — not *.cloudfront.net), or pre-built twitterShareMessage). Use android_share_image_url / sharePageImageUrl for bitmap attachments. Top-level twitterShareUrl is the X web intent, not the page link. shareTextWithUrl is invite + sharePageUrl (one https link) for WhatsApp/Telegram. shareInviteTextWithContentUrl adds hmContentUrl for SMS/deep link. For Telegram/WhatsApp: shareTextWithUrl or shareTextWithUrlLines (same string, real newlines). For Facebook Web, With NEXT_PUBLIC_FACEBOOK_APP_ID set, facebookShareUrl uses Facebook's /dialog/share (includes quote with the full invite, or short if the URL is too long). Without it, the URL falls back to sharer.php, which does not show that text—use facebookPasteText or add a Meta app and whitelist …/facebook-share-close as a valid redirect URI.

POST /api/share
Content-Type: application/json

{
  "itemApiPath": "/catalogs/65d4a8652d6455ca1cb980ae/items/babe-kylla.gzip?region=IN&item_language="
}

Facebook previews: Meta must fetch the same public URL as in sharePageUrl. Local dev defaults that host to socialshare.hellomeghalaya.in (unless NEXT_PUBLIC_APP_URL is set)—previews work only if that host serves this app's /share/… routes. For pure local testing without deploy, use ngrok and set NEXT_PUBLIC_APP_URL to the tunnel URL. Refresh cache in the Facebook Sharing Debugger. og:image uses /api/share-asset so Meta and X download images from your app domain (many CDNs block facebookexternalhit / Twitter crawlers). Add hosts via OG_IMAGE_PROXY_ALLOWED_HOSTS if thumbnails are not on CloudFront.

Without NEXT_PUBLIC_APP_URL, requests from localhost still produce sharePageUrl under https://socialshare.hellomeghalaya.in (see getPublicShareOrigin). Override with NEXT_PUBLIC_APP_URL when you use another domain. The API adds ogPreviewWarning for non-public origins.