Skip to content

Add Fitbit API import flow to dashboard#84

Open
wellivea1 wants to merge 3 commits intosleepdiary:mainfrom
wellivea1:codex/fitbit-api-import
Open

Add Fitbit API import flow to dashboard#84
wellivea1 wants to merge 3 commits intosleepdiary:mainfrom
wellivea1:codex/fitbit-api-import

Conversation

@wellivea1
Copy link
Copy Markdown

This was done entirely in Codex with GPT 5.4. I apologize for any mistakes. This tool is necessary for my medical care and it was no longer being actively maintained, I might as well share this as it works.

Summary

  • add a Fitbit API import dialog on the load screen
  • implement browser-side OAuth PKCE and direct sleep import
  • work around Fitbit sleep/list pagination gaps by restarting backfill queries with beforeDate
  • route OAuth callbacks through the load view and keep the loading overlay active until info is ready

Why

Google/Fitbit export-based imports can be slow or incomplete. This adds a direct Fitbit API path for the hosted dashboard, including callback handling and UI behavior that starts loading immediately after redirect.

Notes

  • this PR is intended for the hosted sleepdiary.github.io/dashboard flow
  • the parser support for Fitbit API JSON lives in the paired core PR

Testing

  • syntax-checked updated JS files locally
  • manually tested the hosted-style redirect flow in the local dashboard
  • verified that the post-auth redirect no longer requires clicking back to the load tab before import starts

@wellivea1
Copy link
Copy Markdown
Author

This depends on the paired parser update in sleepdiary/core#52.

@wellivea1
Copy link
Copy Markdown
Author

Added Google Health as an option due to the Fitbit API being deprecated this year. It has a working fallback in case you want the user to provide the Client ID.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant