Newsletter
Join the Community
Subscribe to our newsletter for the latest news and updates
A Next.js demo showcasing full-text recipe search with Amazon OpenSearch Serverless and SigV4 OIDC authentication.
Amazon OpenSearch Serverless Demo is a boilerplate Next.js application that demonstrates full-text recipe search powered by Amazon OpenSearch Serverless, with AWS SigV4 authentication handled through Vercel OIDC so no static AWS keys are stored in the project.
This demo template from Vercel pairs Next.js with Amazon OpenSearch Serverless to build a searchable recipe interface. It takes a recipe dataset, seeds it into an OpenSearch Serverless Search collection with npm run seed, and renders search results with facets, highlighting, and autocomplete. The application runs on Node.js 18 and relies on the AWS SDK's fromWebToken method to exchange a Vercel OIDC token for temporary AWS credentials, eliminating the need for hard-coded access keys.
@vercel/oidc package to read Vercel's short-lived OIDC token and exchanges it for AWS credentials via STS AssumeRoleWithWebIdentity, implemented with fromWebToken in the AWS SDK.VERCEL_OIDC_TOKEN is injected automatically; locally, vercel env pull writes one valid for roughly 12 hours, so local development mirrors production auth.npm run seed populates the OpenSearch Serverless index with recipe data, making the search interface functional immediately after setup.https://oidc.vercel.com/team-slug) to assume a role, along with the required aoss:APIAccessAll permission on the collection.OPENSEARCH_ENDPOINT, AWS_REGION, AWS_ROLE_ARN, and VERCEL_OIDC_TOKEN are provisioned automatically when installing the Vercel AWS OpenSearch integration and can be pulled locally with vercel env pull.The application authenticates by reading the Vercel OIDC token, which is injected into the environment on Vercel and generated locally via vercel env pull. It then calls STS AssumeRoleWithWebIdentity using the AWS SDK's fromWebToken helper to receive temporary credentials scoped by the IAM role. After the index is seeded, the Next.js development server (npm run dev) serves the search interface at localhost:3000.
