Skip to content

Commit

Permalink
Merge pull request #1 from upstash/fix-precedence
Browse files Browse the repository at this point in the history
Fix token precedence
  • Loading branch information
ogzhanolguncu authored Jan 22, 2024
2 parents 12ead65 + 8f57681 commit 3c462ad
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,13 @@ export class Index extends core.Index {
return;
}
const token =
configOrRequester?.token ??
process.env.NEXT_PUBLIC_UPSTASH_VECTOR_REST_TOKEN ??
process.env.UPSTASH_VECTOR_REST_TOKEN ??
configOrRequester?.token;
process.env.UPSTASH_VECTOR_REST_TOKEN;
const url =
configOrRequester?.url ??
process.env.NEXT_PUBLIC_UPSTASH_VECTOR_REST_URL ??
process.env.UPSTASH_VECTOR_REST_URL ??
configOrRequester?.url;
process.env.UPSTASH_VECTOR_REST_URL;

if (!token) {
throw new Error("UPSTASH_VECTOR_REST_TOKEN is missing!");
Expand Down

0 comments on commit 3c462ad

Please sign in to comment.