Auth0 Home Blog Docs

typescript definition updated and wrong ?



I’m using custom UI and to login via a social provider I used to use the code below

  connection: 'google-oauth2',

However now when compiling, typescript is throwing errors. The interface for AuthorizeOptions is now like so:

authorize(options: AuthorizeOptions): void;
interface AuthorizeOptions {
    domain?: string;
    clientID?: string;
    redirectUri: string;
    responseType: string;
    responseMode?: string;
    state?: string;
    nonce?: string;
    scope?: string;
    audience?: string;

Seems like that was added 9 days ago. So I don’t know if it’s an error but it would be nice to have the doc inline with the typescript definition.
So how we tell auth0 we want to authorize via google ? are the @types/ out of date ?


What version of Auth0.js are you using? You are passing statewithout a value. If you don’t need a state value, you can try:

   connection: 'google-oauth2'

Otherwise pass in a valid state parameter:

   connection: 'google-oauth2',


There is a snippet in my question explaining why this won’t compile in typescript. I believe the type definitions are outdated. For the version I’m using ^8.6. For the state variable it’s defined above, sorry for not being clear. I now edited my question so it’s clearer…


Can you clarify the specific error that is thrown? It seems like the PR you referenced failed to include the connection parameter in the AuthorizeOptions. I suggest raising an issue in that repo, or submitting a PR for the required change.