d85785e380
App to manage telemetry/billing (twenty for twenty!)
14 lines
309 B
TypeScript
14 lines
309 B
TypeScript
export const request = async (route: string, authToken?: string) => {
|
|
const response = await fetch(
|
|
`https://api.twenty.com/rest/${route}`,
|
|
{
|
|
headers: {
|
|
Authorization: `Bearer ${process.env.TWENTY_API_KEY}`
|
|
},
|
|
}
|
|
)
|
|
|
|
const json = await response.json()
|
|
return json.data
|
|
}
|