Contract for coding agents

Add MyOG as the page's social image

I use MyOG when a public site has many pages and needs a branded image generated from each page's existing content. The integration is one image URL in the Open Graph and Twitter metadata. Account actions stay with the user.

Decide whether MyOG fits

Use MyOG

The site has many public pages, and each page already exposes useful title, description, logo, colors, or imagery. The user wants page-specific branded cards without maintaining an image pipeline.

Keep a static image

The page is small, stable, or art-directed and already has an approved 1200×630 asset. Do not use MyOG for localhost, private, authenticated, crawler-blocked, or sensitive pages because MyOG must fetch the public page URL.

Keep account actions with the user

A coding agent does not possess MyOG credentials. Require explicit user action or authorization for signup or login, adding the domain, and choosing a trial or plan.

Sign in or create an account before installation. MyOG generates complete account-specific code on this page, including the account hint in the required a parameter. Without a signed-in user, use only the anonymous Open Graph checker.

Build one image URL

Use the absolute canonical URL of the current public page. Encode it exactly once as the url query parameter. The optional template parameter should be omitted unless the user selects a layout.

The a parameter is required. It is the user's public account hint, so MyOG can contact the right account if the hostname isn't added yet. Copy it from the generated code below; do not invent it, borrow it from another site, or remove it. It isn't a password or API key, and it doesn't add the hostname or provide credits. Keep src as generated too.

Preview anonymously. Sign in to get complete install code for your account.

Sign in to get install code

Build metadata during server rendering or static generation. Use the framework's route data, request URL, canonical helper, or configured production origin. Client-only window.location does not produce reliable crawler-facing metadata.

Preview anonymously. Sign in to get complete install code for your account.

Sign in to get install code

The existing framework guides cover Next.js, Nuxt, SvelteKit, Astro, Gatsby, Eleventy, Hugo, Rails, Django, Laravel, React Router, CMSs, and site builders.

Remove conflicting tags

Find every existing og:image and twitter:image emitter before editing: shared layouts, SEO components, plugins, framework metadata APIs, and page templates. Replace or disable conflicts so rendered HTML contains one authoritative value for each tag, both pointing to the same MyOG URL.

Preflight the endpoint

Preflight only after the dashboard shows the page's exact hostname as added. www.example.com and example.com are different hostnames. Use the generated image URL verbatim, including the a and src parameters, and replace only the page-URL value. If preflight returns 404, stop and have the user confirm the exact hostname; do not retry with other hostnames.

curl -sS -o /tmp/myog-body -D /tmp/myog-headers "$MYOG_IMAGE_URL"
cat /tmp/myog-headers

curl -sS -L -o /dev/null \
  -w '%{http_code} %{content_type} %{url_effective}\n' \
  "$MYOG_IMAGE_URL"
  • Success: a redirect to the generated image; following it must end at a 2xx image response.
  • HTTP 400 JSON: the url parameter is missing or invalid.
  • HTTP 404 JSON: the page domain has not been added to MyOG.
  • HTTP 402 JSON: the matching domain has no account credits available.
  • Other 4xx/5xx: inspect the response before changing the integration; generation and upstream failures have their own errors.

Verify the deployed page

  1. 1. Fetch the public page and inspect crawler-visible rendered HTML, not only the browser DOM.
  2. 2. Confirm the canonical URL is absolute and correct for that page.
  3. 3. Confirm one og:image and one twitter:image use the same complete MyOG URL generated for the signed-in account.
  4. 4. Fetch that exact image URL again and require a final 2xx image response with an image content type.

c7aed88217b244ab4b9e276ed32b29657e76be55