Skip to content

Modernize C# example and use environment variable for API key - #33

Open
KiwiBryn wants to merge 4 commits into
aisstream:mainfrom
KiwiBryn:modernise-csharp-sample
Open

KiwiBryn wants to merge 4 commits into
aisstream:mainfrom
KiwiBryn:modernise-csharp-sample

Conversation

@KiwiBryn

Copy link
Copy Markdown

Summary

Modernize the C# sample and improve API key handling.

Changes

  • Add Visual Studio/.NET .gitignore rules
  • Update C# example to modern C# syntax
  • Enable nullable reference types
  • Use AISSTREAM_API_KEY environment variable instead of embedding API keys in source
  • Update README with setup instructions for PowerShell and Command Prompt
  • Update project configuration

Why

Using an environment variable helps prevent accidental commits of API keys while keeping the example simple and easy to run.

Require .NET 10 and document setting `AISSTREAM_API_KEY` in PowerShell and Command Prompt before running the example.
Read the API key from an environment variable, decode messages as UTF-8, and target .NET 10.
Add `/.vs` to `.gitignore` to keep local settings and cache files out of version control.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant