Jerome-Celle / renault-api-typescript

Typescript library for Renault Rest api
MIT License
3 stars 0 forks source link

Does this SDK work? Cannot read properties of undefined (reading 'cookieValue') #2

Open dlecan opened 2 years ago

dlecan commented 2 years ago

Hello

I'm trying to use this SDK, and I quickly get this error: Cannot read properties of undefined (reading 'cookieValue')

After debugging, the error comes from here:

 76 |         tap(
      77 |           (account: IAccountLogin) =>
    > 78 |             (this.loginToken = account.sessionInfo.cookieValue)
         |                                                    ^
      79 |         )
      80 |       );
      81 |   }

at Object.next (src/gigya/gigya.ts:78:52)

No problem with the Python SDK.

Any idea?

Jerome-Celle commented 2 years ago

Hello, Nop, it's not working yet! I just stared to defined some base function, sorry to run the tests, you need en .env file with these values: apikey= apiKeyKamereon= loginID= password= accountID= vinTest= An,d an example of code:


typescript
kamereon
    .login({
      loginID: loginID,
      password: password,
    })
    .pipe(
      switchMap(() => kamereon.getPerson()),
      switchMap(() => kamereon.getVehicles()),
      switchMap(() => kamereon.getVehicle(process.env.vinTest || ''))
    )
    .subscribe({
      next: (value) => {
        console.log(value);
        done();
      },
      error: (data) => {
        console.log(data);
        done();
      },
    });```
Start with the login and inspect the data to get your account id, vehicule id, etc