Quick Start
This guide walks you through enqueueing your first background job with Zeridion Flare.
Prerequisites
- .NET 8 or later (.NET 10 recommended)
- A Zeridion Flare API key — get one free in the dashboard
Sign up at dashboard.zeridion.com to create a free account. Your API key will be available in the dashboard immediately — no credit card required.
1. Install the NuGet package
dotnet add package Zeridion.Flare --prerelease
The package targets net10.0 and netstandard2.1, so it works on .NET 6 through .NET 10.
2. Add your API key
Add your key to appsettings.json:
{
"Zeridion": {
"ApiKey": "zf_live_sk_xxxxxxxxxxxxxxxxxxxx"
}
}
Your API key starts with zf_live_sk_ (production) or zf_test_sk_ (test).
3. Register in Program.cs
using Zeridion.Flare;
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddZeridionFlare(options =>
{
options.ApiKey = builder.Configuration["Zeridion:ApiKey"]!;
});
var app = builder.Build();
app.UseZeridionFlare();
app.Run();
AddZeridionFlare scans your assemblies for job classes, registers the HTTP client, job client, and background worker into the DI container. UseZeridionFlare validates that the JobTypeRegistry is registered (ensuring AddZeridionFlare was called).
4. Define a job
Create a class that implements IJob<TPayload>:
public sealed class SendWelcomeEmail(IEmailService email) : IJob<NewUserEvent>
{
public async Task ExecuteAsync(NewUserEvent payload, JobContext ctx)
{
await email.SendAsync(payload.Email, "Welcome!", ctx.CancellationToken);
ctx.Logger.LogInformation("Welcome email sent to {Email}", payload.Email);
}
}
public sealed record NewUserEvent
{
public required string Email { get; init; }
public required string Name { get; init; }
}
- Jobs implement
IJob<TPayload>where the payload is any JSON-serializable class. - Constructor injection works normally — the SDK resolves your job from your DI container.
JobContextgives you the job ID, attempt number, cancellation token, and a scoped logger.
5. Enqueue it
Inject IJobClient anywhere in your app and call EnqueueAsync:
app.MapPost("/register", async (RegisterRequest req, IJobClient jobs) =>
{
var user = await CreateUser(req);
await jobs.EnqueueAsync<SendWelcomeEmail>(
new NewUserEvent { Email = user.Email, Name = user.Name });
return Results.Ok(user);
});
That's it. The job is sent to the Zeridion Flare API and executed by the background worker running in your app.
Next steps
- Installation details — framework compatibility, project types, and local dev setup
- Configuration — customize queues, retries, timeouts, and concurrency
- Schedule a job —
ScheduleAsyncwith a delay or specific time - Retry strategies — configure
[JobConfig(MaxAttempts = 5)]and backoff behavior - Recurring jobs — cron-based
IRecurringJobfor scheduled tasks - Job continuations — chain dependent jobs with
ContinueWithAsync - Full SDK Reference — every interface, attribute, and option