Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HOW to use the fitness API on NodeJS #1887

Closed
codemodify opened this issue Nov 25, 2019 · 1 comment
Closed

HOW to use the fitness API on NodeJS #1887

codemodify opened this issue Nov 25, 2019 · 1 comment
Assignees
Labels
type: question Request for information or clarification. Not an issue.

Comments

@codemodify
Copy link

codemodify commented Nov 25, 2019

The OAuth 2.0 playground is useless and never returns anything, gapi package seems from 8 years ago, google-api-nodejs-client has no documentation at all.

Is there a simple 1-2-3 steps example that shows how to query number of steps that was ever recorded ?

The scenario is:

  • user logs in with Firebase auth providers
  • get that magic tokens to and pass them to the Firebase function to read his fitness data

The next frustrating part is the fitness data sources/datasets and all that, complete nightmare, no way to understand how it is organized. Feels like a low level SQL database than an actual API

Then there are next steps:
From here: https://github.com/googleapis/google-api-nodejs-client#oauth2-client

Is this expected to be asked on the client side like a web page then the token to be send to the backend where it will be used to query the fitness data ?

dear god

@yoshi-automation yoshi-automation added the triage me I really want to be triaged. label Nov 25, 2019
@bcoe bcoe added the type: question Request for information or clarification. Not an issue. label Nov 25, 2019
@yoshi-automation yoshi-automation removed the triage me I really want to be triaged. label Nov 25, 2019
@bcoe
Copy link
Contributor

bcoe commented Nov 25, 2019

@codemodify there is not an example of the fitness API at this time, having said this, I think you should be able to potentially use some of the other samples as a starting point, in the samples folders (all of the REST APIs are interacted with in similar manner).

You will find the methods supported by the API wrapper documented here, and there will be a close corollary to the methods outlined in the REST API here.

As for authentication, you will likely be creating an OAuth 2.0 Web Server Application, you will initially send the user through an authentication flow, at which point you store a refresh token for the user, which can be used by your application to update their credentials over time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: question Request for information or clarification. Not an issue.
Projects
None yet
Development

No branches or pull requests

4 participants