//native
type Vercel = {
token: string;
};
/**
* Get Member Information
* Returns the member role and other information for a given member ID ("user_id" claim in the SSO OIDC token).
*/
export async function main(
auth: Vercel,
integrationConfigurationId: string,
memberId: string,
) {
const url = new URL(
`https://api.vercel.com/v1/installations/${integrationConfigurationId}/member/${memberId}`,
);
const response = await fetch(url, {
method: "GET",
headers: {
Authorization: "Bearer " + auth.token,
},
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