Installing the Bearer Agent generally only takes a few minutes. You will need an account on Bearer.sh to obtain your secret key. For details on which Python versions Bearer supports, have a look at Compatibility.
To enable the Bearer Agent within your application, you'll need to:
Install the Agent and initialize it in your application.
Set up any optional configuration settings.
pip install bearer-agent
Now, open your application's main process file and initialize the Bearer agent at the top:
import bearer_agentbearer_agent.init(secret_key="YOUR_SECRET_KEY", strip_sensitive_data=True)
Your Bearer Secret Key,
secret_key, can be found in the settings for your app on the Bearer Dashboard at Settings > Keys. Each application you have created in the Bearer Dashboard has its own unique key.
Now, you can start your application. All API calls will be monitored and available on your Bearer dashboard.
With the Agent set up, you can begin monitoring your APIs on the Bearer Dashboard. To learn more about the features available on the Dashboard and how to get started, explore our Get to Know the Dashboard documentation.
The Bearer agent communicates with Bearer servers through HTTPS. The Agent requires your firewall to allow outgoing connections to
agent.bearer.sh with port 443 (HTTPS).
By default, the Agent sends to the full payload of each HTTP request (including both the request and the response) to Bearer. By default and for your own security, the
Authorization header is filtered and will not be shared with Bearer.
The agent offers more options to reduce the amount of sensitive information sent to Bearer. To learn more about how to sanitize specific parts of your data, see the Keep your Data Protected documentation.