Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Confusing naming between mailgun.js and mailgun-js #122

Closed
adriaandotcom opened this issue Mar 20, 2021 · 17 comments
Closed

Confusing naming between mailgun.js and mailgun-js #122

adriaandotcom opened this issue Mar 20, 2021 · 17 comments

Comments

@adriaandotcom
Copy link

Love that mailgun has an official Node.js package now!

But it's very confusing to know which library is official and which is not. Would be great to name at least the npmjs package the same as the GitHub repository.

GitHub: https://github.com/mailgun/mailgun-js

Official: https://www.npmjs.com/package/mailgun.js

Non official: https://www.npmjs.com/package/mailgun-js

I think https://github.com/mailgun/mailgun-js could be renamed to https://github.com/mailgun/mailgun.js. Let me know if I can help.

The non official module is also deprecated but gets way more weekly downloads then the official one. Would be great to have the depreciation notice on the NPM page as well.

Keep up the good work!

@darrylyoung
Copy link

Thanks for creating this, @adriaanvanrossum. I've also mentioned how confusing this is before but nothing seems to have changed. Glad to see that your issue is getting seen.

What makes it more confusing, at least for me, is that in the actual Mailgun dashboard, when looking at examples of how to use the API, it explicitly shows const mailgun = require("mailgun-js"); under the Node.js section. That alone is what led me to using that non-official package in the first place. If this official version supports Node as it says it does on the documentation, then that needs to be changed to point users to the official one as it's extremely misleading as it is right now.

Screenshot 2021-04-06 at 10 16 47

Anyway, thanks again for creating the issue!

@Jivings
Copy link

Jivings commented Apr 6, 2021

+1

I also installed the wrong package.

@adriaandotcom
Copy link
Author

On top of that the non-official version has a huge security issue: #124, https://www.npmjs.com/advisories/1658

netmask npm package (used by non-official version) is vulnerable to octal input data. This may lead to server-side request forgery, remote file inclusion, local file inclusion, and other vulnerabilities.

It would be nice if Mailgun would take over the mailgun-js package and merge both (mailgun-js and mailgun.js) into one.

I'm very tempted (tweet):

Screenshot

@darrylyoung
Copy link

On top of that the non-official version has a huge security issue: #124, https://www.npmjs.com/advisories/1658

Actually, that's the reason I came back here today and tried to move to the official package instead of using the non-official one. Previously, I had the non-official one working and said, after all the confusion, I'd never go back and touch it again.

@dinkydani
Copy link

+1
Installed the package in the Mailgun docs examples, but it's the wrong one.

@akaushik759
Copy link

Can't believe no one has fixed it yet! I wasted my entire day juggling between send and create message functions and why my attachments weren't being sent

@zeefarmer
Copy link
Collaborator

Thanks for the feedback, y'all, and apologies for the delays in getting this fixed. We've assumed ownership of https://www.npmjs.com/package/mailgun-js and deprecated that package. We've also renamed https://github.com/mailgun/mailgun-js to https://github.com/mailgun/mailgun.js so that it matches out official package on https://www.npmjs.com/package/mailgun.js.

We're also working on updating all of our documentation, both on our public sites, as well as the application.

@kylebakerio
Copy link

that's great... my last experience attempting to use mailgun for a dev project was such a disaster that it's hard to imagine giving you guys a second try, and was incredibly disappointing for a group that seems to target that specifically, but this is definitely an important step towards making sure that doesn't happen again.

@popod
Copy link
Contributor

popod commented Nov 7, 2021

@zeefarmer you have to rename this too:

npm mailgun

I've done it in PR: #206

hope this helps.

@adriaandotcom
Copy link
Author

Thanks for taking the time to fix this. One issue however, the official docs still refer to the deprecated package:

image

@Anan7Codes
Copy link

2022 April & I've just installed the depreciated package....

@adriaandotcom
Copy link
Author

2022 April & I've just installed the depreciated package....

Why @Anan7Codes? It's updated everywhere, right?

At least in the docs:

image

@Anan7Codes
Copy link

2022 April & I've just installed the depreciated package....

Why @Anan7Codes? It's updated everywhere, right?

At least in the docs:

image

Hi Adrian,

So if I go to the dashboard and then go to sending -> overview and select the button under API and choose nodejs I get the below code. The package mentioned over there is "mailgun-js" and I just went ahead and installed it.

const mailgun = require("mailgun-js");
const DOMAIN = 'YOUR_DOMAIN_NAME';
const mg = mailgun({apiKey: api_key, domain: DOMAIN});
const data = {
	from: 'Excited User <me@samples.mailgun.org>',
	to: 'bar@example.com, YOU@YOUR_DOMAIN_NAME',
	subject: 'Hello',
	text: 'Testing some Mailgun awesomness!'
};
mg.messages().send(data, function (error, body) {
	console.log(body);
});

@adriaandotcom
Copy link
Author

O Mailgun, ...

@chrisb2244
Copy link

Just did exactly the same... via https://app.mailgun.com/app/sending/domains/my-domain-name-here
Was pleased after finding this issue to discover that a) no audit complaints, and b) 13 instead of 68 packages installed...

@royalswe
Copy link

royalswe commented Dec 17, 2022

Still see the old code example via https://app.eu.mailgun.com/app/sending/domains/my-domain.
As I navigate around the documentation it seems to be lots of broken code examples.

@ninjadev-1203
Copy link

ninjadev-1203 commented Oct 31, 2023

Which one is correct?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests