//native
type Mollie = {
token: string;
};
/**
* Get current profile
* Retrieve the currently authenticated profile. A convenient alias of the [Get profile](get-profile) endpoint.
For a complete reference of the profile object, refer to the [Get profile](get-profile) endpoint documentation.
> 🔑 Access with
>
> API key
*/
export async function main(auth: Mollie) {
const url = new URL(`https://api.mollie.com/v2/profiles/me`);
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.text();
}
Submitted by hugo697 428 days ago