telemetry.init("YOUR_API_KEY"); // Replace with your actual API key
Log Some Data
Telemetry automatically creates tables when data is logged. In the following example, we log some Uber ride data to a table called uber_rides. Telemetry will automatically create this table and its corresponding schema with columns: city, price, and timestamp.
You can query the data using SQL through the query API.
constquery=` SELECT city, AVG(price) AS average_price FROM uber_rides GROUP BY city`;asyncfunctionqueryData() {try {constqueryResponse=awaittelemetry.query(query);console.log("Query response:", queryResponse); } catch (error) {console.error("Error querying data:", error); }}queryData();