Is there any way to add a static route automatically when WireGuard connects?

Check this guide. The guide shows how to add static route and how to enable it in booting script.