Access Denied when accessing https://public.bnbstatic.com/static/js/ocbs/@binance/fiat-widget.js

Hi, I am trying to use the Binance Fiat Widget on my website by accessing https://public.bnbstatic.com/static/js/ocbs/@binance/fiat-widget.js from my website or a browser gives Access Denied. I’m accessing via localhost using http.

Attempting to follow the instruction here which don’t work due to the access denied issue:

Not sure if it is a cloudflare issue.

AccessDenied Access Denied 2ZHK48PMG8N4N0EG lh5CTM4Ze5LGZYrPelT/58Kd4idR55CoSYJGq6oHPq5nlL8RkiyHT4MWA4jIRrtrNxK47eb9ghc=

note: The previous widget worked fine
but is now broken so using the new one recommended above - but cannot get it to work.

Hi, thanks for raising this issue. Looks like it’s a universal issue so it’s not just you.

Can you try and use the NPM Package version instead? @binance/fiat-widget - npm

You need to install it in your JS/TS project npm install @binance/fiat-widget and then style and use it (there’s also instructions on the link I provided above):

import {Widget} from '@binance/fiat-widget'

const options = {
    locale: 'en',
    width: 200,
    theme: 'dark',
    coinInfo: {
      fiat: '',
      crypto: '',
      isInUS: false
    },
    urlParmas: {
        ref: '',
        us_ref: '',
        utm_source: ''
    }
}

Widget('#widget', options)

Place the div in your page
<div id="widget"></div>

Thanks for the update. My Website is built in Visual Studio using just Javascript (NOT typeScript) … is there a nuget package I can install or is there a repo with a copy of the file https://public.bnbstatic.com/static/js/ocbs/@binance/fiat-widget.js in it?

Many thanks.

We also shared the issue with the team.

Thanks

@John-Blair this should be fixed. Please have a try.

Thanks for the update. Yes the access denied issue is fixed and the widget looks presentable now on my website. However the Buy button no longer does a useful job. e.g. if I want to buy ALGO crytpto with £100 GBP the button takes me to the url

Pasting in partial url as the editor replaces above full url with an image “/en/buy-sell-crypto?fiat=GBP&crypto=ALGO&amount=100&ref=55731656”

which is correct, but it immediately redirects to

Pasting in partial url as the editor replaces above with an image “/en/crypto”

with the screen populated with 15 EUR and 16.4 USD, which is not what I had configured on the widget.

The widget is now totally useless. Could you please investigate if you can make the widget work i.e. not do the redirect to the 2nd url above? Thanks.