So, first the state argument is validated, this should match the anti-cross-site forgery request token we sent to ensure the integrity of the communication.
Then the received authorization code is used to request an access token.
Again to keep it simple, the resulting access code response is cast to dynamic, so we can access the token property without having to properly deserialize to a strongly typed object.

Well done, you now have a virtual device which can simulate real time events which we’ll consume in the next step.

Consume real-time updates

Get FirebaseSharp through nuget, to install through the Nuget Package Manager Console:

HideCopy Code

Install-Package FirebaseSharp

Once the access token is in, we initialize a Firebase client, that points to Nest API using the access token we retrieved. In this case we listen to the devices, but go ahead and consult the Nest API reference to find out your options on how granular you want to be.

Change the current temperature in the Nest Developer Chrome Extension and witness the real-time updates 🙂