Feature licenses and using our new entitlements system #5
ezekg
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
We recently rolled out a new entitlements system, making feature licenses even easier to implement. In the past, you'd need to add key-value pairs to a license's
metadata
, which can become error prone and also be a headache when launching a new feature flag that needs to be added or backfilled to a large subset of licenses.What we've done is add a new entitlement object, which can be attached to policies and licenses.
An entitlement object looks like this:
The most important part of an entitlement is it's
code
attribute. These codes can be utilized within your software application to check if a license is entitled to do something. For example, you could have an entitlement with codePRO_FEATURES
, then within your software you could do something like this:Entitlements can be attached to policies and also to licenses. When an entitlement is attached to a policy, all licenses that 'implement' that particular policy will automatically inherit the policy's entitlements. You can attach one-off entitlements to licenses directly.
For entitlements that are "table-stakes", i.e. required entitlements, you can include those entitlement codes inside of a validation request using the new
entitlements
scope:Entitlements can also be used with Keygen Dist to manage things such as version entitlements. For example, when you go from v1 to a v2 release of your software, you may not want to let users that didn't upgrade their license to download and use v2 until they purchase an updated license. In this scenario, you would create a
APP_V1
entitlement and anAPP_V2
entitlement. Then, within your auto-updater code, you'd want to add the entitlement assertion to the update URL:https://dist.keygen.sh/v1/demo/update/macos/zip/v2.0.0?entitlement=APP_V2
We're excited to see what people build with the new entitlements system.
Happy to answer any questions here!
Beta Was this translation helpful? Give feedback.
All reactions