Skip to main content

Overview

Baby profiles contain essential information about each baby being tracked. Each profile belongs to a family and includes personalized settings like timezone and measurement units.

Baby Profile Schema

interface BabyProfile {
  _id: Id<"babyProfiles">;
  familyId?: Id<"families">;
  name: string;
  dob: string; // YYYY-MM-DD format
  gender?: "boy" | "girl" | "other";
  timezone: string; // e.g., "America/Los_Angeles"
  measurementUnits?: {
    volume?: "ml" | "oz";
    weight?: "kg" | "lb";
    length?: "cm" | "in";
  };
  createdAt: string;
}

Get Baby Profiles

Retrieve all baby profiles accessible to the authenticated user.
import { useQuery } from "convex/react";
import { api } from "./convex/_generated/api";

const profiles = useQuery(api.events.getBabyProfiles);

// Response:
[
  {
    _id: "...",
    familyId: "...",
    name: "Emma",
    dob: "2024-01-15",
    gender: "girl",
    timezone: "America/Los_Angeles",
    measurementUnits: {
      volume: "oz",
      weight: "lb",
      length: "in"
    },
    createdAt: "2024-01-15T10:00:00Z"
  }
]

Response

profiles
array
Array of baby profile objects sorted by creation date (newest first)

Get Baby Profile

Retrieve a specific baby profile by ID, or the most recent profile if no ID is provided.
const profile = useQuery(api.events.getBabyProfile, {
  id: babyId // optional
});

Parameters

id
Id<'babyProfiles'>
Optional baby profile ID. If omitted, returns the most recently created profile accessible to the user.

Response

Returns the baby profile object or null if not found or not accessible.

Create Baby Profile

Create a new baby profile within a family.
const createBabyProfile = useMutation(api.events.createBabyProfile);

const babyId = await createBabyProfile({
  familyId,
  name: "Emma",
  dob: "2024-01-15",
  gender: "girl",
  timezone: "America/Los_Angeles",
  measurementUnits: {
    volume: "oz",
    weight: "lb",
    length: "in"
  }
});

Parameters

familyId
Id<'families'>
required
The family this baby belongs to
name
string
required
Baby’s name
dob
string
required
Date of birth in YYYY-MM-DD format
gender
string
Gender: “boy”, “girl”, or “other”
timezone
string
IANA timezone (e.g., “America/New_York”, “Europe/London”). Defaults to “Asia/Kolkata” if not provided.
measurementUnits
object
Preferred units for measurements

Response

babyId
Id<'babyProfiles'>
The newly created baby profile ID
When a baby profile is created, the family owner is automatically added as a caregiver.

Update Baby Profile

Update an existing baby profile’s information.
const updateBabyProfile = useMutation(api.events.updateBabyProfile);

await updateBabyProfile({
  id: babyId,
  name: "Emma Rose",
  timezone: "America/Chicago",
  measurementUnits: {
    volume: "ml",
    weight: "kg",
    length: "cm"
  }
});

Parameters

id
Id<'babyProfiles'>
required
The baby profile ID to update
name
string
Updated name
dob
string
Updated date of birth (YYYY-MM-DD)
gender
string
Updated gender
timezone
string
Updated timezone
measurementUnits
object
Updated measurement preferences
Only family members with owner or admin roles can update baby profiles.

Delete Baby Profile

Permanently delete a baby profile and all associated data.
const deleteBabyProfile = useMutation(api.events.deleteBabyProfile);

await deleteBabyProfile({
  id: babyId
});

Parameters

id
Id<'babyProfiles'>
required
The baby profile ID to delete
This action cannot be undone. All events, milestones, reminders, and other data associated with this profile will be permanently deleted.

Supported Timezones

Zen Nurture supports all IANA timezone identifiers. Common examples:
  • America/New_York - Eastern Time
  • America/Chicago - Central Time
  • America/Denver - Mountain Time
  • America/Los_Angeles - Pacific Time
  • America/Anchorage - Alaska Time
  • Pacific/Honolulu - Hawaii Time

Measurement Units

Volume (Feeding)

Used for milliliters. Common in most of the world.Example: 120 ml bottle

Weight

Used for kilograms. Standard in most countries.Example: 5.2 kg

Length/Height

Used for centimeters. Standard worldwide.Example: 55 cm

Best Practices

Set the timezone where the baby lives, not where you are. This ensures events are displayed in the correct local time.
Set measurement units when creating the profile. Changing units later doesn’t convert existing measurements—they remain in their original units.
The DOB is used for age calculations, milestone suggestions, and weekly digests. Ensure it’s correct.
If tracking multiple babies, use clear, consistent names to avoid confusion in the UI and reports.

Families

Manage families and member access

Events

Log activities for baby profiles

Caregivers

Assign caregivers to babies

Baby Profiles Guide

Feature guide and best practices

Build docs developers (and LLMs) love