Get Usage Store

Get Usage Store

import { getUsageStoreDetails } from "usage-api";
 
const res = getUsageStoreDetails(process.env.USAGE_API_KEY, {
    usageStoreId: "my-usage-store-id" // required
});
 
type res = {
    success: true,
    usageStoreDetails: {
        keys: {
            [apiKeyId: string]: {
                keyName: string
            }
        }
        rateLimits?: {
            [rateLimitId: string]: {
                limit: number,
                timeWindowSeconds: number
            }
        }[]
        blocked?: boolean
    }
} | {
    success: false,
    message: string
}