Upstash Keys
Setting Up Upstash Search for Your Astro Project
Section titled “Setting Up Upstash Search for Your Astro Project”This guide walks you through creating an Upstash Search database and retrieving your API credentials:
UPSTASH_SEARCH_REST_URL and UPSTASH_SEARCH_REST_TOKEN.
What Is Upstash Search?
Section titled “What Is Upstash Search?”Upstash Search is a fully managed, serverless search database built on Redis.
It’s perfect for fast, cost-efficient full-text search in static or serverless environments like Astro Actions.
Step 1: Create an Upstash Account
Section titled “Step 1: Create an Upstash Account”- Go to https://upstash.com
- Sign up using GitHub, Google, or email.
- Once logged in, click “Create Database” → “Search”.
###Step 2: Create a Search Database
- Choose Search as the database type.
- Give your database a name (e.g.,
my-search). - Pick a region close to your users (e.g.,
eu-west-1for Europe). - Click “Create Database”.
Upstash will automatically provision your search database within a few seconds.
Step 3: Get Your Credentials
Section titled “Step 3: Get Your Credentials”After the database is created:
- Open the database dashboard.
- Find the “REST API” section.
- Copy the following values:
- REST URL →
UPSTASH_SEARCH_REST_URL - REST Token →
UPSTASH_SEARCH_REST_TOKEN
- REST URL →
Example:
UPSTASH_SEARCH_REST_URL=https://your-search-name-eu1.upstash.ioUPSTASH_SEARCH_REST_TOKEN=AYJZZasvNjY6MjM3MzYtYWI2My00ZTNhLTlkNmEtODJmNTA1NzJmZGE4YjNkZTRlNGRmYzA=Step 4: Add to Your Environment Variables
Section titled “Step 4: Add to Your Environment Variables”In your Astro project root, create a .env file (if you don’t already have one):
touch .envAdd your credentials:
UPSTASH_SEARCH_REST_URL="https://your-search-name.upstash.io"UPSTASH_SEARCH_REST_TOKEN="your-secret-token"👉 Check the official docs for advanced usage:
https://upstash.com/docs/search