> ## Documentation Index
> Fetch the complete documentation index at: https://docs.delfinance.com.br/llms.txt
> Use this file to discover all available pages before exploring further.

# C# (.NET) SDK

> Instale e configure o SDK oficial da Delfinance para C# e .NET.

## Instalação

<CodeGroup>
  ```bash .NET CLI theme={null}
  dotnet add package Delfinance-api-sdk --version 0.2.5
  ```

  ```xml PackageReference theme={null}
  <PackageReference Include="Delfinance-api-sdk" Version="0.2.5" />
  ```
</CodeGroup>

Compatível com .NET 6.0 ou superior.

## Configuração inicial

```csharp theme={null}
using Delfinance.Sdk;

var client = new DelfinanceClient(new DelfinanceConfig
{
    Environment = "sandbox", // ou "production"
    ClientId = Environment.GetEnvironmentVariable("DELFINANCE_CLIENT_ID"),
    ClientSecret = Environment.GetEnvironmentVariable("DELFINANCE_CLIENT_SECRET"),
    CertPath = "./certificado.crt",
    KeyPath = "./chave-privada.key"
});
```

| Propriedade    | Tipo     | Descrição                                |
| -------------- | -------- | ---------------------------------------- |
| `Environment`  | `string` | `"sandbox"` ou `"production"`            |
| `ClientId`     | `string` | API key do Portal do Desenvolvedor       |
| `ClientSecret` | `string` | Client secret do Portal do Desenvolvedor |
| `CertPath`     | `string` | Caminho para o certificado mTLS (`.crt`) |
| `KeyPath`      | `string` | Caminho para a chave privada (`.key`)    |

## Publicado em

<Card title="NuGet — Delfinance-api-sdk" icon="microsoft" href="https://www.nuget.org/packages/Delfinance-api-sdk/0.2.5">
  Veja versões e dependências no NuGet.
</Card>
