@@ -64,12 +64,14 @@ class ImageKit(SyncAPIClient):
6464 # client options
6565 private_api_key : str
6666 password : str | None
67+ webhook_secret : str | None
6768
6869 def __init__ (
6970 self ,
7071 * ,
7172 private_api_key : str | None = None ,
7273 password : str | None = None ,
74+ webhook_secret : str | None = None ,
7375 base_url : str | httpx .URL | None = None ,
7476 timeout : Union [float , Timeout , None , NotGiven ] = NOT_GIVEN ,
7577 max_retries : int = DEFAULT_MAX_RETRIES ,
@@ -94,6 +96,7 @@ def __init__(
9496 This automatically infers the following arguments from their corresponding environment variables if they are not provided:
9597 - `private_api_key` from `IMAGEKIT_PRIVATE_API_KEY`
9698 - `password` from `OPTIONAL_IMAGEKIT_IGNORES_THIS`
99+ - `webhook_secret` from `IMAGEKIT_WEBHOOK_SECRET`
97100 """
98101 if private_api_key is None :
99102 private_api_key = os .environ .get ("IMAGEKIT_PRIVATE_API_KEY" )
@@ -107,6 +110,10 @@ def __init__(
107110 password = os .environ .get ("OPTIONAL_IMAGEKIT_IGNORES_THIS" ) or "do_not_set"
108111 self .password = password
109112
113+ if webhook_secret is None :
114+ webhook_secret = os .environ .get ("IMAGEKIT_WEBHOOK_SECRET" )
115+ self .webhook_secret = webhook_secret
116+
110117 if base_url is None :
111118 base_url = os .environ .get ("IMAGE_KIT_BASE_URL" )
112119 self ._base_url_overridden = base_url is not None
@@ -174,6 +181,7 @@ def copy(
174181 * ,
175182 private_api_key : str | None = None ,
176183 password : str | None = None ,
184+ webhook_secret : str | None = None ,
177185 base_url : str | httpx .URL | None = None ,
178186 timeout : float | Timeout | None | NotGiven = NOT_GIVEN ,
179187 http_client : httpx .Client | None = None ,
@@ -209,6 +217,7 @@ def copy(
209217 client = self .__class__ (
210218 private_api_key = private_api_key or self .private_api_key ,
211219 password = password or self .password ,
220+ webhook_secret = webhook_secret or self .webhook_secret ,
212221 base_url = base_url or self .base_url ,
213222 timeout = self .timeout if isinstance (timeout , NotGiven ) else timeout ,
214223 http_client = http_client ,
@@ -273,12 +282,14 @@ class AsyncImageKit(AsyncAPIClient):
273282 # client options
274283 private_api_key : str
275284 password : str | None
285+ webhook_secret : str | None
276286
277287 def __init__ (
278288 self ,
279289 * ,
280290 private_api_key : str | None = None ,
281291 password : str | None = None ,
292+ webhook_secret : str | None = None ,
282293 base_url : str | httpx .URL | None = None ,
283294 timeout : Union [float , Timeout , None , NotGiven ] = NOT_GIVEN ,
284295 max_retries : int = DEFAULT_MAX_RETRIES ,
@@ -303,6 +314,7 @@ def __init__(
303314 This automatically infers the following arguments from their corresponding environment variables if they are not provided:
304315 - `private_api_key` from `IMAGEKIT_PRIVATE_API_KEY`
305316 - `password` from `OPTIONAL_IMAGEKIT_IGNORES_THIS`
317+ - `webhook_secret` from `IMAGEKIT_WEBHOOK_SECRET`
306318 """
307319 if private_api_key is None :
308320 private_api_key = os .environ .get ("IMAGEKIT_PRIVATE_API_KEY" )
@@ -316,6 +328,10 @@ def __init__(
316328 password = os .environ .get ("OPTIONAL_IMAGEKIT_IGNORES_THIS" ) or "do_not_set"
317329 self .password = password
318330
331+ if webhook_secret is None :
332+ webhook_secret = os .environ .get ("IMAGEKIT_WEBHOOK_SECRET" )
333+ self .webhook_secret = webhook_secret
334+
319335 if base_url is None :
320336 base_url = os .environ .get ("IMAGE_KIT_BASE_URL" )
321337 self ._base_url_overridden = base_url is not None
@@ -383,6 +399,7 @@ def copy(
383399 * ,
384400 private_api_key : str | None = None ,
385401 password : str | None = None ,
402+ webhook_secret : str | None = None ,
386403 base_url : str | httpx .URL | None = None ,
387404 timeout : float | Timeout | None | NotGiven = NOT_GIVEN ,
388405 http_client : httpx .AsyncClient | None = None ,
@@ -418,6 +435,7 @@ def copy(
418435 client = self .__class__ (
419436 private_api_key = private_api_key or self .private_api_key ,
420437 password = password or self .password ,
438+ webhook_secret = webhook_secret or self .webhook_secret ,
421439 base_url = base_url or self .base_url ,
422440 timeout = self .timeout if isinstance (timeout , NotGiven ) else timeout ,
423441 http_client = http_client ,
0 commit comments