How can I enable “accounts-passwordless” package in my app?
I’ve already installed the package, but when I’m importing Accounts from “meteor/accounts-base” I could’t find any method related to passwordless package.
I don’t use TS but I can confirm this works perfectly:
Accounts.requestLoginTokenForUser({
selector: { email },
userData: { email },
options: { extra }
}, (error, { isNewUser } = {}) => {
if (error) {
console.log('got error', error)
return
}
setTimeout(() => toastShow(4000, 'A code was sent', 'Please check your email.', 'success'), 1000) // this is just a user on screen notification
})
Nowadays, This Framework should support Typescript in all official packages, moreover to improve the developer experience to stand up in the JS frameworks world.
This issue is moving me out toward other frameworks, like NestJS. And It’s really sad.
I am not sure I understand which part is bad here.
You can grab the package from Github, update the types, use is as a local package and move on or use it locally and push a PR back into Github. This is how it works. We call it open source, things you get for free and contribute to.
What exactly is bad?
I feel saying that getting a massive platform for free moves you out to NestJS is like saying on FB that you leave the group. Expect a lot of replies now saying … please don’t go.
I would like to personally wish you good luck with the other platforms where things are more … free and more complete and happier.
However, before you go, would you like me to write the types for you and provide you with the typed package?
First of all, let me tell you that I started using Meteor in 2014, building my SaaS platform (www.hirebop.com).
I like Meteor, truly.
But I saw that documentation is pretty incomplete and a little bit outdated in some circumstances.
What you say about open-source projects is totally fine. But in the case of the package I wrote before, should be documented that It doesn’t support Typescript, at the moment.
It’s pretty annoying to modify the code and send a pull request. I don’t wanna lose my time and I would stay concentrated in my code and my project.
Other frameworks are offering a nice DX, and the team behind Meteor, should put all their effort to improve it. Especially to retain developers.
the passwordless package doesn’t have types. The point is to add it in ether accounts-base existing types file or create a new types file within the passwordless package. This while you use either modified package as a local package.
Now with Zodern new support we can document types directly in the packages themselves.
Passwordless package was implemented before this new support for types so a PR would be a great solution to your problem and it would solve for everybody in the future.
Even core packages can be released outside Meteor official releases as patches so the Meteor Core team (cc @grubba@denyhs) could release this really fast.
Also, you could have a duplicated local copy while you wait the official release of your PR.
Disclaimer: I’m not part of the Meteor Software anymore so I’m talking here as a community member