For vendors using Usakey
Add license checks to your app
Two ways to add licensing to your app: let an AI assistant do it through MCP, or add the SDK yourself.
Two ways to integrate
You'll add code to your app that activates a device with a license key and decides whether each feature can be used. Either way, the work is done by the official Usakey SDK: it creates keys on the device and verifies Usakey's signed responses.
| Aspect | Let an AI assistant do it | Add the SDK yourself |
|---|---|---|
| Best when | You use Claude Code or Codex and want it to handle everything from the code to the tests | You want to decide exactly where the checks go and how they look |
| What you need | An AI assistant that supports MCP | The SDK and a build environment for your app's language |
| Screens you use | The Ask your AI assistant to integrate tab of Implementation with AI and SDKs and the approval page in your browser | Implementation with AI and SDKs |
Let an AI assistant do it
Usakey runs an MCP server for AI assistants (https://usakey.jp/mcp). Once you add it to your AI assistant and approve the connection in your browser, the assistant reads the Usakey skills (instructions written for AI) and integrates licensing into your app. You don't need an API key or Node.js.
-
Step 1Open the steps for adding the MCP server
-
Step 2Add the MCP server to your AI assistant
Paste the following prompt into an AI assistant that can run commands, such as Claude Code or Codex. The assistant adds the MCP server and explains how to sign in and approve access in your browser.
Add https://usakey.jp/mcp to this AI assistant as an HTTPS MCP server named usakey. Then explain how I can sign in to Usakey in my browser and approve the connection.When the assistant finishes adding it, your browser opens a Usakey page (in Claude Code, follow the assistant's instructions: open
/mcp, chooseusakey, and select "Authenticate").Instead of the prompt, run one of the following in your AI assistant.
- Claude Code
claude mcp add --transport http --scope user usakey https://usakey.jp/mcpIn Claude Code, open
/mcp, chooseusakey, and select "Authenticate" to open your browser.- ChatGPT (Codex)
codex mcp add usakey --url https://usakey.jp/mcpAdding the server starts the sign-in and opens your browser.
For other AI assistants, see Add the MCP server in the developer documentation.
-
Step 3Sign in and choose what to allow
Your browser opens the Usakey approval page (or the sign-in page first, if you aren't signed in). Check the app that's asking to connect, the account you're approving with, and the Workspace. Then choose the Access to grant and select Allow.
- Use skills only: the assistant only reads the skills and can't change anything. This is enough for integration.
- Allow read-only access: the assistant can also look at products, licenses, the audit log, and so on.
- Allow day-to-day operations or higher: you can also ask it to issue or suspend licenses. Only owners and admins can choose this, and you also pick the Environment for actions.
Apps whose name Usakey can't verify are labeled as unverified, and Use skills only is selected by default. Don't approve a connection you don't recognize.

-
Step 4Check the connection and ask for the work
Approved connections appear on AI assistant integration in the console. Then copy the request under Ask it to integrate licensing on Implementation with AI and SDKs and paste it into your AI assistant. You can also describe what you want to build in plain language.
Use the Usakey MCP skill to build a simple clock app in Rust with GPUI, and add license activation and a license status display to it.To review or revoke connections, see Manage AI assistant connections.

Add the SDK yourself
-
Step 1Download the SDK and starters
Open Implementation with AI and SDKs in the left menu and open the Implement it yourself with the SDK tab. Under Official SDK, select Download SDK. The SDK includes bindings for each language and integration starters for Node.js, Python, Rust, C, C++, Go, Ruby, PHP, Java, Kotlin, Scala, C#, Swift, Flutter, and React Native (
starters). The starters already handle activation, periodic checks, per-feature decisions, deactivation, and the messages users see (in Japanese and English). Copy them into your product's source and adapt them.
-
Step 2Get the connection values and settings file
Connection settings by product on the same tab lists the values your app's settings need: the API URL, the product ID, and the Signature-verification public keys (Trust Bundle). None of them are secrets.
Select Download connection settings to save
usakey.config.json, which bundles these values with the public key your app trusts first. Put it in your product's repository, and the SDK starters and AI assistants can read it as is.
-
Step 3Check at every entry point of a feature
With the Python starter, the code looks like this.
export_pdfis the name you entered in the policy's Features and quantities passed to the product app (JSON) (see Getting started).license = LicenseManager( load_config(Path("usakey.config.json").read_text(encoding="utf-8")), create_open_client(), # uses the Python SDK FileStateStore(directory), FileKeyStore(directory), plan="developer", # your Usakey plan locale="en", ) license.activate(user_entered_key) # first time only; don't store the key license.check() # at startup and at scheduled times decision = license.require_feature("export_pdf") if not decision["allowed"]: show_message(decision["title"], decision["action"])When your app talks to Usakey, and when it doesn't The first time, your app activates the device with the license key the user enters and receives a signed certificate from Usakey. Each time a protected feature is used, the app decides on the device from that certificate, without going online. At startup and at scheduled times it checks the status and receives a new certificate; suspensions and revocations arrive then. While offline, the app keeps working only until the stored certificate and the network grace period run out. User Your app (SDK) Usakey First time only 1 2 3 Each time a feature is used 4 Decide from the certificate (require_feature, no network) 5 At startup and at scheduled times 6 7 While offline Works only until the stored certificate and the network grace period run out 8 When your app talks to Usakey, and when it doesn't The first time, your app activates the device with the license key the user enters and receives a signed certificate from Usakey. Each time a protected feature is used, the app decides on the device from that certificate, without going online. At startup and at scheduled times it checks the status and receives a new certificate; suspensions and revocations arrive then. While offline, the app keeps working only until the stored certificate and the network grace period run out. First time only 1 User Your app (SDK) 2 Your app (SDK) Usakey 3 Usakey Your app (SDK) Each time a feature is used 4 User Your app (SDK) 5 Your app (SDK) At startup and at scheduled times 6 Your app (SDK) Usakey 7 Usakey Your app (SDK) While offline 8 Your app (SDK) Your app contacts Usakey only to activate the device the first time and to check the status at startup and at scheduled times. Each feature check is decided on the device from the stored certificate. - Check the license immediately before invoking a protected feature. Check it wherever the feature can be invoked, including buttons, menus, shortcuts, and commands.
- Send status checks at the times the starter schedules. Checking every time the app starts quickly uses up the daily limit.
- The SDK trusts only Usakey's signed responses. License keys aren't stored on the device.
- For features that use up an amount (usage counters), call
consumein the SDK. It never uses more than the remaining amount the app last received, and it works without a connection. Usage is sent to Usakey in batches before the periodic checks (the usage page).
For the Node.js starter, other languages, and the API specification, see the SDK README and the developer documentation.
Browser app authentication and CORS
Use this setting when CORS restrictions prevent a product app running in a browser, such as a WASM app or a Chrome extension, from connecting directly to Usakey. Register the app's origins and enable access to activate devices and check licenses directly from the browser.
On the screen for adding or editing a product, open "If you authenticate licenses from a browser" at the bottom, select "Allow authentication from registered origins", and enter the app's origins under "Allowed origins". After you save, the product page shows the status and origins under "Browser license authentication".

