Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: update api key header #699

Merged
merged 1 commit into from
Jul 17, 2024
Merged
Changes from all commits
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
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>
Loading