DEV Community

Cover image for Client-Side Authentication is Easy with AuthBee!!!
Shakya Peiris
Shakya Peiris

Posted on

Client-Side Authentication is Easy with AuthBee!!!

Hello Everyone! I hope you are doing well. So today I'm going to introduce you AuthBee, a JavaScript library that you can use to implement client-side authentication without much pain.

Why you need to choose AuthBee?

When I started coding, I felt really difficult in implementing client-side token authentication with JWT because of some complex concepts such as Automatic log out, etc... So, in AuthBee all those concepts are concatenated to simple functions which are exported from authbee package and you will only need to import them from the package and call them in your program with respective parameters.

Main features of AuthBee

  • Login
  • Logout
  • Get authentication data provided when login (token)
  • Validate token and automatically logout when necessary

How to use AuthBee

You can simply call the function exported from the package and call them in your JavaScript code. For more details, you can refer to documentation and the example in GitHub repo.

Want to contribute to AuthBee?

I always highly appreciate your contribution to this project and, the reason for the development of these types of projects is people like you. So no matter whether you are a beginner or an expert, you are welcome to contribute and make sure you have already read contribution guidelines of the project.

Future of AuthBee

For now, I'm planning to add the following features to the project. If you have any idea on a new feature or found a bug then please report it to the issue section of the github repo.

  • Add typescript definitions
  • Make package compatible for SSR

So that's about the AuthBee and hope this package will be useful to you in your future projects. Thank You!!!

Top comments (2)

Collapse
 
jefrancomix profile image
Jesús Franco

Nice idea, but I'm not sure that the local capture of the token received is that difficult to warrant an additional dependency.

Nevertheless it could help some developers out there, even more if could be configurable, for example, and OAuth endpoint return an access_token and a refresh_token. Firebase for example implements OpenID Connect delivering and id_token.

So being able to adapt some other flows, apart from user_credentials (send username, password, receive a token), and provide some strategies of automatic purge of the token, or refreshing it, could make it a lot more interesting.

My 2 cents. I'd like to hear more about where you want to take your project. Starred on github!

Collapse
 
shakyapeiris profile image
Shakya Peiris

Hi, actually I didn't even think of them but now feel like it's good to implement those functionalities. Also, I was trying to make this package adaptable for SSR and still wasn't able to find a way.