https://supertokens.com/ logo
#general
Title
# general
d

Demna

04/01/2022, 12:03 PM
Hey, everyone! Quick question: When creating an API for SuperTokens in API Gateway, should I create an HTTP or a REST API?
r

rp

04/01/2022, 12:31 PM
Which API gateway @User
d

Demna

04/01/2022, 12:32 PM
I'm following the AWS Lambda guide, but the API Gateway configuration part starts from configuring an existing API, so I was wondering whether I should create a REST or HTTP API. I went with REST, but I've yet to test it.
r

rp

04/01/2022, 12:33 PM
If you are using JWT authorizer then you should use HTTP. Else, I think REST should work (but this will require a custom lambda authorizer, for which we have a guide too).
d

Demna

04/01/2022, 12:34 PM
I'm using sessions, so I'll go with REST. Thanks!
r

rp

04/01/2022, 12:34 PM
Cool! So you will have to use custom lambda authorizer.
d

Demna

04/01/2022, 12:35 PM
BTW,
auth.js
and
user.js
go into separate projects as separate Lambda functions, right? So I can tell one Lambda to use
auth.handler
and the other
user.handler
.
And associate GET requests with one and POST with the other.
r

rp

04/01/2022, 12:35 PM
idk about separate projects, but separate functions - sure.
d

Demna

04/01/2022, 12:36 PM
Yeah, pretty much.
So I have to use Lambda authorizers? I was hoping, since both it, JWT, and session verification are grouped under the same umbrella, I'd go with the easiest one—session verification—and save myself the headache. I guess that won't work out?
I mean this "umbrella". 😅
r

rp

04/01/2022, 12:38 PM
The easier one is JWT authoriser. But for that, you will have to use HTTP and NOT REST
d

Demna

04/01/2022, 12:39 PM
Thank you very much, rp!
2 Views