Is there also a typescript version from this library?
Because using this project in a Angular 4 typescript project is done with import * as auth0 from 'auth0-js'; which doesn't give any type/syntax checking.
Installing the most recent @types (npm i --save-dev @types/auth0-js) makes it incompatible with some functions like authorize.
No. Right now, there is no official typescript or flow type definition. @types/auth0-js is maintained by the community.
This is really a missed opportunity to make this library easily usable in a typescript project.
The type definition is here: https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/auth0-js/index.d.ts
The authorize method definition is here: https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/auth0-js/index.d.ts#L190
The original code is here: https://github.com/auth0/auth0.js/blob/master/src/web-auth/index.js#L444
Based on that, what error are you having? Can you fix the issue and submit a PR to the type definition file? That would be super cool.
We have a lot of other priorities now, that's why we are not committing time to this. I think the community is doing an amazing job at maintaining the definition file even including stuff that is not fully documented yet like Cross Origin Authentication
In the sample project the authorize is used without params. But the definition defines 1 param.
I will take a look if I can submit a PR.
You can submit a PR with authorize(options?: AuthorizeOptions): void;. This will make the options object optional.