Skip to content

Instantly share code, notes, and snippets.

@chronark
Created March 13, 2023 18:44
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chronark/d47c66d02f7c217d0c63888bc0553de9 to your computer and use it in GitHub Desktop.
Save chronark/d47c66d02f7c217d0c63888bc0553de9 to your computer and use it in GitHub Desktop.
import {Tinybird} from "./client";
import {z} from "zod"
const tb = new Tinybird("TINYBIRD_TOKEN")
const getUsage = tb.buildPipe({
pipe: "get_usage__v1",
parameters: z.object({
teamId: z.string(),
year: z.number(),
month: z.number(),
}),
data: z.object({
teamId: z.string(),
year: z.number(),
month: z.number(),
day: z.number(),
usage: z.number(),
})
})
async function main(){
const {data} = await getUsage({
teamId: "team_1",
year: 2023,
month: 1,
})
}
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment