Auth0 by Okta Integration with Javascript functions

Excited about Auth0 integration as shown at

however the function code is written in typescript and was wondering if you have an example written in javascript. i have over 10 projects with functions in javascript
looking for path to quickly implement feature

specifically the example uses import statements that i haven’t been able to get working in javascript

import { Handler } from "@netlify/functions";
import { wrap } from "@netlify/integrations";
import { withPlanetscale } from "@netlify/planetscale";
import { withAuth0 } from "@netlify/auth0";

@Ade Those import statements are JavaScript.

See:

See also:

https://nodejs.org/api/packages.html#modules-loaders

A package.json "type" value of "module" tells Node.js to interpret .js files within that package as using ES module syntax.

1 Like

@nathanmartin i should have clarified
i am using another packages the breaks when set the type to module
I get the following error

✘ [ERROR] Could not resolve "superagent-proxy"

    node_modules/rest-facade/src/Client.js:38:12:
      38 │     require('superagent-proxy')(request);

guess the question was can i import these libraries without changing the type

issues appears to be linked in https://www.npmjs.com/package/auth0 library that depends on rest-facade

this issue provided a solution seems to handle the error.
https://github.com/yarbsemaj/sveltekit-adapter-lambda/issues/23