{"record":{"id":"da2ef56617c3083d","repo":"Stirling-Tools/Stirling-PDF","slug":"supabase-is-not-configured-license-key-lookup-is","errorCode":null,"errorMessage":"Supabase is not configured. License key lookup is not available.","messagePattern":"Supabase is not configured\\. License key lookup is not available\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"frontend/editor/src/proprietary/services/licenseService.ts","lineNumber":430,"sourceCode":"  async getInstallationId(): Promise<string> {\n    try {\n      const response = await apiClient.get(\"/api/v1/admin/installation-id\");\n\n      const data: InstallationIdResponse = await response.data;\n      return data.installationId;\n    } catch (error) {\n      console.error(\"Error fetching installation ID:\", error);\n      throw error;\n    }\n  },\n\n  /**\n   * Check if license key is ready for the given installation ID\n   */\n  async checkLicenseKey(installationId: string): Promise<LicenseKeyResponse> {\n    // Check if Supabase is configured\n    if (!isSupabaseConfigured || !supabase) {\n      throw new Error(\n        \"Supabase is not configured. License key lookup is not available.\",\n      );\n    }\n\n    const { data, error } = await supabase.functions.invoke(\"get-license-key\", {\n      body: {\n        installation_id: installationId,\n      },\n    });\n\n    if (error) {\n      throw new Error(`Failed to check license key: ${error.message}`);\n    }\n\n    return data as LicenseKeyResponse;\n  },\n\n  /**","sourceCodeStart":412,"sourceCodeEnd":448,"githubUrl":"https://github.com/Stirling-Tools/Stirling-PDF/blob/9ef20dcab80b85041912f045e17a6aea1d08f969/frontend/editor/src/proprietary/services/licenseService.ts#L412-L448","documentation":"Thrown by checkLicenseKey when Supabase isn't configured. License-key lookup is performed by the Supabase edge function get-license-key (mapping an installation_id to a license), so without Supabase the lookup can't run. The guard fails fast with a message naming the unavailable capability (license key lookup).","triggerScenarios":"Calling checkLicenseKey(installationId) in a build without Supabase configured; isSupabaseConfigured false because env vars missing; activation flow run in a flavor that omits Supabase.","commonSituations":"Self-hosted deploy without Supabase env vars; dev environment without .local Supabase keys; the license-activation UI rendered when the licensing backend is unavailable.","solutions":["Gate the license-activation UI on isSupabaseConfigured.","Set VITE_SUPABASE_URL/VITE_SUPABASE_ANON_KEY in the active env layer.","Catch the error and show a 'license lookup unavailable in this mode' message."],"exampleFix":"// before\nconst res = await licenseService.checkLicenseKey(installationId);\n\n// after\nif (!isSupabaseConfigured) {\n  showToast(t('license.lookupUnavailable'));\n  return;\n}\nconst res = await licenseService.checkLicenseKey(installationId);","handlingStrategy":"validation","validationCode":"if (!isSupabaseConfigured) {\n  showToast(t('license.lookupUnavailable'));\n  return;\n}","typeGuard":"export function canLookupLicenseKey(): boolean {\n  return isSupabaseConfigured;\n}","tryCatchPattern":"try {\n  await licenseService.checkLicenseKey(installationId);\n} catch (e) {\n  if (/not configured/i.test(e instanceof Error ? e.message : \"\")) {\n    showToast(t('license.lookupUnavailable'));\n  } else throw e;\n}","preventionTips":["Gate the activation UI on isSupabaseConfigured.","Ensure getInstallationId() returns a real fingerprint before lookup.","Set Supabase env vars where activation is expected."],"tags":["supabase","license","activation","configuration","proprietary","typescript"],"backgroundTag":null,"analyzedSha":"9ef20dcab80b85041912f045e17a6aea1d08f969","analyzedAt":"2026-08-13T22:11:39.827Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}