Fireship · @fireship
Coinbase + Firebase - Build a Bitcoin App
Uploaded December 17, 2017 · Length 10:39
Summary
build a bitcoin app using coinbase and firebase for custom authentication and transactions
- coinbase firebase integration
- bitcoin app development
- custom authentication
- firebase authentication
- angular firebase app
- coinbase api
Transcript preview
The first 2 minutes of the transcript. Select a timestamp to watch that moment on YouTube.
- 0:00
it might be a little late to get in on
- 0:01
the Bitcoin bubble but it's not too late
- 0:03
to start building apps for people that
- 0:05
use crypto currencies in this episode
- 0:07
I'm going to show you how to use coin
- 0:08
base as a custom authentication provider
- 0:10
for firebase that means your users will
- 0:13
be able to log in to firebase via
- 0:14
coinbase and then you can use the coin
- 0:16
base API to handle Bitcoin transactions
- 0:19
if you're new here make sure to
- 0:20
subscribe and you can follow along with
- 0:22
the source code at angular firebase com
- 0:24
let's first take a look at how this is
- 0:25
going to work the user is going to click
- 0:27
the log in with coinbase button in our
- 0:29
angular app that redirects then the coin
- 0:31
base where they authenticate into their
- 0:32
account then coinbase redirects them
- 0:34
back to angular with an encrypted off
- 0:36
code the code then goes to a cloud
- 0:38
function which exchanges it for an
- 0:39
actual access token and refresh token
- 0:42
from coinbase we can then mint our own
- 0:44
custom firebase authentication token
- 0:46
then send it back to angular and log the
- 0:48
user in as a firebase user learning this
- 0:51
process will also allow you to
- 0:52
authenticate with other providers such
- 0:54
as Instagram Twitter pata Phi and many
- 0:57
others to get started you'll need a coin
- 0:59
base account and you'll want to create a
- 1:01
new o2 application make note of your API
- 1:04
keys and then make sure you set a
- 1:06
redirect URI that points to localhost
- 1:08
4200 slash redirect after that you can
- 1:11
create a brand new angular 5 app and
- 1:13
make sure it has the routing module from
- 1:15
there you'll need to install angularfire
- 1:17
2 and firebase so make sure to follow
- 1:19
the official instructions at the
- 1:21
angularfire repo now inside of our
- 1:23
angular project we're going to
- 1:25
initialize cloud functions we're also
- 1:27
going to use the new typescript option
- 1:28
so make sure your firebase CLI tools are
- 1:31
updated to the latest version I also
- 1:34
have a few dependencies in the cloud
- 1:35
function environment the main one is
- 1:37
Axios which replaces the node HTTP
- 1:40
module the reason we do that is because
- 1:42
promises are a lot easier to work with
- 1:43
and callbacks when dealing with
- 1:45
asynchronous activity and a cloud
- 1:47
function then I also have cores and
- 1:50
crypto which we'll see in use here in
- 1:51
just a second because we're going to be
- 1:54
minting custom off tokens we need to use
- 1:56
our actual service account from firebase
- 1:58
it's just a JSON file and I'll quickly


