I don't think we have any guide for this, you will have to tinker with it.
The best way to integrate would be to rewrite your custom pages using the Flarum API, integrating them with the single page application. That way you can reuse all the templates and logic from Flarum.
If you only want to share the header but don't need to access the user session server side you might be able to get something to work entirely from JavaScript if you don't have cross domain restrictions, but that would still require some custom code.