apple-weatherkit
TypeScript icon, indicating that this package has built-in type declarations

0.0.1 • Public • Published

Apple WeatherKit

Getting Started

npm i apple-weatherkit

Read Apple's documentation to get the requisite information.

import { createJTW, getAvailability, getForecast } from "apple-weatherkit";

const token = createJTW({
  teamId: "XXXXXXXXXX",
  serviceId: "com.example.weather",
  keyId: "YYYYYYYYYY",
  privateKey: process.env.APPLE_WEATHERKIT_KEY,
  expireAfter: 60 * 60, // 1hour
});

const lat = 38.638;
const lng = -121.259;

getAvailability({ lat, lng, token }).then((result) =>
  console.log("Availability", result)
);

getForecast({ lat, lng, token }).then((result) =>
  console.log("Forecast", result)
);

Readme

Keywords

none

Package Sidebar

Install

npm i apple-weatherkit

Weekly Downloads

0

Version

0.0.1

License

MIT

Unpacked Size

9.84 kB

Total Files

5

Last publish

Collaborators

  • ccorcos