diff --git a/docs/reference/api.Api.qmd b/docs/reference/api.Api.qmd index 64a0a51..d1d0533 100644 --- a/docs/reference/api.Api.qmd +++ b/docs/reference/api.Api.qmd @@ -18,6 +18,15 @@ A client for interfacing with the Truth Social API. >>> client = Api(username="yourname", password="yourpass") ``` +To avoid hard-coding your secret credentials, you are encouraged to use environment variables +`TRUTHSOCIAL_USERNAME` and `TRUTHSOCIAL_PASSWORD`, for example stored in a local ".env" file. +You could then pass these environment variables, or omit because they are used by default: + +```python +>>> from truthbrush import Api +>>> client = Api() # assuming you have set env vars +``` + ## Methods | Name | Description | @@ -66,7 +75,7 @@ Lookup a user's information. Pull the given user's statuses. Use the `created_after` or `since_id` parameters to filter posts, - retaining only those created since. + retaining only the posts created afterwards. Returns a generator of posts in reverse chronological order, or an empty list if not found. diff --git a/truthbrush/api.py b/truthbrush/api.py index c949ee1..14b4e9d 100644 --- a/truthbrush/api.py +++ b/truthbrush/api.py @@ -49,6 +49,13 @@ class Api: Examples: >>> from truthbrush import Api >>> client = Api(username="yourname", password="yourpass") + + To avoid hard-coding your secret credentials, you are encouraged to use environment variables + `TRUTHSOCIAL_USERNAME` and `TRUTHSOCIAL_PASSWORD`, for example stored in a local ".env" file. + You could then pass these environment variables, or omit because they are used by default: + + >>> from truthbrush import Api + >>> client = Api() # assuming you have set env vars """ def __init__(