#
App Integration Guide
This document maps every screen in the app to the sTvOS backend API endpoints it should call. Use it as a reference when building or migrating an app on the platform.
#
Conventions
Headers required on every client-scoped request:
Response envelope: All responses return { success: true, data: ... } on success and { error, code, details } on failure.
Feature gating: The enabledFeatures array from /auth/me or /app/config determines which sections of the app to show. Check with features.includes('feature_key').
#
1. Auth and Onboarding
#
Login
#
Register
#
ForgotPass
#
VoucherEntry
#
JoinScreen
#
ProfileSetup (Onboarding Wizard)
#
2. Profile and Settings
#
Profile
#
ManageProfile
#
Settings
#
Terms (Privacy Policy)
#
About
#
3. Workout System
#
Home
#
Workouts
#
WorkoutDetails
#
WorkoutLoading
#
MyWorkouts (Progress Dashboard)
#
SingleDay
#
Timer (Active Workout)
#
Completed
#
SearchWorkout
#
WorkoutsFav
#
Player (Video)
#
4. Exercises
#
Exercises
#
ExerciseDetails
#
SingleMuscle
#
SingleEquipment
#
Equipments
#
5. Classes
#
Classes
#
ClassDetails
#
ClassPlayer
#
CategoryClasses
#
Categories
#
Coaches
#
CoachDetails
#
6. Nutrition / Diets
#
Diets
#
DietDetails
#
DietsFav
#
CustomDiets
#
SingleCategory (Diets)
#
7. Blog / Posts
#
Blog
#
Posts
#
PostDetails
#
SingleTag
#
8. Store / Products
Products are affiliate items that partners create via the partner portal. Each product belongs to a single client and has a name, description, image, price, and an external buy link.
#
Store
#
Products
#
ProductDetails
#
SingleType
#
9. Lookup / Filters
#
Goals
#
Levels
#
SingleGoal
#
SingleLevel
#
10. Favorites
#
Favorites (Tab)
#
Missing Features (Backend Work Needed)
The following features are referenced by app screens but do not yet have backend endpoints:
#
1. Forgot Password
#
2. Profile Photo Upload
#
3. Store / Products -- IMPLEMENTED
Products are now available via /products endpoints (API key required) and managed by partners through GET/POST/PUT/DELETE /partner/products in the partner portal.
#
API Call Quick Reference
A flat reference of every backend call used across all screens:
#
Public (no auth)
#
API Key Only
#
Bearer Token Required
#
Notes on /content/* vs /classes/*
The backend exposes two route groups that serve similar content:
Both return client-scoped content. Use /content/* when the user is logged in (richer features like "continue watching"). Use /classes/* for simpler listing when bearer token is unavailable.
#
ImageKit URL Transformations
ImageKit provides real-time image transformations via URL parameters. The mobile app uses these to request properly sized and cropped images from the CDN, avoiding layout issues like cropped heads or poorly framed thumbnails.
#
URL Format
ImageKit URLs follow this pattern:
https://ik.imagekit.io/{imagekit_id}/path/to/image.jpg
Transformations are inserted as a path segment using tr: notation:
https://ik.imagekit.io/{imagekit_id}/tr:{transforms}/path/to/image.jpg
The image is transformed on-the-fly by ImageKit's CDN and cached automatically.
#
Transformation Parameters
Multiple parameters are comma-separated: tr:w-320,h-400,fo-face
#
Common Presets
Person-centric images where you want to preserve the trainer's face:
Original: https://ik.imagekit.io/fitgram/fytos/classes/image.jpg
Thumbnail: https://ik.imagekit.io/fitgram/tr:w-320,h-400,fo-face/fytos/classes/image.jpg
Large feature images where the subject may not be a person:
https://ik.imagekit.io/fitgram/tr:w-800,h-400,fo-auto/fytos/classes/image.jpg
Small circular avatars:
https://ik.imagekit.io/fitgram/tr:w-80,h-80,fo-face/fytos/trainers/image.png
Category thumbnails where the subject varies:
https://ik.imagekit.io/fitgram/tr:w-280,h-200,fo-auto/fytos/classes/image.jpg
#
Client-Side Usage
The app has a utility at src/utils/imagekit.js that appends transforms to ImageKit URLs automatically:
import { ikThumbnail, ikHero, ikAvatar } from '../utils/imagekit';
// Face-focused thumbnail (320x400, fo-face)
<Image source={{ ERROR }} />
// Hero banner (800x400, fo-auto)
<Image source={{ ERROR }} />
// Small avatar (80x80, fo-face)
<Image source={{ ERROR }} />
// Custom transform
import { ikImage } from '../utils/imagekit';
<Image source={{ ERROR }} />
Safe on any URL
Non-ImageKit URLs pass through unchanged, so it is safe to use these helpers on any image URL.
#
Backend Considerations
Client responsibility
The backend stores and returns original ImageKit URLs without transforms. The client is responsible for appending the transform parameters appropriate for each UI context.
- If the backend needs to generate pre-transformed URLs (e.g. for push notifications or emails), use the same
tr:path segment format described above. - ImageKit caches transformed images at the CDN edge. First request transforms on-the-fly; subsequent requests are served from cache.
- There is no additional cost per unique transformation, but storage of cached variants counts toward the ImageKit plan.