Skip to content

Commit 21bc8e1

Browse files
elena-kolevskaberndverst
authored andcommitted
Documents usage of DAPR_API_TOKEN (dapr#654)
* Documents usage of `DAPR_API_TOKEN` Signed-off-by: Elena Kolevska <elena@kolevska.com> * Adds link to dapr api token docs Signed-off-by: Elena Kolevska <elena@kolevska.com> --------- Signed-off-by: Elena Kolevska <elena@kolevska.com> Co-authored-by: Bernd Verst <github@bernd.dev> Signed-off-by: Li Tan <litan1106@gmail.com>
1 parent 26c5bfb commit 21bc8e1

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

daprdocs/content/en/python-sdk-docs/python-client.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ with DaprClient() as d:
3939
```
4040

4141
#### Specifying an endpoint on initialisation:
42-
When passed as an argument in the constructor, the gRPC endpoint takes precedence over any configuration or environment variable.
42+
When passed as an argument in the constructor, the gRPC endpoint takes precedence over any
43+
configuration or environment variable.
4344

4445
```python
4546
from dapr.clients import DaprClient
@@ -48,7 +49,9 @@ with DaprClient("mydomain:50051?tls=true") as d:
4849
# use the client
4950
```
5051

51-
#### Specifying the endpoint in an environment variable:
52+
#### Environment variables:
53+
54+
##### Dapr Sidecar Endpoints
5255
You can use the standardised `DAPR_GRPC_ENDPOINT` environment variable to
5356
specify the gRPC endpoint. When this variable is set, the client can be initialised
5457
without any arguments:
@@ -66,6 +69,11 @@ with DaprClient() as d:
6669
The legacy environment variables `DAPR_RUNTIME_HOST`, `DAPR_HTTP_PORT` and `DAPR_GRPC_PORT` are
6770
also supported, but `DAPR_GRPC_ENDPOINT` takes precedence.
6871

72+
##### Dapr API Token
73+
If your Dapr instance is configured to require the `DAPR_API_TOKEN` environment variable, you can
74+
set it in the environment and the client will use it automatically.
75+
You can read more about Dapr API token authentication [here](https://docs.dapr.io/operations/security/api-token/).
76+
6977

7078
## Building blocks
7179

0 commit comments

Comments
 (0)