Skip to content

Conversation

@NathanFlurry
Copy link
Member

Motivation

  • Align the Typesense search component to use Astro's PUBLIC_TYPESENSE_API_KEY environment variable so the site search can initialize after the Astro migration.

Description

  • Update website/src/components/v2/TypesenseSearch.tsx to use import.meta.env.PUBLIC_TYPESENSE_API_KEY for the apiKey and in the required-key check.

Testing

  • The pre-commit hook ran cargo-fmt via lefthook and it completed successfully.

Codex Task

@railway-app
Copy link

railway-app bot commented Jan 18, 2026

🚅 Deployed to the rivet-pr-3971 environment in rivet-frontend

Service Status Web Updated (UTC)
website 😴 Sleeping (View Logs) Web Jan 21, 2026 at 7:26 pm
frontend-cloud 😴 Sleeping (View Logs) Web Jan 18, 2026 at 11:21 pm
frontend-inspector 😴 Sleeping (View Logs) Web Jan 18, 2026 at 11:21 pm

@claude
Copy link

claude bot commented Jan 18, 2026

PR Review

Summary

This PR updates the Typesense search component to use the correct environment variable name PUBLIC_TYPESENSE_API_KEY instead of PUBLIC_TYPESENSE_SEARCH_API_KEY, aligning with Astro's environment variable conventions after the Astro migration.

Code Quality: ✅ Excellent

Strengths:

  • Clean, focused change that addresses a single issue
  • Consistent update across both usage locations (client initialization and validation check)
  • Follows Astro's PUBLIC_ prefix convention for client-side environment variables
  • Good commit message following conventional commits format: fix(website): align Typesense env var to PUBLIC_TYPESENSE_API_KEY

Potential Issues: ✅ None Found

The change is straightforward and correct. Both instances of the environment variable have been updated:

  1. Line 15: Client initialization in apiKey field
  2. Line 41: Required keys validation check

Performance Considerations: ✅ Neutral

No performance impact - this is purely a configuration variable rename.

Security Considerations: ✅ Good

Observations:

  • The fallback value "xyz" on line 15 is appropriate for a search-only API key (read-only)
  • The component correctly checks for required keys and returns null if missing (lines 39-46)
  • Using Astro's PUBLIC_ prefix correctly indicates this is a client-side variable

Note: Ensure the new environment variable PUBLIC_TYPESENSE_API_KEY is configured in your deployment environment.

Test Coverage: ⚠️ Not Applicable

This is a configuration change. Testing considerations:

  • Manual testing should verify search functionality works with the new environment variable
  • Consider adding the new variable to your .env.example or environment documentation

Additional Recommendations

  1. Environment Variable Documentation: Update any documentation or .env.example files to reference PUBLIC_TYPESENSE_API_KEY instead of PUBLIC_TYPESENSE_SEARCH_API_KEY

  2. Migration Guide: If this is part of a larger Astro migration, consider documenting this environment variable rename for other developers/deployments

Verdict: ✅ Approved

This is a clean, necessary fix for the Astro migration. The changes are minimal, correct, and maintain consistency throughout the component. No issues found.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Jan 18, 2026

More templates

@rivetkit/cloudflare-workers

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/cloudflare-workers@3971

@rivetkit/db

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/db@3971

@rivetkit/framework-base

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/framework-base@3971

@rivetkit/next-js

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/next-js@3971

@rivetkit/react

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/react@3971

rivetkit

pnpm add https://pkg.pr.new/rivet-dev/rivet/rivetkit@3971

@rivetkit/sql-loader

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/sql-loader@3971

@rivetkit/virtual-websocket

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/virtual-websocket@3971

@rivetkit/engine-runner

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/engine-runner@3971

@rivetkit/engine-runner-protocol

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/engine-runner-protocol@3971

commit: fb1055d

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants