Skip to content
← Public packages

@kody/local-conditions

Quick onboarding example: weather and AQI for a city via Open-Meteo (zero OAuth).

src/get-local-conditions.ts

19 lines · 840 B · TypeScript
import { getLocalConditions, type LocalConditionsInput } from './index.ts'

/**
 * Geocode a place and return current weather, AQI, and sun times from Open-Meteo.
 * Use when you need the structured conditions object (not email).
 *
 * @param input.place - Free-form city or place name to geocode.
 * @returns Current weather, optional US AQI, and sunrise/sunset for the resolved place.
 *
 * @example
 * import getLocalConditions from 'kody:@kody/local-conditions/getLocalConditions'
 * const conditions = await getLocalConditions({ place: 'Salt Lake City' })
 * // => { place: 'Salt Lake City, Utah, United States', current: { temperatureC: …, weatherLabel: '…' }, … }
 */
export default async function getLocalConditionsExport(input: LocalConditionsInput) {
	return await getLocalConditions(input)
}

export { getLocalConditions }