LicenseKit is a Swift library that lets you protect your apps and SDKs with commercial licenses on major Apple platforms (iOS, macOS, tvOS, watchOS & visionOS).
LicenseKit can define licenses with code, generate encrypted license files, read licenses from plain CSV files, integrate with any REST API, etc. It also has pre-defined Gumroad integrations in place.
LicenseKit can validate expiration date, platform, bundle ID, tier, environment, features, and much more. It lets you cache licenses to handle temporary connectivity loss, and combine multiple data sources for flexible validation.
LicenseKit requires a commercial license to be used. It's free to start using, and affordable to scale. You can sign up for a license or try out a free, unlimited trial from the LicenseKit website.
LicenseKit can be installed with the Swift Package Manager:
https://github.com/Kankoda/LicenseKit.git
LicenseKit only has to be linked to the main target. If you use LicenseKit with a Swift package, make sure to set up your package as described in the online documentation.
With LicenseKit, your app/library should create a LicenseEngine
with the license key you obtain when you sign up for LicenseKit, then define which service type you want to use to use to fetch customer licenses.
For instance, this would create an engine with two licenses that are compiled into the product validated on-device:
let licenseEngine = try await LicenseEngine(
licenseKey: "your-license-key",
licenseStore: .myInternalLicenseStore // optional
licenseService: { yourLicense in
.api(...) // or...
.binary(...) // or...
.csvFile(...) // or...
.encryptedFile(...) // or...
.gumroad(...) // etc...
}
)
There are many service types to choose from, as described in the license services article. You can define licenses with source code, read licenses from file, fetch licenses from an API, integrate with services like Gumroad, etc.
Once you have a license engine instance, you can use it to resolve and validate licenses for your product, by letting your customers enter their license key. See the getting-started guide for more information.
LicenseKit provides you with services, integrations and apps that make it easy to manage licenses.
LicenseKit services make it easy to define, fetch, and validate licenses in different ways, for instance:
- 🌩️ API Integrations - LicenseKit can integrate with any REST API.
- ⌨️ Binary Licenses - LicenseKit lets you define licenses with source code.
- 📄 CSV Files - LicenseKit lets you define licenses with plain CSV files.
- ⌨️ Encrypted Files - LicenseKit lets you define licenses with source code.
LicenseKit has pre-defeined integrations for popular 3rd party payment providers:
- 🌩️ Gumroad - LicenseKit can integrate directly with Gumroad.
LicenseKit has macOS-specific SwiftUI Preview apps that can be used directly from within Xcode:
- 💻 License Manager - Inspect a collection of licenses and license services.
- 💻 License File Decryptor - Decrypt and inspect the contents of a license file.
The online documentation has articles, code examples etc. that let you overview the various parts of the library.
See the Understanding Licenses and Understanding License Services articles for more information about licenses and services.
The demo app lets you try out the library on iOS and macOS. Just open and run the Demo
project.
LicenseKit is handled by Kankoda:
Reach out if you have any questions or need help any way.
LicenseKit is closed source. See the LICENSE file for more info.