File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
src/components/ChangelogSnippet Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -4,15 +4,20 @@ import { searchClient } from "@algolia/client-search"
44import ChangelogCard from " ./ChangelogCard.astro"
55import { ALGOLIA_INDEX , type ChangelogItem } from " ./types"
66import styles from " ./ChangelogSnippet.module.css"
7+ import { getSecret } from " astro:env/server"
78
89interface Props {
910 query: string
1011}
1112
1213const { query } = Astro .props
1314
14- const appId = import .meta .env .PUBLIC_ALGOLIA_SEARCH_APP_ID
15- const apiKey = import .meta .env .PUBLIC_ALGOLIA_SEARCH_PUBLIC_API_KEY
15+ const appId = getSecret (" ALGOLIA_APP_ID" )
16+ const apiKey = getSecret (" PUBLIC_ALGOLIA_SEARCH_PUBLIC_API_KEY" )
17+
18+ if (! appId || ! apiKey ) {
19+ throw new Error (" Missing Algolia credentials" )
20+ }
1621
1722const client = searchClient (appId , apiKey )
1823
You can’t perform that action at this time.
0 commit comments