I know that we can get the iso code of a country with this method:
import Cookies from 'js-cookie';
const iso = Cookies.get('CK_ISO_CODE');
console.log(iso); // -> 'us'
Is there a way to get the phone prefix?
For example, for US it should be +1, for FR +33 and so on.
You'll want to use this npm package: https://www.npmjs.com/package/world-countries
First here's an example that works in a snippet. We have to fetch the JSON file, so that eventListener is asynchronous, but if you use the npm package (next example) it won't have to be async.
With the npm package, it would look like this. (This example doesn't work because Stack Snippets doesn't include a module bundler)
So back to your question, it would look something like this: