Hoist's Gatsby app needs to talk to the Auth0 Management API, so let's build a Node.js Express API from scratch! We'll soon be integrating Stripe payments into Hoist, and need to remember each user's Stripe Customer ID. Rather than setting up a database just for this, we'll use Auth0's App Metadata storage, that allows us to save data against a specific user.
Find out more about the Auth0 Hackathon: https://a0.to/hackathon
Time Stamps:
00:00 Welcome!
00:56 Episode 2 recap
01:23 Defining today's goal
01:35 When to use Auth0's user_metadata versus app_metadata
02:25 Configuring access to your Auth0 tenant's Management API
04:50 Creating a new Node.js Express API project
08:45 Getting an Access Token for the Express API to talk to the Auth0 Management API
10:50 Sending an access token from Gatsby to the Express API
15:41 Handling CORS
16:53 Inspecting an Auth0 Management API access token
17:44 Creating a promise to get a Management API Token
23:50 Moving Auth0 configuration parameters to environment variables
26:16 Testing this all with a new Hoist user
26:58 Summary and what to expect next episode
--
Building Hoist focuses on the development journey of a platform designed to help everyone fund effective climate change programs with a single payment.
Episode 1: Gatsby and the Auth0 React SDK (https://ben.sc/hoist-ep1)
Episode 2: Integrating Sanity's Headless CMS with Gatsby (https://ben.sc/hoist-ep2)
Episode 3: Creating a Node.js Express API that can talk to the Auth0 Management API (https://ben.sc/hoist-ep3)
Follow the live development stream: https://ben.sc/twitch
Follow me on Twitter - https://ben.sc/twitter
--
A big shout out to Auth0 (https://ben.sc/auth0) who allow me to create these videos as part of my work. Hoist isn't an Auth0 product, but they're keen on seeing it succeed, and hopefully even using it someday!
Find out how Auth0 helps devs innovate and secure their apps: https://ben.sc/auth0-devs