For the authorization step you can pass an empty userId to exchangeCodeForAccessToken. After authorization, use the SDK id token (board.getIdToken) verified with a JWT library to pass user ids from Miro to your backend.

Context: GitHub issue on miroapp/api-clients: when enabling API authentication from Miro Web SDK authorization, the Miro user id is not available in time to look up the external user id.