Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: migrate OG image generation API to App Router #19568

Merged
merged 19 commits into from
Feb 28, 2025

Conversation

hbjORbj
Copy link
Contributor

@hbjORbj hbjORbj commented Feb 26, 2025

What does this PR do?

  • Migrate OG image generation API to App Router (/api/social/og/image/)

Tested

Screenshot 2025-02-27 at 10 07 14 AM

Mandatory Tasks (DO NOT REMOVE)

  • I have self-reviewed the code (A decent size PR without self-review might be rejected).
  • N/A - I have updated the developer docs in /docs if this PR makes changes that would require a documentation change. If N/A, write N/A here and check the checkbox.
  • I confirm automated tests are in place that prove my fix is effective or that my feature works.

How should this be tested?

  • Covered by e2e tests

If you wanna manually test:

  • Go to your user (or user type) booking page, find <meta property="og:image".. /> and copy the URL in content
    e.g.,
Screenshot 2025-02-27 at 10 06 20 AM
  • Ask AI to remove _next/image?w=1200&q=100&url=%2F and decode the URL, then you will have something like below:

http://localhost:3000/api/social/og/image?type=meeting&title=asdfasdf&meetingProfileName=Admin+Example&meetingImage=http%3A%2F%2Flocalhost%3A3000%2Fapi%2Favatar%2Fe12a7af0-12a3-47f9-af7e-b084fe6decd0.png&names=Admin+Example&usernames=franz-jan%C3%9Fen

@graphite-app graphite-app bot requested a review from a team February 26, 2025 13:34
Copy link

vercel bot commented Feb 26, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

2 Skipped Deployments
Name Status Preview Comments Updated (UTC)
cal ⬜️ Ignored (Inspect) Visit Preview Feb 27, 2025 4:24pm
calcom-web-canary ⬜️ Ignored (Inspect) Visit Preview Feb 27, 2025 4:24pm

@hbjORbj hbjORbj changed the title chore: migrate social api og chore: migrate OG image generation API to App Router Feb 26, 2025
@keithwillcode keithwillcode added consumer core area: core, team members only labels Feb 26, 2025
@dosubot dosubot bot added the api area: API, enterprise API, access token, OAuth label Feb 26, 2025
Copy link

graphite-app bot commented Feb 26, 2025

Graphite Automations

"Add consumer team as reviewer" took an action on this PR • (02/26/25)

1 reviewer was added to this PR based on Keith Williams's automation.

@hbjORbj hbjORbj changed the base branch from main to perf/stripe-import February 27, 2025 15:03
Base automatically changed from perf/stripe-import to main February 27, 2025 15:22
Copy link
Contributor

github-actions bot commented Feb 27, 2025

E2E results are ready!

@hbjORbj hbjORbj marked this pull request as ready for review February 27, 2025 15:38
@hbjORbj hbjORbj marked this pull request as draft February 27, 2025 15:46
@hbjORbj hbjORbj marked this pull request as ready for review February 27, 2025 15:47
@eunjae-lee
Copy link
Contributor

eunjae-lee commented Feb 27, 2025

original:

http://localhost:3000/_next/image?w=1200&q=100&url=%2Fapi%2Fsocial%2Fog%2Fimage%3Ftype%3Dmeeting%26title%3D30min%26meetingProfileName%3DOwner%2B1%26meetingImage%3Dhttp%253A%252F%252Flocalhost%253A3000%252Favatar.svg%26names%3DOwner%2B1%26usernames%3Downer1

cleaned up:

http://localhost:3000/api/social/og/image?type=meeting&title=30min&meetingProfileName=Owner%201&meetingImage=http://localhost:3000/avatar.svg&names=Owner%201&usernames=owner1

and got this:

Screenshot 2025-02-27 at 17 45 31

Any idea?

Copy link
Contributor

@eunjae-lee eunjae-lee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

working!

Screenshot 2025-02-28 at 09 51 02

@PeerRich PeerRich merged commit 87f161d into main Feb 28, 2025
39 checks passed
@PeerRich PeerRich deleted the chore/migrate-social-api-og branch February 28, 2025 10:03
itsalam pushed a commit to itsalam/cal.com that referenced this pull request Mar 6, 2025
* migrate

* improve apiRouteMiddleware wrapper type

* refactor

* fix type check

* fix build

* fix

* Do not import stripe lib in getServerErrorFromUnknown

* address comment

* remove comment

* add url

* keep the location

* remove space

* add unit test for getServerErrorFromUnknown

* improve

* fix
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api area: API, enterprise API, access token, OAuth consumer core area: core, team members only ready-for-e2e
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants