I think it's import to keep your backend/api isolated from these FE frameworks. Backends live forever, these frameworks not so much.
InertiaJS is an idea/implementation I like and its way of mitigating this issue of meta-framework dependence.
Personally, I found maintaining a second backend only codebase and hitting it from the SvelteKit backend to be really cumbersome.
You can write controllers and even an API and keep it in its own folder system.