Get started with Optimizely Mark tools
You can enable Mark (Optimizely Agent Platform) tools to enable AI-powered campaign and promotion management for Optimizely Commerce Connect websites.
Prerequisites
- Use .NET 8.0 or later.
- Have EPiServer.Commerce.Core 14.x.
- Have Optimizely.Opal.Tools 0.4.0+.
- Use Opti ID.
- Use Optimizely.Commerce.Graph for tools that query data.
Installation
Install the NuGet package from GitHub packages.
dotnet add package Optimizely.Commerce.Opal.ToolsConfiguration
Register services
Add Commerce Connect Mark tools to your service collection in Startup.cs or Program.cs.
public void ConfigureServices(IServiceCollection services)
{
// Add EPiServer Commerce services first
services.AddCommerce();
// Add Commerce Opal Tools
services.AddCommerceOpalTools();
}Configure endpoints
Choose one of the following options to expose the tool endpoints:
Option A: UseCommerceOpalTools (Recommended)
public void Configure(IApplicationBuilder app)
{
app.UseCommerceOpalTools(
basePath: "",
includeExperimentalTools: false
);
}Option B: MapCommerceOpalTools (minimal APIs)
var app = builder.Build();
app.MapCommerceOpalTools(options =>
{
options.BasePath = "";
options.IncludeExperimentalTools = true;
});Option C: Manual endpoint mapping
app.UseEndpoints(endpoints =>
{
endpoints.MapControllerRoute(name: "Default", pattern: "{controller}/{action}/{id?}");
endpoints.MapOpalTools("");
// Optional: Separate endpoint for experimental tools
endpoints.MapOpalTools("/experimental/",
filter: t => t.IsExperimentalTool());
});Configure the Mark instance
Note To configure the Mark instance, you must be a Mark Administrator. See Get started with Mark for administrators for information.
- Go to the following Mark instance, https://mark.optimizely.com/instances/{OpalInstanceId}.
- Go to the Tools\Registries tab.
- Click Add tool registry.
- Enter registry name and discovery URL from your Commerce Connect site, like https://{commercesite}/discovery.
When successful, Mark lists all tools. You can then enable each tool. See Manage tools in the Mark documentation.
Configure Content Graph (Optional)
If you plan to use Graph tools, add the Content Graph configuration to appsettings.json:
{
"Optimizely": {
"ContentGraph": {
"GatewayAddress": "https://YOUR-GATEWAY.optimizely.com",
"AppKey": "your-app-key",
"Secret": "your-secret"
}
}
}Authentication
All tools require OptiID authentication. Include the authorization token in your requests:
Authorization: Bearer <YOUR_OPTIID_TOKEN>The tools use the OptiID scheme with default scope.