docs(influxdb3): clarify auth token usage and add CLI/API code tabs

pull/6069/head
meelahme 2025-05-15 10:03:32 -07:00
parent 867c5dfd99
commit 5522673052
1 changed files with 33 additions and 2 deletions

View File

@ -8,8 +8,39 @@ data and resources in your InfluxDB 3 instance.
> Token metadata includes the hashed token string.
> InfluxDB 3 does not store the raw token string.
In the following examples, replace {{% code-placeholder-key %}}`AUTH_TOKEN`{{% /code-placeholder-key %}} with your InfluxDB {{% token-link "admin" %}}
{{% show-in "enterprise" %}} or a token with read permission on the `_internal` system database`{{% /show-in %}}.
To run the following examples, you must set the `INFLUXDB3_AUTH_TOKEN` environment variable with a valid InfluxDB {{% token-link "admin" %}}. {{% show-in "enterprise" %}}Alternatively use a token with read permission on the `_internal` system database.{{% /show-in %}} Use one of the following methods to set or include your token:
{{% code-placeholders "your-token" %}}
{{< code-tabs-wrapper >}}
{{% code-tabs %}}
[CLI](#cli-auth)
[HTTP API](#http-api-auth)
{{% /code-tabs %}}
{{% code-tab-content %}}
```bash
# Set your InfluxDB 3 token as an environment variable
export INFLUXDB3_AUTH_TOKEN=your-token
```
{{% /code-tab-content %}}
{{% code-tab-content %}}
```bash
# Add your token to the HTTP Authorization header
--header "Authorization: Bearer your-token"
```
{{% /code-tab-content %}}
{{< /code-tabs-wrapper >}}
{{% /code-placeholders %}}
Replace `your-token` with your actual InfluxDB 3 token.
## List all tokens