Enabling "accounts-passwordless" package

I’m a little bit confused…

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.

Can you help me?
Thx

Hey, take a look at our implementation here GitHub - quavedev/accounts-passwordless-react

I think this will show everything that you need :wink:

Hey! Thank you… :muscle:

Documentation should be always updated.
It’s really important for all devs interested in Meteor.

I discovered Meteor in 2014 and docs is pretty the same as then.

It’s a key point, IMHO!

I searched for “meteor passwordless” in google and here is the first result

Sure!

But there’s no explanation how to implement it.

@filipenevola
what if I want to implement “accounts-passwordless” without using your library?

After installing that package, I receive this strange message: “Property ‘requestLoginTokenForUser’ does not exist on type ‘typeof Accounts’.”.

I’m using Typescript in my project.

Isn’t there an explanation in Meteor docs?

Thx

Any help?

I’m still stucked.

It seems Accounts class doesn’t contains any method related to “accounts-passwordless” package.

Maybe It’s a bug in the latest Meteor release.

Am I wrong?

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
    })

This is bad!

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.

IMHO

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?

IMHO

Thanks for your reply!

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.

These are my 2 cents :wink:

Try updating to latest version of @types/meteor via npm - could be out of date…

I’ve updated @types/meteor, but no method was found.
Sadly, the problem remain the same!

The only solution is to pass: // @ts-ignore on top.

Types for Accounts seem to be here:

I think this is where you have to add your type. Or within the Passwordless package keeping this in mind: Using Core Types | Meteor API Docs

I am glad to see hours later, you are still with Meteor … :slight_smile:

Glad to be here! :wink:

Anyway, I suggest you to create a new Meteor project, enabling Typescript and installing “accounts-passwordless” package.

Typescript will not found any method related to that package, even updating zodern:types.

Let me see if I’m wrong!

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.

Hi @lucalanzano81 with the new typescript support way from Zodern these issues are going to be gone soon.

In the past it was necessary to update an external package (GitHub - DefinitelyTyped/DefinitelyTyped: The repository for high quality TypeScript type definitions.) so it was hard to keep everything up-to-date.

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

I am wondering if anyone tried generating the types. These days with gen AI and all it’s the thing to do (try anyways)