aircall / aircall-everywhere

SDK to embed and communicate to Aircall phone in any web page
https://aircall.github.io/aircall-everywhere
25 stars 16 forks source link

[Report only] A lot of errors after logging in #81

Open ppascualv opened 1 year ago

ppascualv commented 1 year ago

I just added the library to my React app and after logging in, I'm receiving a lot of errors related to permissions and security. Screenshot 2022-12-27 at 12 56 13

The code related to Aircall

import { Fab, Paper, SvgIcon } from "@mui/material"
import LoginIcon from "@mui/icons-material/Login"
import { useTranslation } from "next-i18next"
import { styled } from "@mui/system"
import AircallPhone from "aircall-everywhere"
import useIntegrations from "../../hooks/useIntegrations"
import { useState } from "react"
import AircallPic from "../../../public/images/third_party_logos/aircall.svg"
import AircallSVG from "../customSVG/AircallSVG"
import AircallIcon from "../customSVG/AircallSVG"

const StyledFab = styled(Fab)(({ theme }) => ({
  position: "fixed",
  top: "80px",
  right: "20px",
  backgroundColor: "white"
}))

const AircallContainer = styled(Paper)(({ theme }) => ({
  position: "fixed",
  top: "130px",
  right: "50px",
  zIndex: 2000,
  "& #phone": {
    iframe: {
      border: 0
    }
  }
}))

export default function AircallIntegration() {
  const { t } = useTranslation()
  const { included: aircall } = useIntegrations("aircall")
  const { included: hubspot } = useIntegrations("hubspot")
  const [login, setLogin] = useState(false)
  const phone = new AircallPhone({
    domToLoadPhone: "#phone",
    onLogin: settings => {
      console.log(settings)
      setLogin(true)
    },
    onLogout: () => {
      setLogin(false)
    },
    //integrationToLoad: hubspot ? "hubspot" : null,
    size: "big",
    debug: process.env.REACT_APP_ENVIRONMENT === "development"
  })

  //if (true) return null

  if (!aircall) return null

  return (
    <>
      <StyledFab size="large">
        <AircallIcon size="large" />
      </StyledFab>
      <AircallContainer elevation={3}>
        <div id="phone" />
      </AircallContainer>
    </>
  )
}
itag-tech commented 1 year ago

Same observation on my React application and these errors are also present on the demo version that is available online here (on "load phone" button) : https://aircall.github.io/aircall-everywhere/