How to add license keys to your software
One guide per stack. Each starts with the short answer and the code, then the template to start from, then the details: where the key comes from, how a rejection stops the product, what happens offline and how to sell it.
Every guide works the same way underneath: your product sends its key and a machine id to POST https://api.sunlicense.com/api/v2/license/validate with an API key that can only validate. 200 means valid; 400 means rejected, and the body's code says why (EXPIRED, REVOKED, SUSPENDED, NOT_FOUND, TOO_MANY_MACHINES, TOO_MANY_IPS, BLACKLISTED). No answer at all (network error, 5xx, 429) is not a "no": keep running and try again later, or use a signed offline license.
Minecraft and Hytale
- How to add license keys to a Paper plugin
- How to add license keys to a Fabric mod
- How to add license keys to a Velocity plugin
- How to add license keys to a Hytale plugin
Discord bots
- How to add license keys to a discord.js bot
- How to add license keys to a JDA bot
- How to add license keys to a discord.py bot
Apps, tools and web
- How to add license keys to an Electron app
- How to add license keys to a Python CLI tool
- How to add license keys to a .NET or Unity tool
- How to add license keys to a WordPress plugin
- How to add license keys to a Laravel app
Game servers
The quickest way, whatever the stack
Paste the agent setup prompt into Claude Code, Cursor, Codex, Copilot or another coding agent. It installs the sunlicense CLI, creates (or signs in to) your account, adds the check to your project, proves it works with a test license and tells you what it changed. More on AI assistants.
The Free plan covers a product from first line to first sales: 3 products, 100 licenses, every SDK and store integration, no credit card. Create a free account.
