AlexaVoxCraft.Logging 2.0.1.62

dotnet add package AlexaVoxCraft.Logging --version 2.0.1.62
                    
NuGet\Install-Package AlexaVoxCraft.Logging -Version 2.0.1.62
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="AlexaVoxCraft.Logging" Version="2.0.1.62" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="AlexaVoxCraft.Logging" Version="2.0.1.62" />
                    
Directory.Packages.props
<PackageReference Include="AlexaVoxCraft.Logging" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add AlexaVoxCraft.Logging --version 2.0.1.62
                    
#r "nuget: AlexaVoxCraft.Logging, 2.0.1.62"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package AlexaVoxCraft.Logging@2.0.1.62
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=AlexaVoxCraft.Logging&version=2.0.1.62
                    
Install as a Cake Addin
#tool nuget:?package=AlexaVoxCraft.Logging&version=2.0.1.62
                    
Install as a Cake Tool

๐Ÿ”ฃ AlexaVoxCraft

AlexaVoxCraft is a modular C# .NET library for building Amazon Alexa skills using modern .NET practices. It provides comprehensive support for Alexa skill development with CQRS patterns, visual interfaces, and AWS Lambda hosting.

Key Features

  • ๐ŸŽฏ MediatR Integration: CQRS-style request handling with pipeline behaviors and auto-discovery
  • ๐ŸŽจ APL Support: Complete Alexa Presentation Language implementation for rich visual interfaces
  • โšก Lambda Hosting: Optimized AWS Lambda runtime with custom serialization and ReadyToRun publishing
  • ๐Ÿ“Š Session Management: Robust session attribute handling and game state persistence
  • ๐Ÿ”ง Pipeline Behaviors: Request/response interceptors for cross-cutting concerns like logging and validation
  • ๐Ÿงช Testing Support: Comprehensive testing utilities with AutoFixture integration and property-based testing

๐Ÿ“ฆ Packages

Package NuGet Downloads
AlexaVoxCraft.Model NuGet Downloads
AlexaVoxCraft.Model.Apl NuGet Downloads
AlexaVoxCraft.MediatR.Lambda NuGet Downloads
AlexaVoxCraft.MediatR NuGet Downloads
AlexaVoxCraft.Logging NuGet Downloads

Build Status

๐Ÿš€ Quick Start

Install Core Packages

# Core MediatR integration and Lambda hosting
dotnet add package AlexaVoxCraft.MediatR.Lambda

# APL visual interface support (optional)
dotnet add package AlexaVoxCraft.Model.Apl

# Structured logging for Alexa skills (optional)
dotnet add package AlexaVoxCraft.Logging

Create a Basic Skill

// Program.cs
using AlexaVoxCraft.MediatR.Lambda;
using AlexaVoxCraft.Model.Response;

return await LambdaHostExtensions.RunAlexaSkill<MySkillFunction, SkillRequest, SkillResponse>();

// Function.cs
public class MySkillFunction : AlexaSkillFunction<SkillRequest, SkillResponse>
{
    protected override void Init(IHostBuilder builder)
    {
        builder
            .UseHandler<LambdaHandler, SkillRequest, SkillResponse>()
            .ConfigureServices((context, services) =>
            {
                services.AddSkillMediator(context.Configuration, cfg => 
                    cfg.RegisterServicesFromAssemblyContaining<MySkillFunction>());
            });
    }
}

// Handler.cs
public class LaunchRequestHandler : IRequestHandler<LaunchRequest>
{
    public bool CanHandle(IHandlerInput handlerInput) => 
        handlerInput.RequestEnvelope.Request is LaunchRequest;

    public async Task<SkillResponse> Handle(IHandlerInput input, CancellationToken cancellationToken)
    {
        return await input.ResponseBuilder
            .Speak("Welcome to my skill!")
            .Reprompt("What would you like to do?")
            .GetResponse(cancellationToken);
    }
}

๐Ÿ“– Documentation

๐Ÿ“š Complete Documentation - Comprehensive guides and examples

Core Components

Examples

๐Ÿ“ Project Structure

