@@ -296,6 +296,7 @@ def create_asgi_app(
296296 quiet : bool = False ,
297297 include_code : bool = False ,
298298 token : Optional [str ] = None ,
299+ skew_protection : bool = False ,
299300) -> ASGIAppBuilder :
300301 """Public API to create an ASGI app that can serve multiple notebooks.
301302 This only works for application that are in Run mode.
@@ -305,6 +306,8 @@ def create_asgi_app(
305306 include_code (bool, optional): Include notebook code in the app
306307 token (str, optional): Auth token to use for the app.
307308 If not provided, an empty token is used.
309+ skew_protection (bool, optional): Enable skew protection middleware to prevent version mismatch issues.
310+ e.g. if the server is updated, the client will be prompted to reload.
308311
309312 Returns:
310313 ASGIAppBuilder: A builder object to create multiple ASGI apps
@@ -477,6 +480,7 @@ def _create_app_for_file(base_url: str, file_path: str) -> ASGIApp:
477480 ),
478481 enable_auth = not AuthToken .is_empty (auth_token ),
479482 allow_origins = ("*" ,),
483+ skew_protection = skew_protection ,
480484 )
481485 app .state .session_manager = session_manager
482486 app .state .base_url = base_url
0 commit comments