Skip to content

Commit

Permalink
Merge pull request #699 from hirosystems/07-12-docs_update_api_key_he…
Browse files Browse the repository at this point in the history
…ader

docs: update api key header
  • Loading branch information
ryanwaits authored Jul 17, 2024
2 parents 018a457 + a1b6029 commit 8f3db53
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions snippets/api-keys.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ If you're interested in obtaining an API key, you can generate one for free in t

## Usage with cURL

The API key is passed in the `header` of your HTTP API request with `x-hiro-api-key`.
The API key is passed in the `header` of your HTTP API request with `x-api-key`.

```bash title="Terminal"
curl https://api.hiro.so/... -H 'x-hiro-api-key: <your-api-key>'
curl https://api.hiro.so/... -H 'x-api-key: <your-api-key>'
```

## Usage with Node
Expand All @@ -23,7 +23,7 @@ async function makeApiRequest(apiKey: string) {
const url = `https://api.hiro.so/<your-api-endpoint>`;
const response = await fetch(url, {
headers: {
"x-hiro-api-key": apiKey // [!code highlight]
"x-api-key": apiKey // [!code highlight]
}
});
return response.json();
Expand All @@ -34,4 +34,4 @@ async function makeApiRequest(apiKey: string) {
The API key is passed in the header of your HTTP API request and is used only for private use, like in server-side applications.

If you use the API key in your client-side application, attackers can capture it using the client tools (E.g., browser console) and abuse your API key.
</Callout>
</Callout>

0 comments on commit 8f3db53

Please sign in to comment.