Getting the following error: Error: please provide...
# support-questions-legacy
s
Getting the following error: Error: please provide exactly one client config or pass clientType or tenantId I am using the latest versions of
supertokens-node supertokens-auth-react supertokens-web-js
. I am trying to add a custom provider. Is clientType for react required? If I provide the clientType I am getting an error that the config for this client type is missing.
r
hey @simon7000
whats the providers array on the backend?
s
Copy code
providers: [
            {
              config: {
                thirdPartyId: 'twitter',
                name: 'Twitter',
                authorizationEndpoint: 'https://twitter.com/i/oauth2/authorize',
                tokenEndpoint: 'https://api.twitter.com/2/oauth2/token',
                tokenEndpointBodyParams: {
                  grant_type: 'client_credentials',
                },
                userInfoEndpoint:
                  'https://api.twitter.com/2/users/me?user.fields=profile_image_url,url',
                clients: [
                  {
                    clientId: 'xxx',
                    clientSecret:
                      'xxx',
                  },
                ],
              },
            },
          ],
I also tried to add
clientType: 'web-and-android'
to this config as well as the frontendConfig but then it's asking for a configuration file
r
huh.. this should not require a clientType at all
the only time it's required if is the length of
clients
array is more than 1
s
thats all I have using the react lib
r
so just to confirm, you only have twitter login and only one item in the clients array in your backend?
s
Copy code
export const backendConfig = (): TypeInput => {
  return {
    framework: 'express',
    supertokens: {
      // https://try.supertokens.com is for demo purposes. Replace this with the address of your core instance (sign up on supertokens.com), or self host a core.
      connectionURI:
        'xxx',
      apiKey: 'xxx',
    },
    appInfo,
    recipeList: [
      ThirdPartyNode.init({
        signInAndUpFeature: {
          // We have provided you with development keys which you can use for testing.
          // IMPORTANT: Please replace them with your own OAuth keys for production use.
          providers: [
            {
              config: {
                thirdPartyId: 'twitter',
                name: 'Twitter',
                authorizationEndpoint: 'https://twitter.com/i/oauth2/authorize',
                tokenEndpoint: 'https://api.twitter.com/2/oauth2/token',
                tokenEndpointBodyParams: {
                  grant_type: 'client_credentials',
                },
                userInfoEndpoint:
                  'https://api.twitter.com/2/users/me?user.fields=profile_image_url,url',
                clients: [
                  {
                    clientId: 'xxx',
                    clientSecret:
                      'xxx',
                  },
                ],
              },
            },
          ],
        },
      }),
      SessionNode.init(),
    ],
    isInServerlessEnv: true,
  }
}
thats the full config file
oh damn, I restarted the dev server and now it works :/
guess changes weren't picked up for some reason
r
oh haha.. may have been some other version of the code running
s
sorry to bother and thanks, solved for now
9 Views