Telegram Connector is configured entirely through environment variables. At startup, pydantic-settings reads values from the process environment or aDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/OPENNOVA2026/telegram-connector/llms.txt
Use this file to discover all available pages before exploring further.
.env file in the working directory and populates the Settings class defined in src/settings.py. The resulting singleton — settings — is imported throughout the codebase wherever configuration values are needed. No configuration files beyond .env are required.
Sample .env file
Copy the block below as a starting point. Required fields are marked in the comments; everything else has a sensible default.
Variable reference
Application
Human-readable application name surfaced in the auto-generated FastAPI
/docs and /redoc pages. Override to distinguish multiple deployments in the Swagger UI title.Short description shown beneath the title in FastAPI’s interactive documentation. Populated directly from
settings.description when the FastAPI() instance is created.Deployment environment label (e.g.
local, staging, production). Passed to Sentry as the environment tag so errors are grouped by environment in the Sentry dashboard. Has no effect on runtime behaviour beyond that.Session name used as the S3 key prefix when persisting Telethon session data. The full S3 object key becomes
telegram/{SESSION}/session.txt. Running multiple connectors pointing at the same bucket with distinct SESSION values keeps their authentication state isolated. See Session Persistence for details.Telegram API credentials
Telegram API ID issued by my.telegram.org. Required for any real Telegram operations — channel listing, message retrieval, and authentication all depend on this value being set to a non-zero integer.
Telegram API hash paired with
API_ID, also obtained from my.telegram.org. Must be set alongside API_ID to authenticate with Telegram’s MTProto API.When
API_ID is 0 (the default), channel listing and message retrieval endpoints automatically fall back to FakeClient, which returns synthetic data without touching the Telegram network. This is the recommended setup for local development when you do not yet have API credentials.AWS S3 session storage
AWS region passed to the
boto3 S3 client (e.g. us-east-1). Can be omitted when using a region-agnostic S3-compatible endpoint such as MinIO.Full endpoint URL passed directly to
boto3.client() via endpoint_url (e.g. https://s3.amazonaws.com or http://localhost:9000 for MinIO). This value is always forwarded to the boto3 S3 client — when left empty, boto3 falls back to its default AWS endpoint resolution using AWS_REGION.AWS access key ID used to authenticate S3 requests. If left empty,
boto3 falls back to its standard credential chain (environment variables, IAM role, ~/.aws/credentials, etc.).AWS secret access key paired with
AWS_ACCESS_KEY. Same fallback behaviour applies when left empty.Name of the S3 bucket where serialized Telethon session files are stored. The bucket must exist and the configured credentials must have
s3:GetObject and s3:PutObject permissions on it before the service starts.Sentry error monitoring
Data Source Name (DSN) for your Sentry project. When this variable is empty or unset, Sentry is completely disabled — no SDK initialization occurs and no data is sent. Set this to activate error and performance monitoring in non-local environments.
Sentry traces sample rate, expressed as a fraction between
0.0 and 1.0. 1.0 means every transaction is captured; 0.1 means 10 % are sampled. Lower this in high-traffic production deployments to control Sentry quota usage.Sentry integration
Sentry is initialized byinitialize_sentry() in src/settings.py, which is called once during application startup. The function is a no-op when SENTRY_DSN is empty, so there is no penalty for leaving it unset in development.
When a DSN is provided, the SDK is configured with both the Starlette and FastAPI integrations, enabling automatic breadcrumb and transaction capture for every HTTP request handled by the application:
ENVIRONMENT variable is forwarded as the Sentry environment tag, making it straightforward to filter issues by deployment stage in the Sentry UI.