Quick start
Hyppot is an A/B testing and feature management platform that helps you make data-driven decisions. This guide shows you how to quickly install and configure Hyppot in your application.
Installation
First, install the Hyppot.AspNetCore
NuGet Package and one of the SQL providers NuGet packages: Hyppot.Sqlite
, Hyppot.Sqlserver
or Hyppot.Postgresql
, depending on the DB engine of your choice:
dotnet add package Hyppot.AspNetCore
dotnet add package Hyppot.Sqlite
Configure
In your Program.cs, define the authorization policy for accessing Hyppot administrative interface, then configure and register Hyppot using the following extension methods:
// Program.cs
using Hyppot.AspnetCore;
using Hyppot.Sqlite;
// ...
builder.Services.AddAuthorization(o => o.AddPolicy(HyppotConstants.DefaultAdminAuthorizationPolicyName, policy =>
policy.RequireRole("Admin"))); // define authorization policy to require Admin role to access Hyppot panel
builder.Services.AddHyppot(config =>
{
config.DbSetup = new SqliteDbSetup("Data Source=/app/storage/hyppot.db");
// you can also use custom authorization policy
// config.AdminAuthorizationPolicyName = "CustomPolicy";
// or customize Hyppot path prefix instead of using the default '/hyppot'
// config.PathPrefix = "/custom-path";
});
var app = builder.Build();
// ...
// other app setup
app.UseHyppot();
app.Run();
Define your first experiment
Now if you run the application and visit APP_URL/hyppot/panel
, and log in with the appropriate user that fulfills the authorization policy, you should get the administrative interface with empty experiment list:
Great! You can start defining your first experiment:
First, extend the "Conversion Types Definition" section, add conversion types you would like to track and save them.
Then you can add your first experiment. Type the experiment name, click "Add". Then configure your experiment variables, define variants, set up the traffic split and click "Save".
Resolving experiments
You can resolve experiments for the user using IExperimentationResolver
defined in Hyppot.Resolving
namespace:
// obtain the resolver from the IoC
ExperimentVariantInstance? experimentVariant = resolver.ResolveForUser(new ExperimentId("three-columns"), new UserId("user-id"));
Method returns object containing name of the variant and values of all variables defined for experiment if the user is assigned to an experiment or null
otherwise.
You can also obtain all experiments assigned to the user:
resolver.ResolveAll(new UserId("user-id"));
Impression and conversion tracking
Use the IExperimentTracker
interface to track impressions and conversions:
// track impression when the user sees the experiment
_experimentTracker.TrackImpression(ExperimentImpression.Create(_experimentId,
_variantId, userId, eventDate, deduplicationKey));
// track conversion
_experimentTracker.TrackConversion(
ExperimentConversion.Create("add-to-cart", eventDate, userId, deduplicationKey));
Activating the experiment and browsing results
When you integrate the experiment in your code, you can Activate it in the Hyppot panel, making it available for your users.
After you gather some experimentation data, statistics will be available in a separate tab in the Hyppot panel:
That's it! You've just configured and ran your first experiment.