type Shopify = {
token: string;
store_name: string;
};
/**
* Retrieves a list of access scopes associated to the access token.
* Retrieves a list of access scopes associated to the access token.
*/
export async function main(auth: Shopify) {
const url = new URL(
`https://${auth.store_name}.myshopify.com/admin/oauth/access_scopes.json`
);
const response = await fetch(url, {
method: "GET",
headers: {
"X-Shopify-Access-Token": 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 396 days ago
type Shopify = {
token: string;
store_name: string;
};
/**
* Retrieves a list of access scopes associated to the access token.
* Retrieves a list of access scopes associated to the access token.
*/
export async function main(auth: Shopify) {
const url = new URL(
`https://${auth.store_name}.myshopify.com/admin/oauth/access_scopes.json`
);
const response = await fetch(url, {
method: "GET",
headers: {
"X-Shopify-Access-Token": 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 942 days ago