@@ -245,6 +245,7 @@ alias posthog.client.DEFAULT_CODE_VARIABLES_IGNORE_PATTERNS -> posthog.exception
245245alias posthog.client.DEFAULT_CODE_VARIABLES_MASK_PATTERNS -> posthog.exception_utils.DEFAULT_CODE_VARIABLES_MASK_PATTERNS
246246alias posthog.client.DEFAULT_CODE_VARIABLES_MASK_URL_CREDENTIALS -> posthog.exception_utils.DEFAULT_CODE_VARIABLES_MASK_URL_CREDENTIALS
247247alias posthog.client.EVENTS_ENDPOINT -> posthog.request.EVENTS_ENDPOINT
248+ alias posthog.client.Emails -> posthog.emails.Emails
248249alias posthog.client.ExceptionArg -> posthog.args.ExceptionArg
249250alias posthog.client.ExceptionCapture -> posthog.exception_capture.ExceptionCapture
250251alias posthog.client.FeatureFlag -> posthog.types.FeatureFlag
@@ -725,6 +726,7 @@ attribute posthog.args.OptionalSetArgs.properties: NotRequired[Optional[Dict[str
725726attribute posthog.args.OptionalSetArgs.timestamp: NotRequired[Optional[Union[datetime, str]]]
726727attribute posthog.args.OptionalSetArgs.uuid: NotRequired[Optional[Union[str, UUID]]]
727728attribute posthog.async_client.AsyncClient.api_key = (project_api_key or '').strip()
729+ attribute posthog.async_client.AsyncClient.app_host = app_host
728730attribute posthog.async_client.AsyncClient.before_send = before_send
729731attribute posthog.async_client.AsyncClient.capture_compression = _resolve_capture_compression(capture_compression, gzip_fallback=gzip)
730732attribute posthog.async_client.AsyncClient.capture_exception_code_variables = capture_exception_code_variables
@@ -738,6 +740,9 @@ attribute posthog.async_client.AsyncClient.debug = debug
738740attribute posthog.async_client.AsyncClient.disable_geoip = disable_geoip
739741attribute posthog.async_client.AsyncClient.disabled = disabled or not self.api_key
740742attribute posthog.async_client.AsyncClient.distinct_ids_feature_flags_reported = SizeLimitedDict(_MAX_DICT_SIZE, set)
743+ attribute posthog.async_client.AsyncClient.email_request_max_retries = email_request_max_retries
744+ attribute posthog.async_client.AsyncClient.email_request_timeout_seconds = email_request_timeout_seconds
745+ attribute posthog.async_client.AsyncClient.emails: AsyncEmails
741746attribute posthog.async_client.AsyncClient.feature_flags_request_max_retries = max(0, feature_flags_request_max_retries)
742747attribute posthog.async_client.AsyncClient.feature_flags_request_timeout_seconds = feature_flags_request_timeout_seconds
743748attribute posthog.async_client.AsyncClient.gzip = gzip
@@ -775,6 +780,7 @@ attribute posthog.capture_v1.CaptureV1Error.drops = drops or []
775780attribute posthog.capture_v1.CaptureV1Error.request_id = request_id
776781attribute posthog.capture_v1.CaptureV1Error.retry_exhausted = retry_exhausted or []
777782attribute posthog.client.Client.api_key = (project_api_key or '').strip()
783+ attribute posthog.client.Client.app_host = app_host
778784attribute posthog.client.Client.capture_compression = _resolve_capture_compression(capture_compression, gzip_fallback=gzip)
779785attribute posthog.client.Client.capture_exception_code_variables = capture_exception_code_variables
780786attribute posthog.client.Client.capture_mode = _resolve_capture_mode(capture_mode)
@@ -789,6 +795,9 @@ attribute posthog.client.Client.debug = debug
789795attribute posthog.client.Client.disable_geoip = disable_geoip
790796attribute posthog.client.Client.disabled = disabled or not self.api_key
791797attribute posthog.client.Client.distinct_ids_feature_flags_reported = SizeLimitedDict(MAX_DICT_SIZE, set)
798+ attribute posthog.client.Client.email_request_max_retries = email_request_max_retries
799+ attribute posthog.client.Client.email_request_timeout_seconds = email_request_timeout_seconds
800+ attribute posthog.client.Client.emails: Emails
792801attribute posthog.client.Client.enable_exception_autocapture = enable_exception_autocapture
793802attribute posthog.client.Client.enable_exception_autocapture_rate_limiting = enable_exception_autocapture_rate_limiting
794803attribute posthog.client.Client.enable_full_ai_capture = enable_full_ai_capture is True or _use_ai_lane is True or _enable_multimodal_capture is True
@@ -870,6 +879,21 @@ attribute posthog.debug = False
870879attribute posthog.default_client = None
871880attribute posthog.disable_geoip = True
872881attribute posthog.disabled = False
882+ attribute posthog.emails.EmailError.code = code
883+ attribute posthog.emails.EmailError.docs_url = docs_url
884+ attribute posthog.emails.EmailError.field = field
885+ attribute posthog.emails.EmailError.fix = fix
886+ attribute posthog.emails.EmailError.message = message
887+ attribute posthog.emails.EmailError.name = name
888+ attribute posthog.emails.EmailError.retry_after = retry_after
889+ attribute posthog.emails.EmailError.status_code = status_code
890+ attribute posthog.emails.EmailError.why = why
891+ attribute posthog.emails.EmailWarning.code: str
892+ attribute posthog.emails.EmailWarning.fix: Optional[str] = None
893+ attribute posthog.emails.EmailWarning.message: str
894+ attribute posthog.emails.SendEmailResult.id: Optional[str]
895+ attribute posthog.emails.SendEmailResult.replayed: bool = False
896+ attribute posthog.emails.SendEmailResult.warnings: tuple[EmailWarning, ...] = ()
873897attribute posthog.enable_exception_autocapture = False
874898attribute posthog.enable_exception_autocapture_rate_limiting = False
875899attribute posthog.enable_full_ai_capture = False
@@ -1095,6 +1119,7 @@ attribute posthog.request.APIError.message = message
10951119attribute posthog.request.APIError.retry_after = retry_after
10961120attribute posthog.request.APIError.status = status
10971121attribute posthog.request.DEFAULT_HOST = US_INGESTION_ENDPOINT
1122+ attribute posthog.request.EU_APP_ENDPOINT = 'https://eu.posthog.com'
10981123attribute posthog.request.EU_INGESTION_ENDPOINT = 'https://eu.i.posthog.com'
10991124attribute posthog.request.EVENTS_ENDPOINT = '/batch/'
11001125attribute posthog.request.GetResponse.data: Any
@@ -1109,6 +1134,7 @@ attribute posthog.request.RequestsConnectionError = requests.exceptions.Connecti
11091134attribute posthog.request.RequestsTimeout = requests.exceptions.Timeout
11101135attribute posthog.request.SocketOptions = List[Tuple[int, int, Union[int, bytes]]]
11111136attribute posthog.request.USER_AGENT = 'posthog-python/' + VERSION
1137+ attribute posthog.request.US_APP_ENDPOINT = 'https://us.posthog.com'
11121138attribute posthog.request.US_INGESTION_ENDPOINT = 'https://us.i.posthog.com'
11131139attribute posthog.secret_key = None
11141140attribute posthog.send = True
@@ -1274,15 +1300,20 @@ class posthog.ai.types.TokenUsage
12741300class posthog.ai.types.ToolInProgress
12751301class posthog.args.OptionalCaptureArgs
12761302class posthog.args.OptionalSetArgs
1277- class posthog.async_client.AsyncClient(project_api_key: str, host: Optional[str] = None, debug: bool = False, max_queue_size: int = 10000, send: bool = True, on_error=None, flush_at: int = 100, flush_interval: float = 5.0, gzip: bool = False, max_retries: int = 3, timeout: float = 15, thread: int = 1, disabled: bool = False, disable_geoip: bool = True, is_server: bool = True, historical_migration: bool = False, super_properties: Optional[dict[str, Any]] = None, before_send=None, log_captured_exceptions: bool = False, project_root: Optional[str] = None, capture_exception_code_variables: bool = False, code_variables_mask_patterns=None, code_variables_ignore_patterns=None, code_variables_mask_url_credentials=None, code_variables_detect_secrets=None, in_app_modules: Optional[list[str]] = None, capture_mode: Optional[Union[CaptureMode, str]] = None, capture_compression: Optional[Union[CaptureCompression, str]] = None, capture_trace_context: bool = False, secret_key: Optional[str] = None, personal_api_key: Optional[str] = None, feature_flags_request_timeout_seconds: float = 3, feature_flags_request_max_retries: int = 1)
1303+ class posthog.async_client.AsyncClient(project_api_key: str, host: Optional[str] = None, debug: bool = False, max_queue_size: int = 10000, send: bool = True, on_error=None, flush_at: int = 100, flush_interval: float = 5.0, gzip: bool = False, max_retries: int = 3, timeout: float = 15, thread: int = 1, disabled: bool = False, disable_geoip: bool = True, is_server: bool = True, historical_migration: bool = False, super_properties: Optional[dict[str, Any]] = None, before_send=None, log_captured_exceptions: bool = False, project_root: Optional[str] = None, capture_exception_code_variables: bool = False, code_variables_mask_patterns=None, code_variables_ignore_patterns=None, code_variables_mask_url_credentials=None, code_variables_detect_secrets=None, in_app_modules: Optional[list[str]] = None, capture_mode: Optional[Union[CaptureMode, str]] = None, capture_compression: Optional[Union[CaptureCompression, str]] = None, capture_trace_context: bool = False, secret_key: Optional[str] = None, personal_api_key: Optional[str] = None, feature_flags_request_timeout_seconds: float = 3, feature_flags_request_max_retries: int = 1, app_host: Optional[str] = None, email_request_timeout_seconds: float = 15, email_request_max_retries: int = 2)
12781304class posthog.async_client.AsyncPosthog
12791305class posthog.bucketed_rate_limiter.BucketedRateLimiter(bucket_size: Number, refill_rate: Number, refill_interval_seconds: Number, on_bucket_rate_limited: Optional[Callable[[Hashable], None]] = None, clock: Callable[[], float] = time.monotonic)
12801306class posthog.capture_compression.CaptureCompression
12811307class posthog.capture_mode.CaptureMode
12821308class posthog.capture_v1.CaptureV1Error(status: int | str, message: str, *, retry_after: Optional[float] = None, request_id: Optional[str] = None, attempts: Optional[int] = None, retry_exhausted: Optional[list[str]] = None, drops: Optional[list[tuple[str, Optional[str]]]] = None)
1283- class posthog.client.Client(project_api_key: str, host=None, debug=False, max_queue_size=10000, send=True, on_error=None, flush_at=100, flush_interval=5.0, gzip=False, max_retries=3, sync_mode=False, timeout: float = 15, thread=1, poll_interval=30, personal_api_key=None, disabled=False, disable_geoip=True, is_server=True, historical_migration=False, feature_flags_request_timeout_seconds: float = 3, feature_flags_request_max_retries=1, super_properties=None, enable_exception_autocapture=False, log_captured_exceptions=False, project_root=None, privacy_mode=False, before_send=None, flag_fallback_cache_url=None, enable_local_evaluation=True, flag_definition_cache_provider: Optional[FlagDefinitionCacheProvider] = None, capture_exception_code_variables=False, code_variables_mask_patterns=None, code_variables_ignore_patterns=None, code_variables_mask_url_credentials=None, code_variables_detect_secrets=None, in_app_modules: list[str] | None = None, enable_exception_autocapture_rate_limiting=False, exception_autocapture_bucket_size=ExceptionCapture.DEFAULT_BUCKET_SIZE, exception_autocapture_refill_rate=ExceptionCapture.DEFAULT_REFILL_RATE, exception_autocapture_refill_interval_seconds=ExceptionCapture.DEFAULT_REFILL_INTERVAL_SECONDS, capture_mode: Optional[Union[CaptureMode, str]] = None, capture_compression: Optional[Union[CaptureCompression, str]] = None, secret_key=None, metrics: Optional[dict] = None, enable_full_ai_capture=False, capture_trace_context=False, _use_ai_lane=False, _enable_multimodal_capture=False, traces: Optional[dict] = None)
1309+ class posthog.client.Client(project_api_key: str, host=None, debug=False, max_queue_size=10000, send=True, on_error=None, flush_at=100, flush_interval=5.0, gzip=False, max_retries=3, sync_mode=False, timeout: float = 15, thread=1, poll_interval=30, personal_api_key=None, disabled=False, disable_geoip=True, is_server=True, historical_migration=False, feature_flags_request_timeout_seconds: float = 3, feature_flags_request_max_retries=1, super_properties=None, enable_exception_autocapture=False, log_captured_exceptions=False, project_root=None, privacy_mode=False, before_send=None, flag_fallback_cache_url=None, enable_local_evaluation=True, flag_definition_cache_provider: Optional[FlagDefinitionCacheProvider] = None, capture_exception_code_variables=False, code_variables_mask_patterns=None, code_variables_ignore_patterns=None, code_variables_mask_url_credentials=None, code_variables_detect_secrets=None, in_app_modules: list[str] | None = None, enable_exception_autocapture_rate_limiting=False, exception_autocapture_bucket_size=ExceptionCapture.DEFAULT_BUCKET_SIZE, exception_autocapture_refill_rate=ExceptionCapture.DEFAULT_REFILL_RATE, exception_autocapture_refill_interval_seconds=ExceptionCapture.DEFAULT_REFILL_INTERVAL_SECONDS, capture_mode: Optional[Union[CaptureMode, str]] = None, capture_compression: Optional[Union[CaptureCompression, str]] = None, secret_key=None, metrics: Optional[dict] = None, enable_full_ai_capture=False, capture_trace_context=False, _use_ai_lane=False, _enable_multimodal_capture=False, traces: Optional[dict] = None, app_host: Optional[str] = None, email_request_timeout_seconds: float = 15, email_request_max_retries: int = 2)
12841310class posthog.consumer.Consumer(queue, api_key, flush_at=100, host=None, on_error=None, flush_interval=5.0, gzip=False, retries=10, timeout: float = 15, historical_migration=False, endpoint=EVENTS_ENDPOINT, max_msg_size=MAX_MSG_SIZE, capture_mode=CaptureMode.V0, capture_compression=CaptureCompression.NONE)
12851311class posthog.contexts.ContextScope(parent=None, fresh: bool = False, capture_exceptions: bool = True, client: Optional[Client] = None)
1312+ class posthog.emails.AsyncEmails(secret_key: Optional[str], *, host: Optional[str] = None, timeout: float = 15, max_retries: int = 2, disabled: bool = False, http_client: Any = None)
1313+ class posthog.emails.EmailError(*, name: str, code: str, message: str, status_code: Optional[int] = None, why: Optional[str] = None, fix: Optional[str] = None, docs_url: Optional[str] = None, field: Optional[str] = None, retry_after: Optional[float] = None)
1314+ class posthog.emails.EmailWarning(code: str, message: str, fix: Optional[str] = None)
1315+ class posthog.emails.Emails(secret_key: Optional[str], *, host: Optional[str] = None, timeout: float = 15, max_retries: int = 2, disabled: bool = False, session: Optional[requests.Session] = None)
1316+ class posthog.emails.SendEmailResult(id: Optional[str], replayed: bool = False, warnings: tuple[EmailWarning, ...] = ())
12861317class posthog.exception_capture.ExceptionCapture(client: Client, rate_limiting_enabled=False, bucket_size=DEFAULT_BUCKET_SIZE, refill_rate=DEFAULT_REFILL_RATE, refill_interval_seconds=DEFAULT_REFILL_INTERVAL_SECONDS)
12871318class posthog.exception_utils.AnnotatedValue(value, metadata)
12881319class posthog.exception_utils.VariableSizeLimiter(max_size=DEFAULT_TOTAL_VARIABLES_SIZE_LIMIT)
@@ -1521,6 +1552,7 @@ function posthog.mcp.session_token.read_mcp_session_header(headers: Any) -> Opti
15211552function posthog.mcp.tools.get_more_tools_result() -> Dict[str, Any]
15221553function posthog.new_context(fresh: bool = False, capture_exceptions: Optional[bool] = None, client: Optional[Client] = None)
15231554function posthog.request.batch_post(api_key: str, host: Optional[str] = None, gzip: bool = False, timeout: float = 15, path: str = EVENTS_ENDPOINT, **kwargs) -> requests.Response
1555+ function posthog.request.determine_app_host(host: Optional[str]) -> str
15241556function posthog.request.determine_server_host(host: Optional[str]) -> str
15251557function posthog.request.disable_connection_reuse() -> None
15261558function posthog.request.enable_keep_alive() -> None
@@ -1777,6 +1809,10 @@ method posthog.contexts.ContextScope.set_code_variables_mask_url_credentials(ena
17771809method posthog.contexts.ContextScope.set_device_id(device_id: str)
17781810method posthog.contexts.ContextScope.set_distinct_id(distinct_id: str)
17791811method posthog.contexts.ContextScope.set_session_id(session_id: str)
1812+ method posthog.emails.AsyncEmails.aclose() -> None
1813+ method posthog.emails.AsyncEmails.send(*, to: str, template_id: Union[str, UUID], template_data: Optional[Mapping[str, Any]] = None, distinct_id: Optional[str] = None, idempotency_key: Optional[str] = None) -> SendEmailResult
1814+ method posthog.emails.Emails.close() -> None
1815+ method posthog.emails.Emails.send(*, to: str, template_id: Union[str, UUID], template_data: Optional[Mapping[str, Any]] = None, distinct_id: Optional[str] = None, idempotency_key: Optional[str] = None) -> SendEmailResult
17801816method posthog.exception_capture.ExceptionCapture.capture_exception(exception, metadata=None)
17811817method posthog.exception_capture.ExceptionCapture.close()
17821818method posthog.exception_capture.ExceptionCapture.exception_handler(exc_type, exc_value, exc_traceback)
@@ -1911,6 +1947,7 @@ module posthog.capture_v1
19111947module posthog.client
19121948module posthog.consumer
19131949module posthog.contexts
1950+ module posthog.emails
19141951module posthog.exception_capture
19151952module posthog.exception_utils
19161953module posthog.feature_flag_evaluations
0 commit comments