Reference
Client API
Public methods exposed by WearablesClient.
Instantiate the client once with your component reference and provider credentials:
import { WearablesClient } from "@clipin/convex-wearables";
import { components } from "./_generated/api";
export const wearables = new WearablesClient(components.wearables, {
providers: {
garmin: {
clientId: process.env.GARMIN_CLIENT_ID!,
clientSecret: process.env.GARMIN_CLIENT_SECRET!,
},
},
});
| Method | Description |
|---|
getConnections(ctx, { userId }) | Get all connections for a user |
getConnection(ctx, { userId, provider }) | Get one provider connection |
getSyncStatus(ctx, { userId }) | Get sync status across providers |
disconnect(ctx, { userId, provider }) | Disconnect a provider |
| Method | Description |
|---|
getEvents(ctx, { userId, category, startDate?, endDate?, limit?, cursor? }) | Paginated events query |
getEvent(ctx, { eventId }) | Get a single event |
| Method | Description |
|---|
getTimeSeries(ctx, { userId, seriesType, startDate, endDate, limit? }) | Get time-series points |
getLatestDataPoint(ctx, { userId, seriesType }) | Get the latest value for a metric |
getAvailableSeriesTypes(ctx, { userId }) | List series types with data |
getTimeSeriesPolicyConfiguration(ctx) | Read default rules, presets, and maintenance settings |
getUserTimeSeriesPolicyPreset(ctx, { userId }) | Get the assigned preset for a user |
getEffectiveTimeSeriesPolicy(ctx, { userId, provider, seriesType }) | Resolve the effective policy for one user/provider/series combination |
replaceTimeSeriesPolicyConfiguration(ctx, { defaultRules, presets?, maintenance? }) | Replace the stored policy configuration |
setUserTimeSeriesPolicyPreset(ctx, { userId, presetKey }) | Assign or clear a preset for a user |
| Method | Description |
|---|
getDailySummaries(ctx, { userId, category, startDate, endDate }) | Get daily summary rows |
| Method | Description |
|---|
getOrCreateDataSource(ctx, { userId, provider, deviceModel?, source?, deviceType? }) | Get or create a source row |
| Method | Description |
|---|
getSyncJobs(ctx, { userId, limit? }) | Get recent sync jobs |
| Method | Description |
|---|
generateAuthUrl(ctx, { userId, provider, redirectUri }) | Build an authorization URL |
handleCallback(ctx, { provider, state, code }) | Exchange the OAuth callback code and persist the connection |
| Method | Description |
|---|
deleteAllUserData(ctx, { userId }) | Delete all component-managed data for a user |
| Method | Description |
|---|
getProviderCredentials(provider) | Read configured credentials for one provider |
getConfiguredProviders() | List configured providers |
getSdkSyncPath(config?) | Get the configured SDK push path |
getSdkSyncUrl(baseUrl, config?) | Build the full SDK push URL |
For retention and rollup behavior, see Storage Policies.