Share this link or file with your AI builder.

ZenStudio — AI website connection guide

Give this prompt to the AI builder for one destination website. It adds a private receiver that turns ZenStudio deliveries into real posts owned by that website.

Before you start

  1. Add the website in ZenStudio under Connected Sites, then copy its private Connection token.
  2. Give the prompt below to the AI builder working in that destination website's project.
  3. Save the token in that host's encrypted server settings, publish the destination, then paste its final HTTPS receiver URL into ZenStudio.
  4. Use Test receiver, publish one item, and check that the destination copy remains after you delete it from ZenStudio.

Copy the complete AI prompt

Connect this existing website to ZenStudio at https://getzenstudio.lovable.app as a small receiver-only integration. Do not create a second studio, API-key generator, indexing tool, connected-sites manager, or content export back to ZenStudio.

SETUP
1. Add an admin-only “ZenStudio Connect” area in the existing admin, using this site's design and authentication.
2. Store the ZenStudio Connection token only in this host's encrypted server settings as ZENSTUDIO_TOKEN. Never put it in browser code, local storage, public settings, logs, or a plaintext database column. Show only Configured or Not configured, plus a replace-token instruction.
3. Create one public server POST endpoint at a stable HTTPS URL, for example /api/zenstudio/receive. Give the owner its final URL to paste into ZenStudio Connected Sites.
4. Show real received video/article counts and recent receiver failures. Do not show sample or fake counts.

RECEIVER RULES
- Accept only POST over HTTPS with application/json. Read x-zenstudio-token and compare it with ZENSTUDIO_TOKEN in constant time. If missing or incorrect, return 401 and do not process the body.
- Validate x-zenstudio-event and the JSON body. Accept ping, video.published, video.updated, article.published, and article.updated. Reject unknown events with 400.
- Upsert by ZenStudio data.id so retries and republishing update the same post, never create duplicates.
- For uploaded videos (source_type = file), download stream_url and thumbnail_url server-side into this website's own storage before returning success, then save destination-owned URLs on the post. This makes the published copy remain available even if ZenStudio is deleted or permanently offline.
- For direct links and embeds, preserve the supplied video, embed, thumbnail, origin URL, and attribution fields. Explain that these continue only while the original provider serves them.
- Publish real public video and article pages through the existing content system. Render a native video player from the destination file/direct URL, or a safe iframe from embed_url. Never inject untrusted player_html.
- After the post and required media are committed, return JSON exactly shaped like {"ok":true,"stored":true,"post_id":"<same data.id>"}. ZenStudio confirms the destination actually saved the same content ID; a plain 2xx without this acknowledgement is a failed/unconfirmed delivery. For ping only, return {"ok":true}. Return non-2xx for any failure so ZenStudio can log and retry.
- ZenStudio does not send delete events. Never delete or unpublish an existing destination post because it was deleted, moved to draft, or became unavailable in ZenStudio.

FINISH
- Give the owner exact host-specific token setup steps, the final receiver URL, and a test checklist.
- Verify: wrong token returns 401; ZenStudio test returns {"ok":true}; publish returns {"ok":true,"stored":true,"post_id":"<same data.id>"} after saving; an uploaded video appears and plays from local storage; republishing updates the existing post; deleting in ZenStudio leaves the destination post live.
- Keep all existing routes and features working. Do not use mock success or demo rows.

No API key is needed for new push setup. HTTPS protects the token while it travels; it must remain private on the destination server.