UNPKG

@unkey/api

Version:

Developer-friendly & type-safe Typescript SDK specifically catered to leverage *@unkey/api* API.

30 lines (23 loc) 681 B
/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import dotenv from "dotenv"; dotenv.config(); /** * Example usage of the @unkey/api SDK * * To run this example from the examples directory: * npm run build && npx tsx analyticsGetVerifications.example.ts */ import { Unkey } from "@unkey/api"; const unkey = new Unkey({ rootKey: process.env["UNKEY_ROOT_KEY"] ?? "", }); async function main() { const result = await unkey.analytics.getVerifications({ query: "SELECT COUNT(*) as total FROM key_verifications_v1 WHERE outcome = 'VALID' AND time >= now() - INTERVAL 7 DAY", }); console.log(result); } main().catch(console.error);