How to implement a proxy endpoint to securely interact with the Qonto API using Qonto Embed.
Define the proxyRequestFunction
proxyRequestFunction
parameter that calls your
intermediary endpoint. Since only you know your endpoint details and how to
call it, providing your implementation is how the SDK knows how to reach
your intermediary endpoint.Use the SDK normally
The SDK uses the proxyRequestFunction to call your intermediary endpoint
proxyRequestFunction
you
provided during initialization.Add the access token to the request in your intermediary endpoint
Authorization
header and the payload it receives as the data
parameter
in the body.Get the response from Qonto API and return it to the SDK
The SDK returns the response to your app
/app/api/embed-intermediary.ts
file as a Next Route Handler:
proxyRequestFunction
option to the SDK initialize
function:
proxyRequestFunction
needs to be implemented only once and will be used
for all SDK functions your application calls.