Skip to content

feat: add /og contextual share-image route#3963

Merged
rebelchris merged 1 commit into
mainfrom
feat/og-share-image-route
Jun 26, 2026
Merged

feat: add /og contextual share-image route#3963
rebelchris merged 1 commit into
mainfrom
feat/og-share-image-route

Conversation

@rebelchris

Copy link
Copy Markdown
Contributor

What

Adds a /og/:type/:name.png route that renders the webapp's contextual share-card pages and screenshots them via the scraper — the same pipeline as the DevCard v2 image (/devcards/v2), no Satori.

Backs the webapp PR: dailydotdev/apps#6243.

How

  • New src/routes/shareImages.ts: one generic handler over an allowlist of types (posts, comments, sources, squads, profile, tags, invite, plus). Builds ${COMMENTS_PREFIX}${WEBAPP_MAGIC_IMAGE_PREFIX}/share/<type>/<id>, POSTs { url, selector: '#screenshot_wrapper' } to SCRAPER_URL/screenshot, and streams the PNG with cache-control: public, max-age=3600, s-maxage=3600 + COOP/CORP headers (mirrors devcards v2).
  • Forwards ?userid for share attribution (post/squad "shared by / invited you").
  • Registered at /og in src/routes/index.ts.

Test plan

  • GET /og/posts/<id>.png (and ?userid=<userId>)
  • GET /og/{comments,sources,squads,profile,tags,invite,plus}/<id>.png
  • Unknown type or missing .png → 404.

🤖 Generated with Claude Code

Screenshots the webapp /image-generator/share/<type>/<id> pages via the
scraper and serves the PNG, mirroring the devcard v2 image pipeline.
One generic route over an allowlist of types (posts, comments, sources,
squads, profile, tags, invite, plus); forwards ?userid for share
attribution; cached public max-age/s-maxage 1h.

Backs the webapp share-card PR (dailydotdev/apps#6243).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@pulumi

pulumi Bot commented Jun 26, 2026

Copy link
Copy Markdown

🍹 The Update (preview) for dailydotdev/api/prod (at 3bef5c1) was successful.

Resource Changes

    Name                                                       Type                           Operation
~   vpc-native-check-analytics-report-cron                     kubernetes:batch/v1:CronJob    update
~   vpc-native-user-profile-analytics-history-clickhouse-cron  kubernetes:batch/v1:CronJob    update
~   vpc-native-expire-super-agent-trial-cron                   kubernetes:batch/v1:CronJob    update
+   vpc-native-api-clickhouse-migration-9e3f27d6               kubernetes:batch/v1:Job        create
~   vpc-native-calculate-top-readers-cron                      kubernetes:batch/v1:CronJob    update
~   vpc-native-validate-active-users-cron                      kubernetes:batch/v1:CronJob    update
~   vpc-native-update-tag-materialized-views-cron              kubernetes:batch/v1:CronJob    update
~   vpc-native-rotate-weekly-quests-cron                       kubernetes:batch/v1:CronJob    update
-   vpc-native-api-clickhouse-migration-03f7fbd4               kubernetes:batch/v1:Job        delete
~   vpc-native-squad-posts-analytics-refresh-cron              kubernetes:batch/v1:CronJob    update
~   vpc-native-clean-channel-highlights-cron                   kubernetes:batch/v1:CronJob    update
~   vpc-native-clean-zombie-images-cron                        kubernetes:batch/v1:CronJob    update
~   vpc-native-post-analytics-clickhouse-cron                  kubernetes:batch/v1:CronJob    update
~   vpc-native-clean-old-notifications-cron                    kubernetes:batch/v1:CronJob    update
~   vpc-native-update-current-streak-cron                      kubernetes:batch/v1:CronJob    update
~   vpc-native-materialize-yearly-best-post-archives-cron      kubernetes:batch/v1:CronJob    update
~   vpc-native-clean-zombie-users-cron                         kubernetes:batch/v1:CronJob    update
~   vpc-native-post-analytics-history-day-clickhouse-cron      kubernetes:batch/v1:CronJob    update
~   vpc-native-personalized-digest-deployment                  kubernetes:apps/v1:Deployment  update
~   vpc-native-update-tags-str-cron                            kubernetes:batch/v1:CronJob    update
~   vpc-native-private-deployment                              kubernetes:apps/v1:Deployment  update
~   vpc-native-update-source-public-threshold-cron             kubernetes:batch/v1:CronJob    update
~   vpc-native-temporal-deployment                             kubernetes:apps/v1:Deployment  update
~   vpc-native-update-achievement-rarity-cron                  kubernetes:batch/v1:CronJob    update
~   vpc-native-clean-zombie-opportunities-cron                 kubernetes:batch/v1:CronJob    update
~   vpc-native-generate-search-invites-cron                    kubernetes:batch/v1:CronJob    update
~   vpc-native-worker-job-deployment                           kubernetes:apps/v1:Deployment  update
~   vpc-native-personalized-digest-cron                        kubernetes:batch/v1:CronJob    update
~   vpc-native-generic-referral-reminder-cron                  kubernetes:batch/v1:CronJob    update
~   vpc-native-bg-deployment                                   kubernetes:apps/v1:Deployment  update
-   vpc-native-api-db-migration-03f7fbd4                       kubernetes:batch/v1:Job        delete
~   vpc-native-rotate-daily-quests-cron                        kubernetes:batch/v1:CronJob    update
~   vpc-native-clean-zombie-user-companies-cron                kubernetes:batch/v1:CronJob    update
~   vpc-native-channel-highlights-cron                         kubernetes:batch/v1:CronJob    update
~   vpc-native-hourly-notification-cron                        kubernetes:batch/v1:CronJob    update
~   vpc-native-daily-digest-cron                               kubernetes:batch/v1:CronJob    update
~   vpc-native-clean-gifted-plus-cron                          kubernetes:batch/v1:CronJob    update
~   vpc-native-user-profile-updated-sync-cron                  kubernetes:batch/v1:CronJob    update
~   vpc-native-ws-deployment                                   kubernetes:apps/v1:Deployment  update
~   vpc-native-post-analytics-achievements-cron                kubernetes:batch/v1:CronJob    update
~   vpc-native-update-highlighted-views-cron                   kubernetes:batch/v1:CronJob    update
... and 14 other changes

@rebelchris rebelchris merged commit f69608b into main Jun 26, 2026
9 checks passed
@rebelchris rebelchris deleted the feat/og-share-image-route branch June 26, 2026 13:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant