---
title: "Cron OG Cards"
description: "A template for scheduled updates to your OG social cards using Vercel Cron Jobs and Upstash Redis."
url: "https://vercel.com/templates/next.js/cron-og"
links:
  repository: "https://github.com/gt-codes/og-cron"
  demo: "https://cron.vercel.zone/"
  deploy: "https://vercel.com/new/clone?demo-title=Cron+OG+Cards&demo-description=A+template+for+scheduled+updates+to+your+OG+social+cards+using+Vercel+Cron+Jobs+and+Upstash+Redis.&demo-url=https%3A%2F%2Fcron.vercel.zone%2F&demo-image=%2F%2Fimages.ctfassets.net%2Fe5382hct74si%2F3bCoJ08L2AJ1mI9Sgbwkt7%2F2fbd96323682d4c278151475efb5c623%2FCleanShot_2023-02-21_at_12.17.29_2x_-_Garrett_Tolbert.png&project-name=Cron+OG+Cards&repository-name=cron-og&repository-url=https%3A%2F%2Fgithub.com%2Fgt-codes%2Fog-cron&from=templates&skippable-integrations=1&env=EDGE_CONFIG%2CEDGE_CONFIG_ID%2CVC_TEAM_ID%2CVC_ACCESS_TOKEN&envDescription=Instructions+on+how+to+get+these+env+vars&envLink=https%3A%2F%2Fgithub.com%2Fgt-codes%2Fog-cron%23usage"
---

# Cron OG Cards

A template for scheduled updates to your OG social cards using Vercel Cron Jobs and Upstash Redis.

# Next.js Cron OG

This Next.js template automatically fetches the top stories from Hacker News every minute and stores them in [Upstash](https://vercel.com/integrations/upstash), a Redis client. This template uses [Vercel OG](https://vercel.com/docs/concepts/functions/edge-functions/og-image-generation) to generate an Open Graph (OG) image at the edge, leveraging Upstash for efficient data storage and retrieval.

## Deploy your own

Deploy the example using [Vercel](https://vercel.com?utm_source=github&utm_medium=readme&utm_campaign=next-example) or view the demo [here](https://cron.vercel.zone/).

[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/git/external?repository-url=https://github.com/gt-codes/og-cron&project-name=og-cron&repository-name=og-cron&integration-ids=oac_V3R1GIpkoJorr6fqyiwdhl17&envDescription=API%20Keys%20from%20your%20Vercel%20account%20needed%20to%20run%20this%20application.)

## Features

-   Automatic fetching of top stories from Hacker News
-   **Upstash** as a data store for efficient data storage and retrieval
-   **Vercel OG** for automatic generation of Open Graph (OG) image
-   Updates Hacker News data every minute thanks to **Vercel Cron Jobs**

## Usage

1. Clone the repository: `git clone https://github.com/gt-codes/og-cron.git`
2. Copy the `.env.example` file in this directory to `.env.local`
    - `UPSTASH_REDIS_REST_URL`: The REST URL for your Upstash Redis instance
    - `UPSTASH_REDIS_REST_TOKEN`: The REST token for your Upstash Redis instance

## Start the development server

```bash
npm install
npm run dev
```

## Related Templates

### [Vercel Cron Job Example](https://vercel.com/templates/next.js/vercel-cron)

A Next.js app that uses Vercel Cron Jobs to update data at different intervals.

### [OG.cool – Display headlines in OG images](https://vercel.com/templates/next.js/og-cool)

A Next.js app that displays headlines directly inside a dynamically generated image. Powered by @vercel/og.

---

## Additional documentation

The [Vercel Knowledge Base](https://vercel.com/kb) contains guides and answers to common questions about Vercel, including deployment, framework configuration, domains, caching, and troubleshooting.
