Learn how to set up a product and a policy, plus create a new user and a license using Keygen's dashboard. If you need help after reading this, can reach out to us anytime at [email protected].
Add your first product by going to the Products resource and clicking the New Product button. You will be presented with a form consisting of a few attributes for your product. If you're curious what a particular attribute is for, be sure to check out the Product resource in the API reference.
The product resource is used to segment policies and licenses (which we'll get into below) by product (in the case where you sell multiple products), allowing you to keep licenses and policies for multiple products organized. If you don't sell more than 1 product, this will be a one-time step.
View example of creating a product
Next, we're going to add a license policy for your product. License policies define the different types of licenses that your product offers. Policies can be for a number of different things, from different tiers for your product (e.g. Basic vs Pro) to fine-grained feature policies.
To add a new policy, go to the Policies resource and click on the New Policy button. To figure out how to properly set up your policy, check out our guide on choosing a license model, where we go in-depth on a lot of popular licensing models and how to configure a policy to implement each one.
Curious about what each of the attributes are used for? Check out the Policy resource in API reference for all of the available options (there's a lot—we know).
View example of creating a policy
Add a new user to your Keygen account by going to the Users resource and clicking on the New User button. You will see all of your users under the users listing as well as all admin users. (Normally, you would create users through the API using a sign up form, but for the purpose of this guide we're creating them manually.)
The user resource allows you to authenticate your users and interact with Keygen's API client-side. This is super useful if you'd prefer to allow your users the ability to manage their own licenses and machines, i.e. a self-serve licensing system.
View example of creating a user
Please note that user resources are shared between products—meaning, when your account has multiple products, your users are signing up for a user account for all of your products, not just a single product. Your registration verbiage should reflect that. They will be able to login across all of your products with a single user account, but are licensed per-product.
For example, a user signs up for a "Blizzard" account, not for a "World of Warcraft" account. And with their "Blizzard" account, they will be able to login and buy licenses for "World of Warcraft", "Overwatch", "Starcraft", and for other products which "Blizzard" provides.
Next up, we're going to give the new user a license to use your product. To add a new license, go to the Licenses resource and click on the New License button. You will be presented with a form allowing you to select the policy to implement, as well as the user to create the license for.
The license resource is what you'd expect—licenses are used to grant access to your software. Each license resource will implement a policy, which will define the rules which that license must follow to remain valid. Each license can be associated with a user, but that's optional; this is useful when you're associating multiple licenses with a single user.
View example of creating a license
That's it! Now that you've got a product all set up with a license policy, you're all set to start integrating Keygen into your product! We have a collection of examples on our GitHub, which covers:
- How to integrate Keygen within an Electron app
- How to build a license activation server with Node
- How to use Keygen to license a WordPress plugin
- How to set up license activation for air-gapped/offline nodes
- How to write a license activation server in PHP
- And lots more!
Next up, you could…
- Learn how to validate licenses both server-side and client-side
- Create a registration form for your product to accept new users
- Create a login form in your product to authenticate your users
- Add a conditional feature within your product based on a user's licenses
- Start keeping track of each of your user's machines
- Integrate your payment provider and Keygen together using webhooks
Questions? Reach out at [email protected].