name | slug | description | framework | useCase | css | deployUrl | relatedTemplates | ||||
---|---|---|---|---|---|---|---|---|---|---|---|
Open Graph Image Generation |
og-image-generation |
Compute and generate dynamic social card images with React components. |
Next.js |
Edge Functions |
Tailwind |
|
Deprem Yardım OG Image Generator
How to Use
You can choose from one of the following two methods to use this repository:
One-Click Deploy
Deploy the example using Vercel:
This project requires Mapbox access token. Make sure to create one and add your access token to your Vercel project environment variables as GOOGLE_STATIC_API_KEY
Clone and Deploy
Execute create-next-app
with npm or Yarn to bootstrap the example:
npx create-next-app --example https://github.com/thisiswunder/deprem-yardim-og-generator
# or
yarn create next-app --example https://github.com/thisiswunder/deprem-yardim-og-generator
Next, run Next.js in development mode:
npm install
npm run dev
# or
yarn
yarn dev
Then create and Mapbox account and add an access token to your .env file like so:
GOOGLE_STATIC_API_KEY=<YOUR_TOKEN>
Usage
API GET /api/dynamic-image
Params
loc: string[];
address: string;
entry: string;
Sample with params
YOUR_HOST/api/dynamic-image?loc=37.5749643,36.9334448&address=Foo&entry=Bar
Sample output
Deploy it to the cloud with Vercel (Documentation).