//native
type Clerk = {
apiKey: string;
};
/**
* Delete a satellite domain
* Deletes a satellite domain for the instance.
It is currently not possible to delete the instance's primary domain.
*/
export async function main(auth: Clerk, domain_id: string) {
const url = new URL(`https://api.clerk.com/v1/domains/${domain_id}`);
const response = await fetch(url, {
method: "DELETE",
headers: {
Authorization: "Bearer " + auth.apiKey,
},
body: undefined,
});
if (!response.ok) {
const text = await response.text();
throw new Error(`${response.status} ${text}`);
}
return await response.json();
}
Submitted by hugo697 428 days ago