//native
type Vercel = {
token: string;
};
/**
* Delete an existing experimentation item
* Delete an existing experimentation item
*/
export async function main(
auth: Vercel,
integrationConfigurationId: string,
resourceId: string,
itemId: string,
) {
const url = new URL(
`https://api.vercel.com/v1/installations/${integrationConfigurationId}/resources/${resourceId}/experimentation/items/${itemId}`,
);
const response = await fetch(url, {
method: "DELETE",
headers: {
Authorization: "Bearer " + auth.token,
},
body: undefined,
});
if (!response.ok) {
const text = await response.text();
throw new Error(`${response.status} ${text}`);
}
return await response.text();
}
Submitted by hugo697 428 days ago