Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

266
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!