ory / integrations

Apache License 2.0
19 stars 24 forks source link

Support Netlify Functions for NPM Ory Cloud Integrations #22

Open aeneasr opened 2 years ago

aeneasr commented 2 years ago

See discussions https://ory-community.slack.com/archives/C02MR4DEEGH/p1646150967822979

Basically, what we do here

https://github.com/ory/integrations/blob/808c421393b8f080d1f5599bf72b7e99bc90956d/src/next-edge/index.ts#L26

is that we create an expressJS handler that is specific to NextJS / Vercel's edge function model. However, under the hood, it's just plain expressJS (I believe).

If we extract the configuration options and the actuall proxying

https://github.com/ory/integrations/blob/808c421393b8f080d1f5599bf72b7e99bc90956d/src/next-edge/index.ts#L108

we could for sure make it work with netlify and other providers (e.g. cloudflare functions).

It's probably just a bit of fiddling to get it right!