Diving
Dive logs, certifications, equipment, images and privacy settings.
Every method below hangs off a Garmin instance. See Installation & setup for how to construct one:
import { GarminClient, Garmin, FileTokenStore } from "garminconnect-js";
const client = new GarminClient({ tokenStore: new FileTokenStore("./tokens") });
if (!(await client.loadTokens())) throw new Error("not connected to Garmin");
const garmin = new Garmin(client);
10 methods. The verification column says what has been
confirmed against a live Garmin account, not merely unit-tested.
AGENTS.md carries the full evidence per method.
| Method | Verified |
|---|---|
getCurrentMaxDiveNumber | live-verified |
getDiveGear | live-verified |
getDiveGearSummaries | live-verified |
getDiveLog | live-verified |
getDiveLogByConnectActivityId | live-verified |
getDiveLogs | live-verified |
getDiverCertification | live-verified |
getDiverCertifications | live-verified |
getDiverPrivacy | live-verified |
getDiveTags | live-verified |
getCurrentMaxDiveNumber
garmin.getCurrentMaxDiveNumber(): Promise<number | null>
const result = await garmin.getCurrentMaxDiveNumber();
Returns
number
reads, does not reserve the next number
Verification: live-verified
getDiveGear
garmin.getDiveGear(gearId: string | number, currentUserDate: string): Promise<DiveGear | null>
const result = await garmin.getDiveGear(activityId, "currentUserDate");
Returns
DiveGear:
| Field | Type | Always present |
|---|---|---|
desc | `string | null` |
brand | `string | null` |
model | `string | null` |
gearField | { | no |
type | DiveGearType | yes |
fields | `DiveObject | DiverCertificationFields` |
notes | `string | null` |
media | `DiveMedia | null` |
Plus every field of DiveGearSummary.
explicit local YYYY-MM-DD date
Verification: live-verified
getDiveGearSummaries
garmin.getDiveGearSummaries(filters?: DiveGearFilters): Promise<DiveGearSummary[] | null>
const result = await garmin.getDiveGearSummaries();
Returns
An array of DiveGearSummary:
| Field | Type | Always present |
|---|---|---|
gearId | number | yes |
name | `string | null` |
type | `DiveGearType | null` |
status | `string | null` |
creationTs | `string | null` |
serialNumber | `string | null` |
stats | (DiveObject & { | no |
numAssociatedDives | `number | null` |
totalAssociatedDiveTime | `number | null` |
Plus every other field Garmin sends: this type carries an index signature because the real response is wider than the fields above, which are the ones this library relies on or has observed. Read an actual response before depending on a field that is not listed.
numeric Dive gear, unrelated to Connect gear UUIDs
Verification: live-verified
getDiveLog
garmin.getDiveLog(diveActivityId: string | number): Promise<DiveLog | null>
const result = await garmin.getDiveLog(activityId);
Returns
DiveLog:
| Field | Type | Always present |
|---|---|---|
playerId | `number | null` |
profile | (DiveObject & { | no |
maxDepth | `number | null` |
averageDepth | `number | null` |
surfaceInterval | `number | null` |
bottomTime | `number | null` |
location | `DiveObject | null` |
equipment | `DiveObject | null` |
environment | (DiveObject & { | no |
maxTemperature | `number | null` |
minTemperature | `number | null` |
avgTemperature | `number | null` |
waterType | `string | null` |
waterDensity | `number | null` |
media | `DiveMedia | null` |
gears | `DiveGearSummary[] | null` |
notes | `string | null` |
privateNotes | `string | null` |
Plus every field of DiveLogSummary.
full detail by Dive ID; depth and bottom-time measurements are under profile
Verification: live-verified
getDiveLogByConnectActivityId
garmin.getDiveLogByConnectActivityId(connectActivityId: string | number): Promise<DiveLog | null>
const result = await garmin.getDiveLogByConnectActivityId(activityId);
Returns
DiveLog:
| Field | Type | Always present |
|---|---|---|
playerId | `number | null` |
profile | (DiveObject & { | no |
maxDepth | `number | null` |
averageDepth | `number | null` |
surfaceInterval | `number | null` |
bottomTime | `number | null` |
location | `DiveObject | null` |
equipment | `DiveObject | null` |
environment | (DiveObject & { | no |
maxTemperature | `number | null` |
minTemperature | `number | null` |
avgTemperature | `number | null` |
waterType | `string | null` |
waterDensity | `number | null` |
media | `DiveMedia | null` |
gears | `DiveGearSummary[] | null` |
notes | `string | null` |
privateNotes | `string | null` |
Plus every field of DiveLogSummary.
explicit ID bridge
Verification: live-verified
getDiveLogs
garmin.getDiveLogs(filters?: DiveLogFilters): Promise<DiveLogPage | null>
const result = await garmin.getDiveLogs();
Returns
DiveLogPage:
| Field | Type | Always present |
|---|---|---|
totalCount | number | yes |
pageSize | number | no |
pageNumber | number | no |
diveActivities | DiveLogSummary[] | no |
Plus every other field Garmin sends: this type carries an index signature because the real response is wider than the fields above, which are the ones this library relies on or has observed. Read an actual response before depending on a field that is not listed.
one page: {totalCount, diveActivities?}, with optional pageSize/pageNumber; an empty account returns only {totalCount: 0}, with or without paging params. Use page?.diveActivities?.[0]; no library-selected paging defaults
Verification: live-verified
getDiverCertification
garmin.getDiverCertification(gearId: string | number, currentUserDate: string): Promise<DiveGear | null>
const result = await garmin.getDiverCertification(activityId, "currentUserDate");
Returns
DiveGear:
| Field | Type | Always present |
|---|---|---|
desc | `string | null` |
brand | `string | null` |
model | `string | null` |
gearField | { | no |
type | DiveGearType | yes |
fields | `DiveObject | DiverCertificationFields` |
notes | `string | null` |
media | `DiveMedia | null` |
Plus every field of DiveGearSummary.
checks CERTIFICATION type; explicit local YYYY-MM-DD date
Verification: live-verified
getDiverCertifications
garmin.getDiverCertifications(): Promise<DiveGear[] | null>
const result = await garmin.getDiverCertifications();
Returns
An array of DiveGear:
| Field | Type | Always present |
|---|---|---|
desc | `string | null` |
brand | `string | null` |
model | `string | null` |
gearField | { | no |
type | DiveGearType | yes |
fields | `DiveObject | DiverCertificationFields` |
notes | `string | null` |
media | `DiveMedia | null` |
Plus every field of DiveGearSummary.
Gear wrappers, not bare cards
Verification: live-verified
getDiverPrivacy
garmin.getDiverPrivacy(): Promise<DiverPrivacy | null>
const result = await garmin.getDiverPrivacy();
Returns
DiverPrivacy:
| Field | Type | Always present |
|---|---|---|
profile | { | yes |
badgeVisibility | DiveVisibility | yes |
showBottomTime | boolean | yes |
showDiveNumber | boolean | yes |
visibility | DiveVisibility | yes |
activity | { | yes |
advFieldsVisibility | DiveVisibility | yes |
locationVisibility | DiveVisibility | yes |
visibility | DiveVisibility | yes |
profile and default activity settings
Verification: live-verified
getDiveTags
garmin.getDiveTags(): Promise<Record<string, number> | null>
const result = await garmin.getDiveTags();
Returns
Record<string, number>
tag key to number map
Verification: live-verified