Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

265
Vistas
React Native - run script from cdn

Is there a way to run a script from a cdn in react-native?

For example in ReactJS:

 //index.html
 <script
  type="text/javascript"
  src="https://js.xendit.co/v1/xendit.min.js"
 ></script>

 //react component file
 const Xendit = window.Xendit;
 const Component = ({card_number}) => {
     const[cardNumberValidated, setCardNumberValidated] = useState(false);
     useEffect(() => {
        const isValidated = Xendit.card.validate(card_number);
        setCardNumberValidated(isValidated)
     },[])
     ...
 }

I tried downloading the file and saving it locally, but it doesn't work

saved file
Xendit.min.js

//import
import Xendit from '@myUtils/Xendit.min';
import {KEY} from '@myUtils/XenditUtils';

//call it
Xendit.setPublishableKey(KEY)
//it returns Xendit.default.setPublishableKey is not a function
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Use xendit-js-node

...
import Xendit from 'xendit-js-node';
...
Xendit.setPublishableKey('xnd_public_development_OYqIfOUth+GowsY6LeJOHzLCZtSj84J9kXDn+Rxj/mbf/LCoCQdxgA==');
...
Xendit.card.createAuthentication(threeDSData, this._tokenResponseHandler);
...
//etc.

There is an official example React Native app: https://github.com/xendit/xendit-react-example

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda