const baseUrl = process.env.TOMO_IDV_BASE_URL; const clientId = process.env.TOMO_CLIENT_ID; const secretKey = process.env.TOMO_SECRET_KEY; if (!baseUrl || !clientId || !secretKey) { throw new Error('Set the three TOMO environment variables before signing.'); } const tokenEndpoint = baseUrl.replace(/\/+$/, '') + '/v1/oauth2/token'; const clientAssertion = createClientAssertion( clientId, secretKey, tokenEndpoint, ); // Send clientAssertion as client_assertion in the token request. // Keep it on your backend; do not log it.