Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/Service.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public function __construct(string $apiKey, string $uriBase)

$this->httpClient = new \GuzzleHttp\Client();
$this->headers['apikey'] = $this->apiKey;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

its been a while since ive used supabase, but is this line needed? i cant remember any use of an apikey header

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, without it you'll get

{"message":"No API key found in request","hint":"No `apikey` request header or url param was found."}

$this->headers['Authorization'] = 'Bearer ' . $this->apiKey;
}

/**
Expand Down Expand Up @@ -221,4 +222,4 @@ public function executeHttpRequest(string $method, string $uri, array $options)
throw $e;
}
}
}
}