A Next.js app showcasing Amazon OpenSearch Serverless

This demo uses Amazon OpenSearch Serverless with Next.js to showcase full-text recipe search with facets, highlighting, and autocomplete. It connects securely using AWS SigV4 authentication, with credentials obtained via Vercel OIDC — no static AWS keys required.
The app uses @vercel/oidc to read Vercel's short-lived OIDC token and exchanges it for AWS credentials via STS AssumeRoleWithWebIdentity (fromWebToken in the AWS SDK). On Vercel, VERCEL_OIDC_TOKEN is injected automatically; locally, vercel env pull writes one valid for ~12 hours.
https://oidc.vercel.com/<team-slug>) and whose policy grants aoss:APIAccessAll on the collection. The Vercel AWS OpenSearch integration creates this role automatically and exposes it as the env vars below.Provisioned automatically when you install the Vercel AWS OpenSearch integration. After vercel env pull .env.local you should see:
| Variable | Purpose |
|---|---|
OPENSEARCH_ENDPOINT | Search collection endpoint |
AWS_REGION | Region of the search collection |
AWS_ROLE_ARN | IAM role with access to the search collection |
VERCEL_OIDC_TOKEN | Short-lived Vercel OIDC token (auto-injected on Vercel; written locally by vercel env pull) |
{"Version": "2012-10-17","Statement": [{"Effect": "Allow","Principal": { "Federated": "arn:aws:iam::<account-id>:oidc-provider/oidc.vercel.com/<team-slug>" },"Action": "sts:AssumeRoleWithWebIdentity","Condition": {"StringEquals": {"oidc.vercel.com/<team-slug>:aud": "https://vercel.com/<team-slug>"}}}]}
npm install
VERCEL_OIDC_TOKEN):vercel linkvercel env pull .env.local
npm run seed
npm run dev
The local OIDC token expires after ~12 hours. If you see AWS auth errors mid-session, re-run
vercel env pull .env.local --yes.