We are unable to use getTrustedAgentAuthorizationToken with the private client key.
const response = await shopperLogin.getTrustedAgentAuthorizationToken({ parameters: { 'channel_id': process.env.PUBLIC_COMMERCE_API_SITE_ID, 'grant_type': 'client_credentials', 'idp_origin': 'ecom', 'login_id': loginId, 'enc_user_id': encUserId }, headers: { 'Authorization': Bearer ${authCode}, '_sfdc_client_auth': base64data, 'Content-Type': 'application/x-www-form-urlencoded' } })
That's because the client_id is set to required. But we cannot pass both _sfdc_client_auth & client_id together.
As a work around - for now, we are going with the fetch API on our side. But it needs to be fixed in package and package should support getTrustedAgentAuthorizationToken for the case of private client key.