SteemConnect on the Google Firebase: introducing steemconnect-firebase-functions

in #utopian-io7 years ago (edited)

Quick links:

What is steemconnect-firebase-functions?

"Build apps fast, without managing infrastructure" - this is how Firebase is described on its landing page. Indeed, this is a great platform with a bunch of cool products, such as Cloud Firestore (database) or Cloud Storage (files storage). Firebase also allows users to sign in to your app with their external accounts, like Google, Facebook or Github.

However, to enable users of your Firebase based app to sign in with their Steem account you have to implement OAuth2 authorization code grant flow yourself, which can be tricky. That's why I built a library that helps in that process. Say hello to steemconnect-firebase-functions.

image.png

How does it work?

steemconnect-firebase-functions comes with OAuth2 helper functions such as getAccessToken or getAuthorizationUrl, SteemConnect API helper functions such as getUserData or broadcastOperations, and Firebase only helper functions such as mintFirebaseToken or saveAccessToken.

You still have to write code, of course, but you don't have to care about implementation of these functionalities.

Where does it work?

steemconnect-firebase-functions is a library that helps you in the process of building apps based on SteemConnect and Firebase. However, most of the functions from this library can be used in any NodeJS environment, so if you want to implement SteemConnect OAuth2 flow on your NodeJS server, this library will still be useful.

To use it, one simply has to install it via npm:

npm install steemconnect-firebase-functions --save

What kind of projects can be created with this library?

Basically, you can create anything, but I believe some kind of projects are more appropriate for steemconnect-firebase-functions than others:

  • Steem-related projects that doesn't publish anything on the Steem blockchain, but need to authenticate users via their Steem account (SteemConnect); good example of this kind of app is SteemProjects by @noisy
  • not Steem-related apps that want to get their users one more option to sign in to the app (if the app already has an option to sign in via Facebook, why don't they add signing in via SteemConnect?)
  • apps to schedule posts publishing or curation trails
  • Steem interfaces that need to moderate content, such as Utopian

Technology stack

  • TypeScript for development, compiled to ES2015 for production
  • testing stack: mocha + chai + nock + sinon
  • Travis CI for CI (CD in the future)

What next?

I'm going to continue improving library and development process:

  • next week, I am going to release a complete tutorial on how to build an app like example app from scratch
  • more API functions to make developer's life easier (separate functions for upvote, post, comment, etc. instead of only one general broadcastOperations function)
  • add support for a long-lived token (refresh token and the entire process)
  • write better documentation

I believe tutorials are the best way to do explain how to use a library and why is it useful, so I also plan to write more example apps and tutorials how to build them in the near future.

Do you want to contribute?

Feel free to contact me either on the steemit.chat or on the Discord.

There is still much to do ;)


Note for Utopian moderators: the entire library was made by myself, but I couldn't link more than three pull requests to this contribution.



Posted on Utopian.io - Rewarding Open Source Contributors

Sort:  

Thank you for the contribution. It has been approved.

You can contact us on Discord.
[utopian-moderator]

Hey @jakipatryk I am @utopian-io. I have just upvoted you!

Achievements

  • You have less than 500 followers. Just gave you a gift to help you succeed!
  • Seems like you contribute quite often. AMAZING!

Community-Driven Witness!

I am the first and only Steem Community-Driven Witness. Participate on Discord. Lets GROW TOGETHER!

mooncryption-utopian-witness-gif

Up-vote this comment to grow my power and help Open Source contributions like this one. Want to chat? Join me on Discord https://discord.gg/Pc8HG9x

Coin Marketplace

STEEM 0.18
TRX 0.16
JST 0.032
BTC 59322.53
ETH 2584.74
USDT 1.00
SBD 2.45