Enter the scheme, host, and port if needed from the URL that serves the app, such as "https://game.example.com". Do not include a path. For a Chrome extension, enter "chrome-extension://" followed by its 32-character extension ID. You can register up to 20 origins. Besides HTTPS, test products also accept local HTTP origins such as localhost.
Registered origins can activate devices and check licenses directly. Device signatures and response signature verification remain required. This setting does not apply to management pages or the Management API.
See the developer documentation for Godot and WASM transport requirements and configuration through MCP or the Management API. Browser authentication instructions
Screens the product app needs
Copy the device replacement request to ask for the screens, SDK calls and tests together. You can also select “End-user device replacement” from the MCP prompt list.
Whichever way you integrate, the product app needs the following screens that users operate themselves. If you leave the integration to an AI assistant, Usakey's skill tells it to build them. If you integrate yourself, use the functions in the SDK's README.
- "Deactivate this computer"
- Lets the user deactivate a computer they no longer use, on that computer. Show "deactivated" only after the SDK's deactivation succeeded. If it could not connect, tell the user the computer was not deactivated.
- License key and email address
- Used when a per-user policy verifies the user by email address. Build it even if all your policies use license keys, so you can add a per-user policy later.
- Verification code
- The 6-digit code sent by email. It is valid for 10 minutes and allows 5 attempts, and a new code can be sent after 60 seconds. Show the values from the responses.
- Two-factor code field
- Accepts an authenticator app code, a recovery code, or the approval code shown after approving with a passkey. Do not limit it to digits.
- Releasing a computer that is not at hand (if you allow it)
- Shown when the new computer reaches the device limit and Usakey says this flow is available. After the license key, email address, verification code, and two-factor code, the user chooses the computer to release from the list of devices in use (OS, model, last check). Never show or log the value that selects a device or the release token. See Replace a device.
- Guide for moving to a new computer
- Opened from the license screen and from the device limit message. It explains how to deactivate the old computer, where the license key comes from, and what to do when the old computer is not at hand.
Test your integration
When the integration is done, activate a device with the license key you issued, then confirm that suspending the license stops your app and resuming it brings the app back. See Turn a license off and on.
Ask AI to implement or configure
Copy the instruction for your task and paste it into an AI assistant connected to MCP. You can also select the same task from the MCP prompt list. See the product integration page for connection steps. Add license checks to your app
End-user device replacement
Use the Usakey MCP server and distributed skills for this task. First read the relevant skill VERSION, SKILL.md and references below. If the local MCP cannot serve resources, read the same files from the distribution ZIP advertised by the connected server. Confirm product, environment, language and existing settings; never invent missing values. Use the official SDK in product apps and never embed a Management API key. Keep management operations within the approved access and plan. Keep secrets out of chat, screens and logs. Write expected behavior as tests before implementation and report actual verification and unverified surfaces.
Implement the screens and official SDK calls for end users to replace a device: deactivate this device, enter the license key and email, verify the email code and second factor, select and release an unavailable old device, and activate the new one. Follow SDK availability flags and retry delays. Display OS, model and last check time; keep IDs, handles and tokens out of screens and logs. Test P1-P5 and R1-R9, saved state and restart. Before changing seller settings, identify the policy and affected licenses.
References
skill://usakey-auth-integration/references/product-app-screens.md
skill://usakey-auth-integration/references/device-release.md
skill://usakey-auth-integration/references/state-and-testing.md
Management tools for configuration and checks
get_policy_device_release
update_policy_device_release
get_activation_deactivation
License activation and feature control
Use the Usakey MCP server and distributed skills for this task. First read the relevant skill VERSION, SKILL.md and references below. If the local MCP cannot serve resources, read the same files from the distribution ZIP advertised by the connected server. Confirm product, environment, language and existing settings; never invent missing values. Use the official SDK in product apps and never embed a Management API key. Keep management operations within the approved access and plan. Keep secrets out of chat, screens and logs. Write expected behavior as tests before implementation and report actual verification and unverified surfaces.
Integrate the official SDK for activation, scheduled checks, per-feature decisions and license-state screens. Obtain actual integration settings and entitlement names. Distinguish suspension, revocation, expiry, invalid signatures and network outages, and guard non-UI entry points too. Test P1-P5, plan check budgets, saved state and restart.
References
skill://usakey-auth-integration/references/language-bindings.md
skill://usakey-auth-integration/references/product-app-screens.md
skill://usakey-auth-integration/references/outcome-matrix.md
skill://usakey-auth-integration/references/state-and-testing.md
skill://usakey-auth-integration/references/heartbeat-budget.md
Management tools for configuration and checks
get_integration_config
get_plan_limits
Email and two-factor verification
Use the Usakey MCP server and distributed skills for this task. First read the relevant skill VERSION, SKILL.md and references below. If the local MCP cannot serve resources, read the same files from the distribution ZIP advertised by the connected server. Confirm product, environment, language and existing settings; never invent missing values. Use the official SDK in product apps and never embed a Management API key. Keep management operations within the approved access and plan. Keep secrets out of chat, screens and logs. Write expected behavior as tests before implementation and report actual verification and unverified surfaces.
Implement named-user email entry, email-code and second-factor screens. Offer only available_methods. Display expiry, remaining attempts and resend delays from responses; accept letters and hyphens in the second-factor field. Pass the identity token into activation without persisting codes or tokens. Test unknown addresses, wrong and expired codes, lockout and 429.
References
skill://usakey-auth-integration/references/license-key-delivery.md
skill://usakey-auth-integration/references/product-app-screens.md
skill://usakey-auth-integration/references/outcome-matrix.md
Management tools for configuration and checks
create_license_user
assign_license
Trials started inside the app
Use the Usakey MCP server and distributed skills for this task. First read the relevant skill VERSION, SKILL.md and references below. If the local MCP cannot serve resources, read the same files from the distribution ZIP advertised by the connected server. Confirm product, environment, language and existing settings; never invent missing values. Use the official SDK in product apps and never embed a Management API key. Keep management operations within the approved access and plan. Keep secrets out of chat, screens and logs. Write expected behavior as tests before implementation and report actual verification and unverified surfaces.
Implement email-verified in-app trial signup. Check the product trial settings, plan and trial policy. Do not treat repeated signup with the same email as a new trial. Test joining the same trial from another device, expiry screens and conversion after purchase.
References
skill://usakey-auth-integration/references/license-key-delivery.md
skill://usakey-auth-integration/references/product-app-screens.md
Management tools for configuration and checks
get_product_trial_signup
update_product_trial_signup
convert_trial_license
Refreshing after purchase or contract changes
Use the Usakey MCP server and distributed skills for this task. First read the relevant skill VERSION, SKILL.md and references below. If the local MCP cannot serve resources, read the same files from the distribution ZIP advertised by the connected server. Confirm product, environment, language and existing settings; never invent missing values. Use the official SDK in product apps and never embed a Management API key. Keep management operations within the approved access and plan. Keep secrets out of chat, screens and logs. Write expected behavior as tests before implementation and report actual verification and unverified surfaces.
Implement an app action to refresh after purchases, renewals or contract changes. Respect heartbeat budgets and Retry-After, distinguish pending changes from authentication failure, and never override suspension, revocation or expiry with network grace. Test persistence across restart.
References
skill://usakey-auth-integration/references/purchase-refresh.md
skill://usakey-auth-integration/references/outcome-matrix.md
skill://usakey-auth-integration/references/heartbeat-budget.md
Management tools for configuration and checks
Fully offline licensing
Use the Usakey MCP server and distributed skills for this task. First read the relevant skill VERSION, SKILL.md and references below. If the local MCP cannot serve resources, read the same files from the distribution ZIP advertised by the connected server. Confirm product, environment, language and existing settings; never invent missing values. Use the official SDK in product apps and never embed a Management API key. Keep management operations within the approved access and plan. Keep secrets out of chat, screens and logs. Write expected behavior as tests before implementation and report actual verification and unverified surfaces.
Implement request-file export and license-file import for a device that never connects. Check Team or above and target SDK support. Initial license-file issuance is available through local MCP, the Console or the Management API, not hosted MCP; hosted MCP supports rehosting. Keep private keys out of files. Verify signatures, product/device binding and expiry; test tampering, another device, expiry, clock rollback and restart.
References
skill://usakey-auth-integration/references/offline-and-rust.md
skill://usakey-auth-integration/references/language-bindings.md
skill://usakey-auth-integration/references/state-and-testing.md
Management tools for configuration and checks
issue_offline_license_package
Network outages and restart decisions
Use the Usakey MCP server and distributed skills for this task. First read the relevant skill VERSION, SKILL.md and references below. If the local MCP cannot serve resources, read the same files from the distribution ZIP advertised by the connected server. Confirm product, environment, language and existing settings; never invent missing values. Use the official SDK in product apps and never embed a Management API key. Keep management operations within the approved access and plan. Keep secrets out of chat, screens and logs. Write expected behavior as tests before implementation and report actual verification and unverified surfaces.
Use the official SDK's decision to let users continue using the product during a network outage for the permitted period only. Store and restore the verified state securely. An activation ID alone does not grant access. If the policy permits grace, add the signed grace period to the certificate expiry without going past the contract, lease, or offline deadline. Do not apply grace to a confirmed suspension or revocation. Do not extend the contract, lease, or offline deadline. Distinguish network failures, TLS errors, and invalid signatures. Test before and after both certificate expiry and the grace deadline, with a rolled-back clock, and after restarting.
References
skill://usakey-auth-integration/references/state-and-testing.md
skill://usakey-auth-integration/references/runtime-protocol.md
skill://usakey-auth-integration/references/heartbeat-budget.md
Management tools for configuration and checks
get_integration_config
get_plan_limits
Browser, WebAssembly and Chrome extension integration
Use the Usakey MCP server and distributed skills for this task. First read the relevant skill VERSION, SKILL.md and references below. If the local MCP cannot serve resources, read the same files from the distribution ZIP advertised by the connected server. Confirm product, environment, language and existing settings; never invent missing values. Use the official SDK in product apps and never embed a Management API key. Keep management operations within the approved access and plan. Keep secrets out of chat, screens and logs. Write expected behavior as tests before implementation and report actual verification and unverified surfaces.
For a browser app, a WebAssembly app or a Chrome extension, verify SDK support, transport, cryptography and secure key storage. For a Chrome extension, use the Browser SDK (JavaScript) and register the chrome-extension:// origin with the extension ID on the product. Configure allowed product origins and test signed requests and response verification in a real browser. CORS alone is insufficient; identify unsupported bindings/features and alternatives. The user can change a check inside an extension, so also show how the seller's server verifies the license for paid work.
References
skill://usakey-auth-integration/references/browser-runtime.md
skill://usakey-auth-integration/references/language-bindings.md
Management tools for configuration and checks
get_product_browser_runtime
update_product_browser_runtime
Optional TLS public-key pinning
Use the Usakey MCP server and distributed skills for this task. First read the relevant skill VERSION, SKILL.md and references below. If the local MCP cannot serve resources, read the same files from the distribution ZIP advertised by the connected server. Confirm product, environment, language and existing settings; never invent missing values. Use the official SDK in product apps and never embed a Management API key. Keep management operations within the approved access and plan. Keep secrets out of chat, screens and logs. Write expected behavior as tests before implementation and report actual verification and unverified surfaces.
Check whether TLS public-key pinning is needed. Configure it in the applicable SDK only when needed. Set up the active and backup pins, and update the app before renewing the certificate. Continue to use normal TLS verification. Do not apply network grace when the pins do not match. Identify unsupported environments and explain the impact on distributed apps that cannot be updated.
References
skill://usakey-auth-integration/references/tls-pinning.md
skill://usakey-auth-integration/references/language-bindings.md
Management tools for configuration and checks
Screenshots were taken in a test environment with sample data. IDs such as product IDs, license keys, and activation tokens are masked. Some details may change as we improve the screens.
