@@ -544,18 +544,21 @@ query hasAnyDefaultEventTrackingSourceAndEvents($appId: ID!) {
544544 *
545545 * The query lives in Thunder (the main Amplitude app GraphQL server), served
546546 * at /graphql/org/:orgId. orgId is required to construct the endpoint URL.
547+ *
548+ * @param token - access_token used for the Thunder (Hydra-validated) path.
549+ * @param dataApiToken - raw id_token for the data API fallback when orgId is absent.
547550 */
548551export async function fetchProjectActivationStatus (
549552 token : string ,
550553 zone : AmplitudeZone ,
551554 appId : number | string ,
552555 orgId ?: string | null ,
556+ dataApiToken ?: string ,
553557) : Promise < ProjectActivationStatus > {
554558 const { dataApiUrl } = AMPLITUDE_ZONE_SETTINGS [ zone ] ;
555559 // Use the Thunder org-scoped endpoint when orgId is available; fall back to
556560 // the data API (which may not expose this field for all users).
557- // Thunder validates access_tokens via Hydra; data API accepts id_tokens.
558- // Callers should pass the access_token — it works for both paths.
561+ // Thunder validates access_tokens via Hydra; data API accepts raw id_tokens.
559562 const isThunder = ! ! orgId ;
560563 const url = isThunder ? thunderUrl ( zone , orgId ) : dataApiUrl ;
561564 try {
@@ -564,7 +567,7 @@ export async function fetchProjectActivationStatus(
564567 { query : ACTIVATION_STATUS_QUERY , variables : { appId : String ( appId ) } } ,
565568 {
566569 headers : {
567- Authorization : isThunder ? `Bearer ${ token } ` : token ,
570+ Authorization : isThunder ? `Bearer ${ token } ` : dataApiToken ?? token ,
568571 'Content-Type' : 'application/json' ,
569572 'User-Agent' : WIZARD_USER_AGENT ,
570573 } ,
0 commit comments