Quickstart

You can set up Keyforge in your project within minutes. This guide will walk you through the steps to get started.

Choose whether to integrate Keyforge directly in your client or server.


Licensing a client application

To validate and activate licenses in the client, use the Public API directly in your app. You can use this API anywhere, with any programming language.

Prerequisites

Before you begin, make sure you have completed the following steps:

  • Create a product here.
  • Create a license here.

Activate a license

The first time a user opens your app, they should be prompted to activate their license.

The device identifier needs to be unique inside the license scope. You can use a MAC address, HWID, or any other type of identifier that is unique to a device.

curl -X POST https://keyforge.dev/api/v1/public/licenses/activate \
  -H "Content-Type: application/json" \
  -d '{
    "licenseKey": "ABCDE-ABCDE-ABCDE-ABCDE-ABCDE",
    "deviceIdentifier": "some_device_id",
    "deviceName": "My device",
    "productId": "p_123456"
  }'

The productId property can also be an array of IDs if your app supports multiple products, like different tiers.

Validate a license

When your app starts, you can verify the license to check if it's valid.

You can validate a license whenever you like, for example, every hour, to ensure that it is still valid.

curl -X POST https://keyforge.dev/api/v1/public/licenses/validate \
  -H "Content-Type: application/json" \
  -d '{
    "licenseKey": "ABCDE-ABCDE-ABCDE-ABCDE-ABCDE",
    "deviceIdentifier": "some_device_id",
    "productId": "p_123456"
  }'

The productId property can also be an array of IDs if your app supports multiple products, like different tiers.

Congratulations! 🎉

You have successfully activated and validated your first license inside your app. You can manage all licenses in the dashboard.

Learn more

Next steps

Some features to explore and extend your licensing system.

Public API

Learn more about the Public API. An API key is not needed to use it.