SDK for the Seam API written in C#.
Use NuGet to install.
using Seam.Client;
var seam = new SeamClient(apiToken: "YOUR_API_KEY");
var myDevices = seam.Devices.List();
Console.WriteLine("First Device Name: " + myDevices[0].Properties.Name);
var accessCode = seam.AccessCodes.Create(deviceId: myDevices[0].DeviceId, code: "1234");Install the .NET SDK 10.0 or later, just and Node.js, then run
$ git clone git@github.com:seamapi/csharp.git
$ cd csharp
$ npm install
$ dotnet tool restore
Primary development tasks are defined in the justfile
and available via just.
View them with
$ just --list
| Task | Command |
|---|---|
| Run the tests | just test |
| Lint | just lint |
| Format | just format |
| Build the package | just build |
| Generate the SDK | npm run generate |
The npm scripts only drive the codegen layer: npm run generate
regenerates the SDK, and npm run lint and npm run format cover the
TypeScript, JSON, YAML and Markdown sources with ESLint and
Prettier.
C# sources are formatted by CSharpier,
pinned as a local dotnet tool in .config/dotnet-tools.json.
Run the full suite with
$ just test
To run the tests for a single target framework, pass it as an argument
$ just test net8.0
The package targets .NET 8.0 and .NET 10.0, the supported LTS releases. Continuous integration exercises both target frameworks.
New versions are released automatically from main by the
Semantic Release workflow,
which reads Conventional Commits
and dispatches the Version workflow.
Run the Version workflow with the
version to cut.
It runs npm version, which bumps the version field in package.json,
regenerates Seam.csproj with that version, creates a signed v* git tag
and pushes it.
Pushing the tag triggers the Publish
workflow, which packs the library with dotnet pack and pushes the
package to NuGet and GitHub
Packages.
The version lives in
package.json, the development manifest that drives the codegen, and is injected intoSeam.csprojbysrc/generate-csproj.ts. The injection runs fromsrc/version.ts, wired to theversionlifecycle script, which npm runs after the bump but before the commit, so the updated project file is part of the tagged commit and MSBuild surfaces the version at runtime throughAssemblyInformationalVersionAttribute. Never edit the version inSeam.csprojby hand.
This C# SDK is licensed under the MIT license.