Skip to content

Repository files navigation

Courier C# SDK

The Courier C# SDK provides typed access to the Courier REST API from .NET applications. Use it to send notifications, manage user profiles, check message status, issue JWT tokens for client-side SDKs, and more.

Installation

dotnet add package TryCourier

Available on NuGet. Targets .NET 8 and .NET Framework 4.7.2.

Quick Start

using System;
using System.Collections.Generic;
using System.Text.Json;
using TryCourier;
using TryCourier.Models;
using TryCourier.Models.Send;

CourierClient client = new();

SendMessageParams parameters = new()
{
    Message = new()
    {
        To = new UserRecipient() { UserID = "your_user_id" },
        Template = "your_template_id",
        Data = new Dictionary<string, JsonElement>()
        {
            { "foo", JsonSerializer.SerializeToElement("bar") }
        },
    },
};

SendMessageResponse response = await client.Send.Message(parameters);
Console.WriteLine(response.RequestID);

The client reads COURIER_API_KEY from your environment automatically.

Documentation

Full documentation: courier.com/docs/sdk-libraries/csharp

About

No description, website, or topics provided.

Resources

Contributing

Security policy

Stars

2 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages