# Connect your API - Nitro

> Connect your Hot Chocolate server to Nitro to fetch persisted operations from the client registry and report telemetry, using the ChilliCream.Nitro packages.

Canonical source: https://chillicream.com/docs/nitro/nitro-services

Nitro can be smoothly integrated into your HotChocolate server, enabling utilization of the Persisted Operation Storage found within the client registry, to report operations and collect open telemetry. Your server will establish a connection with Nitro, retrieving persisted operations based on their unique hashes. Additional information on the client registry can be found [here](https://chillicream.com/docs/nitro/apis/client-registry).

## Getting Started

To get started, follow these steps:

1. Set up a client registry as instructed [here](https://chillicream.com/docs/nitro/apis/client-registry).
2. Install the Nitro package from NuGet using the following command:

Bash

```
dotnet add package ChilliCream.Nitro
dotnet add package ChilliCream.Nitro.HotChocolate
```

1. Configure your services as shown in the following code snippet:

C#

```
var builder = WebApplication.CreateBuilder(args);

builder.Services
    .AddNitro(x =>
    {
        x.ApiId = "VGhpcyBpcyBub3QgYSByZWFsIGFwaSBpZA==";
        x.ApiKey = "Tm9wZSwgdGhpcyBpcyBhbHNvIG5vIHJlYWwga2V5IDspIA==";
        x.Stage = "dev";
    });

builder
    .AddGraphQL()
    .AddQueryType<Query>()
    .AddInstrumentation() // if you want to use telemetry
    .UseOnlyPersistedOperationAllowed() // optional
    .UsePersistedOperationPipeline(); // if you want to use persisted operations

var app = builder.Build();

app.MapGraphQL();

app.Run();
```

1. Retrieve the API id and API key from Nitro using the `nitro api list` and `nitro api-key create` commands respectively. Instructions for these commands can be found [here](https://chillicream.com/docs/nitro/cli/installation).

Congratulations! You have successfully integrated Nitro into your HotChocolate server. You can now publish new versions of your clients and your server will automatically retrieve the latest persisted operations.

[Edit this page on GitHub](https://github.com/ChilliCream/graphql-platform/edit/main/website/content/docs/nitro/nitro-services.md)

Last updated on **June 30, 2026** by **Tobias Tengler**
