Skip to content
Open
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
42 changes: 30 additions & 12 deletions content/shared/influxdb3-get-started/setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -445,12 +445,10 @@ influxdb3 create token --admin
{{% /code-tab-content %}}
{{% code-tab-content %}}

{{% code-placeholders "CONTAINER_NAME" %}}
```bash
```bash { placeholders="CONTAINER_NAME" }
# With Docker — in a new terminal:
docker exec -it CONTAINER_NAME influxdb3 create token --admin
```
{{% /code-placeholders %}}

Replace {{% code-placeholder-key %}}`CONTAINER_NAME`{{% /code-placeholder-key %}} with the name of your running Docker container.

Expand Down Expand Up @@ -486,34 +484,54 @@ In your command, replace {{% code-placeholder-key %}}`YOUR_AUTH_TOKEN`{{% /code-
Set the `INFLUXDB3_AUTH_TOKEN` environment variable to have the CLI use your
token automatically:

{{% code-placeholders "YOUR_AUTH_TOKEN" %}}
```bash
{{< tabs-wrapper >}}
{{% tabs %}}
[macOS and Linux](#)
[PowerShell](#)
[CMD](#)
{{% /tabs %}}
{{% tab-content %}}

```bash { placeholders="YOUR_AUTH_TOKEN" }
export INFLUXDB3_AUTH_TOKEN=YOUR_AUTH_TOKEN
```
{{% /code-placeholders %}}

{{% /tab-content %}}
{{% tab-content %}}

```powershell { placeholders="YOUR_AUTH_TOKEN" }
$env:INFLUXDB3_AUTH_TOKEN = "YOUR_AUTH_TOKEN"
```

{{% /tab-content %}}
{{% tab-content %}}

```cmd { placeholders="YOUR_AUTH_TOKEN" }
set INFLUXDB3_AUTH_TOKEN=YOUR_AUTH_TOKEN
# Make sure to include a space character at the end of this command.
```

{{% /tab-content %}}
{{< /tabs-wrapper >}}

{{% /tab-content %}}
{{% tab-content %}}

Include the `--token` option with CLI commands:

{{% code-placeholders "YOUR_AUTH_TOKEN" %}}
```bash
```bash { placeholders="YOUR_AUTH_TOKEN" }
influxdb3 show databases --token YOUR_AUTH_TOKEN
```
{{% /code-placeholders %}}

{{% /tab-content %}}
{{< /tabs-wrapper >}}

For HTTP API requests, include your token in the `Authorization` header--for example:

{{% code-placeholders "YOUR_AUTH_TOKEN" %}}
```bash
```bash { placeholders="YOUR_AUTH_TOKEN" }
curl "http://{{< influxdb/host >}}/api/v3/configure/database" \
--header "Authorization: Bearer YOUR_AUTH_TOKEN"
```
{{% /code-placeholders %}}

#### Learn more about tokens and permissions

Expand Down