License Setup
The Eriksson Beam API requires a valid API license key for all operations. This guide covers how to obtain, configure, and manage your API license key.
Understanding Licensing
Eriksson Beam has two separate licenses:
| License | Purpose | How to Obtain |
|---|---|---|
| Desktop License | Run the Eriksson Beam application | Included with purchase/subscription |
| API License Key | Use the automation API | Contact support@erikssonsoftware.com |
This guide covers the API License Key configuration. Your desktop license is handled separately during software installation and activation.
Note: The API license key is sometimes referred to as "Eriksson license key" in code (e.g., the
ERIKSSON_LICENSE_KEYenvironment variable). These refer to the same thing - your API access credential.
Obtaining an API License Key
Contact Eriksson Software to obtain an API license key:
- Email: support@erikssonsoftware.com
- Website: Contact form on the Eriksson Software website
Your license key will be provided as a string that looks similar to:
XXXX-XXXX-XXXX-XXXX-XXXX
Configuring Your API License Key
Recommended: Environment Variable
Store your API license key in an environment variable for security:
Windows (Command Prompt):
setx ERIKSSON_LICENSE_KEY "YOUR-LICENSE-KEY-HERE"
Windows (PowerShell):
[Environment]::SetEnvironmentVariable("ERIKSSON_LICENSE_KEY", "YOUR-LICENSE-KEY-HERE", "User")
In your code:
var licenseKey = Environment.GetEnvironmentVariable("ERIKSSON_LICENSE_KEY");
var launcherArgs = new ErikssonBeamLauncherArgs
{
LicenseKey = licenseKey,
// ...
};
Alternative: Configuration File
For applications with configuration files, use appsettings.json:
{
"ErikssonBeam": {
"LicenseKey": "YOUR-LICENSE-KEY-HERE"
}
}
Load in code:
var configuration = new ConfigurationBuilder()
.AddJsonFile("appsettings.json")
.Build();
var licenseKey = configuration["ErikssonBeam:LicenseKey"];
Security Warning: Never commit license keys to source control. Add
appsettings.jsonto your.gitignoreand useappsettings.Development.jsonfor local development.
Not Recommended: Hardcoded
Avoid hardcoding license keys in source code:
// DON'T do this - key will be in source control and compiled binary
var launcherArgs = new ErikssonBeamLauncherArgs
{
LicenseKey = "XXXX-XXXX-XXXX-XXXX-XXXX", // Bad practice!
// ...
};
How License Validation Works
Understanding the validation process helps with troubleshooting:
First Request: When you make your first API request, the license key is validated against Eriksson Software's license server.
Caching: Valid keys are cached for 7 days. During this period, no network calls are made to revalidate.
Offline Use: After initial validation, the API works offline for up to 7 days.
Cache Expiration: After 7 days, the next API request will revalidate online.
License Errors
Common Error Codes
| Error | Meaning | Resolution |
|---|---|---|
LicenseError |
Invalid or expired license key | Verify key is correct; contact support |
Unauthorized |
Key not authorized for this operation | Check license tier/permissions |
Handling License Errors
try
{
var design = await client.PullBeamDesignerAsync();
}
catch (ServerErrorException ex) when (ex.Response.ResponseCode == ResponseCode.LicenseError)
{
Console.WriteLine("License validation failed. Please check your license key.");
Console.WriteLine($"Details: {ex.Response.ErrorMessage}");
}
Testing Your Setup
Verify your license is working with this test program:
using System;
using System.Threading.Tasks;
using ErikssonBeam.API.BeamClient;
class LicenseTest
{
static async Task Main()
{
var licenseKey = Environment.GetEnvironmentVariable("ERIKSSON_LICENSE_KEY");
if (string.IsNullOrEmpty(licenseKey))
{
Console.WriteLine("ERROR: ERIKSSON_LICENSE_KEY environment variable not set");
return;
}
Console.WriteLine("License key found. Attempting connection...");
var args = new ErikssonBeamConnectionAttemptArgs
{
LicenseKey = licenseKey,
MaxAttempts = 3,
WaitTimeBetweenAttemptsMs = 1000
};
try
{
// This requires Eriksson Beam to be running
var client = await ErikssonBeamFinder.GetFirstSupportedBeamClient(args);
Console.WriteLine("SUCCESS: Connected to Eriksson Beam!");
Console.WriteLine("License key is valid.");
client.Dispose();
}
catch (ErikssonBeamNotRunningException)
{
Console.WriteLine("Eriksson Beam is not running.");
Console.WriteLine("Start Eriksson Beam and try again to verify your license.");
}
catch (ServerErrorException ex)
{
Console.WriteLine($"License error: {ex.Response.ErrorMessage}");
}
}
}
Multiple Environments
For different environments (development, staging, production), use separate environment variables or configuration files:
#if DEBUG
var licenseKey = Environment.GetEnvironmentVariable("ERIKSSON_LICENSE_KEY_DEV");
#else
var licenseKey = Environment.GetEnvironmentVariable("ERIKSSON_LICENSE_KEY_PROD");
#endif
API License Key Security Checklist
- [ ] Store API license key in environment variable or secure configuration
- [ ] Never commit API license keys to source control
- [ ] Add configuration files with keys to
.gitignore - [ ] Use different keys for development and production if available
- [ ] Rotate keys if they may have been exposed
Next Steps
With your license configured, proceed to First Connection to start using the API.