Identity use with functions (v1/2) and Gatsby

Hi folks. I’m currently testing Identity to RBAC an app inside of Gatsby, and have set up identity hooks for user sign up and logins (to admin-update app_metadata). So far so good.

I’ve also set up a users function (outside of the Gatsby API) in order to fetch a list of site users. I’ll be adding a method in order to update users (roles, perhaps other metadata too) through this function as well. Seems to work well.

Question time. As far as I can tell, there’s no way for me to access admin Identity context inside Gatsby API calls, and so I have to continue creating dedicated lambdas in order to do anything involving admin Identity. Is that correct? And if I’ve noticed correctly, lambdas must be in v1 format (event, context) rather than the new v2 format (req, res) in order to be able to access Identity context for admin purposes, right?

Just want to make sure I’m not missing anything, as the docs only seem to provide demos with v1 lambdas, and never mention any compatibility with v2. I briefly tried v2 format for lambdas but couldn’t find any Identity context.

Thanks in advance for your insight!

Yes, you’re right about both the questions.

1 Like