How to integrate render DLL to UE4

My custom renderer would be a C++ D3D/OpenGL renderer DLL.
How to render the UE4 scene with my renderer ?
I will manage the frame buffer, so I only care how to use UE4’s scene and how to flush back the rendering result to the swapchain?