Artificial Intelligence1 min read

Build an AI Wellbeing App with Fireworks and Fitbit via Auth0 Token Vault.

By · Published by Everything Blog

In short

The platform relies on the Google Health API v4 alongside a custom Auth0 OAuth2 setup to securely fetch resting heart-rate, activity, and sleep statistics. Auth0 Token Vault manages the server-side storage of Fitbit credentials, allowing the application to benchmark current stats against historical averages. Users can manually inspect these daily summaries before opting to stream guidance, such as bedtime routines or movement breaks, via a Fireworks AI model that intentionally excludes medical treatment advice. The technical implementation utilizes Next.js 16 and TypeScript, complemented by the Vercel AI SDK 7 for streaming and Zod for strict data validation.

Key points

  • Users maintain direct control over their metrics by choosing whether to inspect them priv…: Users maintain direct control over their metrics by choosing whether to inspect them privately or transmit them to the AI model.
  • Setting up the system demands Node.js 22 or newer alongside an Auth0 tenant capable of su…: Setting up the system demands Node.js 22 or newer alongside an Auth0 tenant capable of supporting Connected Accounts.
  • The application stack combines Next.js 16, TypeScript, the Auth0 Next.js SDK 4, Zod valid…: The application stack combines Next.js 16, TypeScript, the Auth0 Next.js SDK 4, Zod validation, and the Vercel AI SDK 7.

Sources checked by our analysis pipeline: 1

We'll build Daily Wellbeing, an app that reads your Fitbit activity and sleep data and uses Fireworks to suggest a few things to try today. You can compare the latest completed day with your recent averages and review the measurements behind the suggestions.

Fitbit exposes these readings through the Google Health API v4. Access requires Google Cloud OAuth credentials and a custom Auth0 OAuth2 connection.

Auth0 handles login, and Token Vault stores the Fitbit authorization credentials. After connecting Fitbit, you choose whether to share the summary with Fireworks. You can view your readings without running inference.

What we'll build

Sign users in with Auth0 and connect Fitbit after login.

Retrieve a Fitbit token through Token Vault on the server.

Calculate a daily report from activity, sleep, and resting heart-rate readings.

Use a Fireworks model with a tool that returns the signed-in user's summary.

Stream suggestions after the user chooses to share that summary.

Suggestions cover general wellbeing, such as comfortable movement breaks and a consistent bedtime. The model prompt excludes diagnosis and treatment recommendations.

Technology stack

We'll use Next.js 16…

Artificial Intelligence