License details by getAppContext

Hi Colleagues,

Will it work to receive license details using getAppContext of “@forge/api” backend function in production? I see the field “license” in response, but it is undefined in the development environment. And if it is possible, what license details fields can I get by getAppContext on Production? Only “active” license status, or all other fields available in @forge/bridge" getContext frontend function?

interface LicenseDetails {
  active: boolean;
  billingPeriod: string;
  ccpEntitlementId: string;
  ccpEntitlementSlug: string;
  isEvaluation: boolean;
  subscriptionEndDate: string | null;
  supportEntitlementNumber: string | null;
  trialEndDate: string | null;
  type: string;
}
1 Like

Hi there,

you are right the license data are only available in PRODUCTION, whereas they are null in STAGING and DEV. The license object is provided even though you don’t have a paid app (you may log it for example).

God knows why, but the license object differs in Custom UI and UIKit. In CustomUI you’ll get the license object you’ve provided. In UIKit the object only contains a property isActive instead of active

Find more here: https://developer.atlassian.com/platform/marketplace/listing-forge-apps/#checking-the-license-status

Cheers,
paul

@Provotar,

For the problem where the license field is missing in dev env, have you already tried to follow the docs on testing your app with different license states?

@ibuchanan to be frank, I truly hope that Atlassian considers offering a more efficient approach.

Incorporating testing code into production code not only raises complexity but also heightens the risk of programming/license errors.

Moreover, adjusting the environment variable to modify the license status in the Forge backend is currently restricted to developers, leaving product owners out of the loop.

My vision entails having the license object available uniformly across all environments, with the flexibility for adjustment through the frontend interface, particularly in environments other than PRODUCTION.

Is there already a ticket for this?

1 Like

@ppasler,

Good feedback. I hope you’ll add that as comment on ECO-242 which seems to indicate the awareness of the problem. It’s always helpful to have more details so the responsible team can create better increments and prioritize improvement. All are welcome to watch, comment, and vote as signals for prioritization.

1 Like