Skip to content

Instantly share code, notes, and snippets.

@vicchi
Created February 22, 2016 08:48
Show Gist options
  • Save vicchi/bffac43b7c5f9581a979 to your computer and use it in GitHub Desktop.
Save vicchi/bffac43b7c5f9581a979 to your computer and use it in GitHub Desktop.
what3words API authentication with jQuery
var json = (function() {
var json = null;
$.ajax({
'async': true,
'global': false,
'url': "./config.json",
'dataType': "json",
'success': function (data) {
json = data;
}
});
return json;
})();
var key = json.what3words.key;
var options = {
key: key
lang: 'en'
};
var w3w = new What3words(options);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment