//native
type Supabase = {
key: string
}
/**
* Claims project for the specified organization
*
*/
export async function main(auth: Supabase, slug: string, token: string) {
const url = new URL(`https://api.supabase.com/v1/organizations/${slug}/project-claim/${token}`)
const response = await fetch(url, {
method: 'POST',
headers: {
Authorization: 'Bearer ' + auth.key
},
body: undefined
})
if (!response.ok) {
const text = await response.text()
throw new Error(`${response.status} ${text}`)
}
return await response.text()
}
Submitted by hugo697 154 days ago