ambitious-gigabyte-21534
08/02/2023, 12:10 PMadapter is not a function
. Which seems to be related to the fact that the middleware is executed in a edge runtime, but @ory/client
uses axios
which cannot be run in an edge runtime.
Here is my current code:
const ory = new FrontendApi(new Configuration(edgeConfig));
const res = await ory.toSession(
{
cookie: cookie,
},
{
baseURL: process.env.BASE_URL,
}
);
How would I go about replacing this code with something like fetch
? Hope i'm making sense. Thanks!limited-photographer-61008
08/02/2023, 12:16 PMmagnificent-energy-493
ambitious-gigabyte-21534
08/02/2023, 1:46 PM@haverstack/axios-fetch-adapter
seems to be working correctly.
Thanks guys!ambitious-gigabyte-21534
08/02/2023, 1:49 PMaxios
instead of just fetch
? I'm guessing because axios offers the adapter functionality... @magnificent-energy-493magnificent-energy-493
fetch
with the API directly right?
I used it in some projects. depending on what you want to do I think its feasible.
But I am not sure why it was axios, its a very historic decision - I am sure there is some history on github, but I could not find anything concrete in a quick search.limited-photographer-61008
08/02/2023, 2:00 PMmagnificent-energy-493