{"id":18765720,"url":"https://github.com/cobertos/sleebies","last_synced_at":"2025-12-08T00:30:12.465Z","repository":{"id":95200450,"uuid":"327133526","full_name":"Cobertos/sleebies","owner":"Cobertos","description":"Sleep status for fitbit","archived":false,"fork":false,"pushed_at":"2021-01-07T15:14:55.000Z","size":32,"stargazers_count":2,"open_issues_count":7,"forks_count":1,"subscribers_count":2,"default_branch":"owo","last_synced_at":"2025-02-15T20:51:00.876Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"sleebies.cobertos.vercel.app","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Cobertos.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-01-05T22:18:17.000Z","updated_at":"2021-05-25T16:04:20.000Z","dependencies_parsed_at":"2023-06-12T11:45:57.269Z","dependency_job_id":null,"html_url":"https://github.com/Cobertos/sleebies","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cobertos%2Fsleebies","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cobertos%2Fsleebies/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cobertos%2Fsleebies/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cobertos%2Fsleebies/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Cobertos","download_url":"https://codeload.github.com/Cobertos/sleebies/tar.gz/refs/heads/owo","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239665133,"owners_count":19676875,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-07T18:35:01.730Z","updated_at":"2025-12-08T00:30:12.397Z","avatar_url":"https://github.com/Cobertos.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Sleebies\n\n![Sleep/Awake](https://sleebies.vercel.app/api/95QFMH)\n\nA badge showing 'sleep' or 'awake' based on your FitBit data. An experiment with the FitBit API and Vercel.\n\nAdapted from [datejer/vercel-badge](https://github.com/datejer/vercel-badge)\n\n## Usage\n\n```\n![Sleep/Awake](https://sleebies.vercel.app/api/[userid])\n```\n\nReplace `[userid]` with the FitBit OAuth 2.0 user id retrieved from the OAuth endpoint (see below)\n\n(optional) Add the `?style=` parameter to change the visual badge style.\n\n| Parameter | Types                                                                           | Description                             | Example                                                                       |\n| --------- | ------------------------------------------------------------------------------- | --------------------------------------- | ----------------------------------------------------------------------------- |\n| style     | Default: `flat`\u003cbr\u003eAvailable: `flat`, `flat-square`, `for-the-badge`, `plastic` | Select the visual style for your badge. | `https://sleebies.vercel.app/api/95QFMH?style=for-the-badge` |\n\n## Deploying\n\nYou must deploy your own version to use this. I cannot make this work for other people without requesting a much stronger license from FitBit.\n\n#### Getting FitBit tokens\n\n* Sign up for an account at [https://dev.fitbit.com/login](https://dev.fitbit.com/login)\n* Accept the Terms of Service for FitBit.\n* Register a new application, making sure it has the following settings\n  * OAuth 2.0 Application Type `Personal` (we need Heartbeat Intraday data which can only be requested with `Personal` on your own user id)\n  * Callback URL `https://[your-vercel-deploy].vercel.app/api/oauth-callback` (where [your-vercel-deploy] is the name of your Vercel deployment\n  * Default Access Type `Read \u0026 Write` (we need to write to make a fake sleep log to pull real time sleep data)\n![settings from vercel](media/fitbit_app_settings.png)\n* You will then have FitBit `OAuth 2.0 Client ID` and `Client Secret`\n\n#### Setting up Vercel\n\n* Deploy this project to Vercel\n\n[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/git/external?repository-url=https%3A%2F%2Fgithub.com%2FCobertos%2Ffitbit-sleebies%2Ftree%2Fmaster)\n\n* Set the `FITBIT_CLIENT_ID` environment variable to the `OAuth 2.0 Client ID` from the FitBit tokens\n* Navigate to ![https://[your-vercel-deploy].vercel.app/api/oauth](https://[your-vercel-deploy].vercel.app/api/oauth) where [your-vercel-deploy] is the name of your Vercel deployment\n* Authorize your application\n* Grab the `FITBIT_USER_ID` and `FITBIT_USER_TOKEN` after the authorization\n  * The token expires in 1 year\n  * The token uses 3 scopes. `sleep` for sleep data, `heartrate` for intraday heartrate data, and `profile` for timezone information\n* Set these in Vercel\n\nNow you're ready to use. See **Usage** above to use :3\n\n#### TODO\n\n* You might want to change the `sleepingHeartRate` variable in `fitbit-sleebies/api/[userid].js` to your sleeping heart rate BPM. Sleeping people generally have a sleeping heartrate up to 24 BPM lower than their normal resting heartrate. I used \\~8 BPM less as a threshold. In the future, this will either compare to average heartrate or it will be passed in.\n\n## Contributing\n\nPlease refer to [CONTRIBUTING.md](CONTRIBUTING.md)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcobertos%2Fsleebies","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcobertos%2Fsleebies","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcobertos%2Fsleebies/lists"}