//native
/**
* Get credits balance
* Get the number of credits remaining on your Linkup account.
*/
export async function main(auth: RT.Linkup) {
const url = new URL("https://api.linkup.so/v1/credits/balance")
const response = await fetch(url, {
method: "GET",
headers: {
Authorization: `Bearer ${auth.token}`,
Accept: "application/json",
},
})
if (!response.ok) {
throw new Error(`${response.status} ${await response.text()}`)
}
return await response.json()
}
Submitted by hugo989 3 hours ago