How to use Netlify Identity with Edge Functions (SvelteKit)

Hi

I was wondering if it would be possible to use Netlify identity alongside of deploying an edge function with a catch-all pattern matching. I’m using SvelteKit with the netlify adapter that generates this manifest for the edge function.

// manifest.json
{
	"functions": [
		{
			"function": "render",
			"pattern": "^/.*$"
		}
	],
	"version": 1
}

Issue is that this also catches Netlify’s internal endpoints such as /.netlify/identity. Would there be a way to work around this? My understanding is that lookarounds are not supported in the pattern. I use netlify identity widget, which does have an optional APIUrl that I could change to something else, not sure to what exactly.

Many thanks!

Hi @Adam_Jakab,

I believe a temporary workaround would be to separate the use Identity on a different site and use that as the APIUrl.

However, if SvelteKit is not calling next() or something else inside the Edge Function that would allow Netlify to take over the remaining routing to let Netlify Handle the rest of the routing (in your case, routing of /.netlify/identity), I’d assume this is a bug with SvelteKit.