Checks whether an access token is allowed to publish.
Meta exposes no scope-listing endpoint for Instagram Login tokens, so this probes
the publishing quota — a read-only endpoint that needs exactly the same
instagram_business_content_publish scope publishing does. Nothing is posted.
Worth calling before createInstagramPost in a scheduled job: a token whose
access was revoked fails here with a clear reason, instead of surfacing later as a
container error.
Rejects — rather than answering false — if the request itself fails, so a network
blip is never reported as a missing permission.
Parameters
token: string
Instagram access token.
Returns Promise<boolean>
Promise of true if the token can publish. On false, the API's reason is logged.
if (!(awaitcanPublishToInstagram(process.env.INSTAGRAM_ACCESS_TOKEN!))) { thrownewError("Instagram token cannot publish — reconnect with the publish scope"); }
Checks whether an access token is allowed to publish.
Meta exposes no scope-listing endpoint for Instagram Login tokens, so this probes the publishing quota — a read-only endpoint that needs exactly the same
instagram_business_content_publishscope publishing does. Nothing is posted.Worth calling before
createInstagramPostin a scheduled job: a token whose access was revoked fails here with a clear reason, instead of surfacing later as a container error.Rejects — rather than answering
false— if the request itself fails, so a network blip is never reported as a missing permission.