All posts

Offer a free trial of your software, once per PC

Let new users try your program before they buy: one call gives a PC a trial key for the days you choose, each PC gets one trial, and rules keep trial farmers out. With the code for C#, Python and Node.js

2 min read

A free trial is one of the best ways to sell software: people buy what they've already used. It's also an open door for anyone who wants to use your program for free forever, one trial after another. PWF Auth gives you trials that open the door once per PC, and close it properly when the time is up

How it works

  • You turn trials on for an application and choose how many days a trial lasts
  • Your program asks for a trial with one call. The server makes a trial key bound to that PC, and your program signs in with it like any other key
  • Each PC gets one trial per application. Asking again answers TRIAL_USED, with that PC's trial key, so the program can still sign in with it and show how long is left, or that it has expired
  • When the trial ends, the key expires like any other, and the program closes with EXPIRED on its next check-in. That's the moment to show your Buy button

Step 1: turn trials on

In Applications, edit your app, turn on Free trial and set the number of days

Step 2: ask for a trial from your program

var trial = await client.CreateTrialAsync();
var trialKey = trial.GetString("trial_key");      // a new trial, or this PC's earlier one
if (trialKey == null) { ShowError(trial.Message); return; }

var login = await client.LoginAsync(trialKey);
if (!login.Success) { ShowBuy(login.Message); return; }   // EXPIRED once the trial is over
client.StartHeartbeat();

In Python it's client.create_trial(), in Node.js await client.createTrial(). As with a key, always start the heartbeat: it's what ends the trial on time

The answers you'll meet:

  • TRIAL_DISABLED: trials are off for this app
  • TRIAL_USED: this PC already had its trial (the reply carries its trial key)
  • TRIAL_LIMIT: too many trials from one internet address

Keep trial farmers out

A trial is bound to the PC's hardware ID, so reinstalling your program doesn't give a new one. To go further, sign-in rules apply to trials too: refuse VPNs, or hosting addresses where bot farms live, and the same address can't collect trial after trial

Watch trials turn into sales

Trial keys show in Licences like your other keys, so you see who is trying your program and when. A webhook can tell your own server each time one starts, with the trial.created event, so you can send a welcome email or count your conversions

Trial or customer accounts?

If your customers sign in with a username and password, a new account can also start with a few free days: set it in the sign-up settings. See customer accounts that renew with a key

Protect your app for free

Licence keys, customer accounts and the kill switch, in every language. Make an account and sign in with your first key in a few minutes

Create a free account