AlexaVoxCraft/
โ”œโ”€โ”€ ๐Ÿ“‚ src/                              # Core library packages
โ”‚   โ”œโ”€โ”€ ๐Ÿ“ฆ AlexaVoxCraft.Model/          # Base Alexa skill models & serialization
โ”‚   โ”œโ”€โ”€ ๐Ÿ“ฆ AlexaVoxCraft.Model.Apl/      # APL (Alexa Presentation Language) support
โ”‚   โ”œโ”€โ”€ ๐Ÿ“ฆ AlexaVoxCraft.MediatR/        # MediatR integration & request handling
โ”‚   โ”œโ”€โ”€ ๐Ÿ“ฆ AlexaVoxCraft.MediatR.Lambda/ # AWS Lambda hosting & runtime
โ”‚   โ””โ”€โ”€ ๐Ÿ“ฆ AlexaVoxCraft.Logging/        # Alexa-specific logging for AWS
โ”‚
โ”œโ”€โ”€ ๐Ÿ“‚ samples/                          # Working example projects
โ”‚   โ”œโ”€โ”€ ๐Ÿ“ฑ Sample.Skill.Function/        # Basic Alexa skill demonstration
โ”‚   โ””โ”€โ”€ ๐Ÿ“ฑ Sample.Apl.Function/          # APL skill with visual interfaces
โ”‚
โ”œโ”€โ”€ ๐Ÿ“‚ test/                             # Comprehensive test coverage
โ”‚   โ”œโ”€โ”€ ๐Ÿงช AlexaVoxCraft.Model.Tests/    # Core model & serialization tests
โ”‚   โ”œโ”€โ”€ ๐Ÿงช AlexaVoxCraft.Model.Apl.Tests/ # APL functionality tests
โ”‚   โ”œโ”€โ”€ ๐Ÿงช AlexaVoxCraft.MediatR.Tests/  # MediatR integration tests
โ”‚   โ”œโ”€โ”€ ๐Ÿงช AlexaVoxCraft.MediatR.Lambda.Tests/ # Lambda hosting tests
โ”‚   โ””โ”€โ”€ ๐Ÿงช AlexaVoxCraft.Logging.Tests/  # Logging functionality tests
โ”‚
โ”œโ”€โ”€ ๐Ÿ“‚ AlexaVoxCraft.TestKit/            # Testing utilities & AutoFixture support
โ”œโ”€โ”€ ๐Ÿ“‚ docs/                             # Documentation source
โ””โ”€โ”€ ๐Ÿ“‚ samples/                          # Example implementations

๐Ÿ›  Core Concepts

Request Handling Pattern

Skills use the MediatR pattern where:

  1. Requests implement IRequestHandler<T>
  2. Handlers optionally implement ICanHandle for routing logic
  3. Pipeline behaviors handle cross-cutting concerns (logging, exceptions)
  4. Lambda functions derive from AlexaSkillFunction<TRequest, TResponse>

Package Breakdown

Package Purpose Key Features
AlexaVoxCraft.Model Core Alexa models Request/response types, SSML, cards, directives, System.Text.Json serialization
AlexaVoxCraft.Model.Apl APL support 40+ components, commands, audio, vector graphics, extensions (DataStore, SmartMotion)
AlexaVoxCraft.MediatR Request handling Handler routing, pipeline behaviors, attributes management, DI integration
AlexaVoxCraft.MediatR.Lambda Lambda hosting AWS Lambda functions, context management, custom serialization, hosting extensions
AlexaVoxCraft.Logging Alexa-specific logging AWS CloudWatch-compatible JSON formatter, built on LayeredCraft.StructuredLogging

๐Ÿงช Testing

AlexaVoxCraft includes comprehensive testing support:

  • xUnit v3 with Microsoft.Testing.Platform
  • AutoFixture integration for property-based testing
  • AwesomeAssertions for fluent assertions
  • TestKit with specimen builders and test utilities

โš ๏ธ Error Handling

Implement the IExceptionHandler interface for centralized error handling:

public class GlobalExceptionHandler : IExceptionHandler
{
    public Task<bool> CanHandle(IHandlerInput handlerInput, Exception ex, CancellationToken cancellationToken)
    {
        return Task.FromResult(true); // Handle all exceptions
    }

    public Task<SkillResponse> Handle(IHandlerInput handlerInput, Exception ex, CancellationToken cancellationToken)
    {
        return handlerInput.ResponseBuilder
            .Speak("Sorry, something went wrong. Please try again.")
            .GetResponse(cancellationToken);
    }
}

๐Ÿค Contributing

PRs are welcome! Please submit issues and ideas to help make this toolkit even better.

๐Ÿ“œ Credits & Attribution

๐Ÿ“ฆ Credits:

๐Ÿ“œ License

This project is licensed under the MIT License.

Stargazers over time

Stargazers over time

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.0.1.62 143 7/11/2025
2.0.0.61 167 7/2/2025
2.0.0.59 149 7/1/2025
2.0.0.58 144 7/1/2025
2.0.0-beta.57 114 6/30/2025
2.0.0-beta.56 113 6/23/2025
2.0.0-beta.55 113 6/23/2025
1.0.1.54 256 5/21/2025
1.0.1.53 171 5/19/2025
1.0.1.50 278 5/13/2025
1.0.1.49 239 5/13/2025
1.0.1-beta.52 116 5/19/2025
1.0.1-beta.48 207 5/13/2025
1.0.1-beta.47 204 5/13/2025
1.0.1-beta.46 200 5/13/2025
1.0.1-beta.45 214 5/13/2025