Fireship · @fireship

Google Calendar + Firebase Auth

Uploaded September 24, 2018 · Length 9:55

Google Calendar + Firebase Auth

Summary

Learn how to use Google Calendar API with Firebase Auth, expanding Firebase's limited API access to virtually any other Google API.

  • google calendar api
  • firebase auth
  • google api integration
  • angularfire
  • google services library

Transcript preview

The first 2 minutes of the transcript. Select a timestamp to watch that moment on YouTube.

  1. 0:00

    [Music]

  2. 0:05

    there are literally hundreds of

  3. 0:07

    different api's available under the

  4. 0:09

    Google umbrella things like Drive

  5. 0:11

    calendar Google cloud platform maps and

  6. 0:14

    YouTube just to name a few but when you

  7. 0:16

    log in a user on firebase you only get

  8. 0:18

    access to a limited set of read-only

  9. 0:19

    data like their Google+ profile in

  10. 0:22

    today's video you'll learn how to work

  11. 0:23

    with the Google Calendar API on the

  12. 0:25

    behalf of a user but more importantly

  13. 0:27

    you'll learn how to expand the scope of

  14. 0:29

    firebase auth to work with virtually any

  15. 0:31

    other Google API if you're new here like

  16. 0:33

    and subscribe and there will be a

  17. 0:34

    one-of-a-kind shirt giveaway with this

  18. 0:36

    video all you have to do is leave a

  19. 0:37

    comment below letting me know which

  20. 0:39

    Google API you want to see covered next

  21. 0:40

    and I'll randomly pick a winner via

  22. 0:42

    livestream tomorrow let's start things

  23. 0:45

    off by taking a look at what we're

  24. 0:46

    actually building today it's currently

  25. 0:48

    Saturday night and I don't have anything

  26. 0:50

    additional on my calendar for today but

  27. 0:52

    if we skip ahead to Monday you'll see

  28. 0:53

    that I have a handful of appointments

  29. 0:55

    the goal of this lesson is for you to be

  30. 0:57

    able to log in a user with firebase and

  31. 0:59

    then programmatically update or read

  32. 1:02

    items in the calendar the inspiration

  33. 1:04

    for this video comes from a real-life

  34. 1:05

    tour operator based in New York City

  35. 1:07

    after they sign up they need to build

  36. 1:09

    out a complex itinerary for their trip

  37. 1:11

    now there's actually a couple different

  38. 1:12

    ways you can go about this but I'm going

  39. 1:14

    to show you the approach that I think is

  40. 1:15

    most developer friendly and flexible as

  41. 1:17

    you can see here when we log in it looks

  42. 1:20

    exactly like we're logging in with

  43. 1:21

    firebase and the Google auth provider

  44. 1:23

    but that's actually not what happened

  45. 1:25

    instead we use the Google services

  46. 1:27

    JavaScript library to sign in that gave

  47. 1:29

    us a JSON web token that we could then

  48. 1:31

    pass off to firebase to login as a

  49. 1:34

    firebase user the reason we do this is

  50. 1:36

    because we're going to use the Google

  51. 1:38

    services library to make API requests to

  52. 1:40

    the calendar API and it will

  53. 1:42

    automatically manage our access tokens

  54. 1:44

    so we can do everything from the

  55. 1:45

    front-end then once we're logged in we

  56. 1:48

    can retrieve this user it's Google

  57. 1:49

    Calendar by simply making a call to that

  58. 1:51

    API so the data we're looking at here in

  59. 1:54

    the UI are actual events from my Google

  60. 1:56

    Calendar in addition to reading the data

  61. 1:58

    we can also create update and delete