Skip to main content

Vercel Integration

If you are using Vercel then you can integrate Upstash to your project easily. We believe Upstash is the perfect database for your applications thanks to its:

  • Low latency data
  • Per request pricing with monthly cap
  • Durable storage
  • Ease of use

Below are the steps of the integration.

Add Integration to Your Vercel Account#

Visit Vercel Upstash Integration webpage and Click the Add button. Choose your scope and application that you want to integrate.

Link Database#

Vercel will show you a popup window where you can sign in Upstash. Then you can create a database if you not have one.




Once you have a database, you will see the page where you can map a Upstash database to a Vercel app. After selecting the database and project, click on `Link Database`.


Now click on Complete on Vercel, so the popup window will be closed and you will be forwarded to your Vercel page.




If you browse to your_application/settings/environment-variables in Vercel dashboard, you will see the REDIS_URL has been set as environment variable.


You need to redeploy your app for the Environment Variable to be effective.

Create Your Redis Client#

If you completed the integration steps above and redeploy your app; the REDIS_URL environment variable will be accesible inside your Vercel application. You can create your client as below:

const redis = require("redis");
module.exports = async(req, res) => {    const client = redis.createClient ({        url : process.env.REDIS_URL    });
    // read/write with your Redis client
    client.quit()
    res.json({        body: JSON.stringify("success")    })}

Support#

If you have any issue you can ask in our Discord server or send email at support@upstash.com