Skip to content
This repository has been archived by the owner on Jul 30, 2024. It is now read-only.
/ og-image Public archive
forked from vercel/og-image

Open Graph Image as a Service - generate cards for Twitter, Facebook, Slack, etc

License

Notifications You must be signed in to change notification settings

0xSplits/og-image

 
 

Repository files navigation

0xSplits Open Graph Images

Local dev

Make sure to have node installed, currently we're using 18. Can find the installation here. A node version manager can also be useful, you can read more about it here.

To setup local development, clone down the repo and run:

yarn install
npm install -g vercel
vercel dev

If the vercel installation fails, may need to run it with sudo in front.

Create a .env.local file and fill it in with the appropriate values.

If you are having trouble check out instructions in the original repo.

Editing images

The request is handled in /api/index.ts. This is where the splits metadata is fetched. The template is generated in /_lib/template.ts. Any html/css changes should be made there.

Testing

The easiest way to test locally is to set an environment variable, OG_HTML_DEBUG to 1. You can also find the if statement using that in /api/index.ts and just set it to if (true) {. Then once the server is running, go to http://localhost:3000/0xF8843981e7846945960f53243cA2Fd42a579f719?chainId=1 to view the image. You can swap in any split id. If you are testing on a chain other than mainnet, be sure to set the appropriate chain id (it will default to mainnet if not included).

Other

The original repo can be found here.

About

Open Graph Image as a Service - generate cards for Twitter, Facebook, Slack, etc

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 89.7%
  • HTML 8.8%
  • Other 1.5%