Skip to main content
Oso is an authorization-as-a-service provider partnering with Lago to offer entitlements. You can use the open-source version (available on GitHub) or the cloud-hosted version. To use Oso with Lago, you must open an account on Oso. For more information, refer to Oso’s documentation.

Define available features and plan quotas

First, define the available features for each plan. For instance, the Basic plan has a limited set of features, while the Premium plan offers the full range. You can also use Lago to bill metering and overage. Pass that information to Oso’s plan_quota and quota_used to limit the usage of a specific feature.

Send Lago entitlements to Oso

Lago holds the limits, Oso enforces them. Read the entitlements of a subscription from Lago, then write them to Oso as plan_quota and quota_used facts.
1

Entitle your features in Lago

Create a feature for each capability you gate, give it the privileges that carry its limits, and entitle it to your plans. You can also override a value on a single subscription. See Entitlements for the whole setup.
2

Read the entitlements of the subscription

Get the entitlements of a subscription
The response lists one entry per entitled feature. Each privilege carries value, which is the value in force for this subscription, plus the plan_value and the override_value it comes from.
3

Write the facts in Oso

Send the privilege value of each feature to Oso as plan_quota, and the units the customer has already consumed as quota_used. Read those units from the current usage of the subscription.
Refresh the facts when the entitlements change. Lago sends a subscription.updated webhook when the entitlements of a subscription change, and a plan.updated webhook when the entitlements of a plan change.

Example

Oso’s documentation explains the following entitlements example.