Search code examples
javascriptreact-nativeconnectycube

Invalid Object Syntax in API Documentation


I am following the ConnectyCube API documentation and it tells me to format an object like this when using Firebase credentials:

 const userCredentials = {
                      provider: 'firebase_phone',
                      firebase_phone[project_id]: projectId,
                      firebase_phone[access_token]: idToken,
                    };

Of course the app won't compile because you can't use square brackets like this, it throws a linting error.

I have tried getting rid of it but it doesn't work, what are they trying to tell me to do?


Solution

  • Fixed - must be written like this:

    provider: 'firebase_phone',
                          'firebase_phone[project_id]': "xxxxxxxxxx",
                          'firebase_phone[access_token]': idToken,