You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I did a very basic integration using this API but the size of the bundle is too big, I think because of the dependencies.
See the following screenshot and below it, my package.json file:
my script is just a js with this example from the docs:
var clearbit = require('clearbit')('sk_<redacted>');
clearbit.Enrichment.find({email: 'alex@clearbit.com', stream: true})
.then(function (response) {
var person = response.person;
var company = response.company;
console.log('Name: ', person && person.name.fullName);
})
.catch(function (err) {
console.error(err);
});
I guess this is because it's meant to be used in node and not in the front end. But it can probably be optimised a little. Like it's only using three methods of lodash and still imports *
The text was updated successfully, but these errors were encountered:
I guess this is because it's meant to be used in node and not in the front end. But it can probably be optimised a little. Like it's only using three methods of lodash and still imports *
You're correct here on both counts.
This library was not designed to be used in the browser. Especially because placing your secret key in your JS bundle would expose it to everyone! This is not good.
var clearbit = require('clearbit')('sk_<redacted>'); // Don't do this
It wouldn't be a bad idea to trim down the giant lodash import and prune other unnecessary dependencies from this library.
Hi guys,
I did a very basic integration using this API but the size of the bundle is too big, I think because of the dependencies.
See the following screenshot and below it, my package.json file:
is there anything I can do to decrease the size?
my script is just a js with this example from the docs:
I guess this is because it's meant to be used in node and not in the front end. But it can probably be optimised a little. Like it's only using three methods of lodash and still imports *
The text was updated successfully, but these errors were encountered: