Build from source

Use an unreleased SDK or change from the ffMathy/sponsorkit monorepo, directly from Git where the package manager supports it, or from a local build.

On this page

All five SDKs live in one repository, ffMathy/sponsorkit, under sdks/<language>/. Every SDK is published to its registry; use this page to try a change that isn't released yet.

How easy that is depends on the package manager:

LanguageStraight from GitFrom a local checkout
JavaScriptNo: the package must be built firstnpm pack tarball
.NETNodotnet pack into a local package folder
PythonYes, with a subdirectoryPath install
GoYes: Go modules are fetched from Gitreplace directive
RustYes: Cargo finds the crate in the repositoryPath dependency

Every recipe below was tested against the repository's main branch.

JavaScript#

npm, pnpm and Yarn can install from Git, but not this package: its compiled dist/ folder isn't committed, and the SDK is a member of a Bun workspace whose development dependencies use the workspace: protocol. Build it once and install the tarball instead. You need Bun to build.

Terminal
git clone https://github.com/ffMathy/sponsorkit.git
cd sponsorkit
bun install
bun run --cwd sdks/js build
cd sdks/js && npm pack          # writes sponsorkit-sdk-1.0.0.tgz

Then, in your project:

Terminal
npm install /path/to/sponsorkit/sdks/js/sponsorkit-sdk-1.0.0.tgz

The tarball is exactly what npm publish would upload, so imports, types and entry points behave like the released package. pnpm, Yarn and Bun accept the same path. Commit the tarball, or rebuild it in CI, if your teammates need it too.

.NET#

Pack the library into a folder and use that folder as a package source:

Terminal
git clone https://github.com/ffMathy/sponsorkit.git
dotnet pack sponsorkit/sdks/dotnet/src/Sponsorkit -c Release -o ~/local-nuget -p:Version=1.0.0-local.1

cd my-app
dotnet add package Sponsorkit --version 1.0.0-local.1 --source ~/local-nuget

Give each local build its own version, as with -p:Version above. NuGet caches packages by id and version in ~/.nuget/packages, so rebuilding under the same version keeps serving the old build. For a team or CI, add the folder to a nuget.config instead of passing --source:

nuget.config
<configuration>
  <packageSources>
    <add key="sponsorkit-local" value="./local-nuget" />
  </packageSources>
</configuration>

Python#

pip, uv and Poetry install straight from Git when you name the subdirectory:

python -m pip install "sponsorkit @ git+https://github.com/ffMathy/sponsorkit@main#subdirectory=sdks/python"

uv records the source under [tool.uv.sources] and pins the commit in uv.lock; Poetry pins it in poetry.lock. Replace main with a tag or commit hash to pin it yourself.

Go#

Nothing special: Go modules are fetched from the repository. Before the first sdks/go/v… tag exists, ask for a branch or a commit and Go records a pseudo-version:

Terminal
go get github.com/ffMathy/sponsorkit/sdks/go@main

To work against a local checkout, add a replace directive to your go.mod:

go.mod
require github.com/ffMathy/sponsorkit/sdks/go v0.0.0

replace github.com/ffMathy/sponsorkit/sdks/go => ../sponsorkit/sdks/go

Rust#

Cargo searches a Git repository for the crate by name, so the subdirectory doesn't need to be named:

Cargo.toml
[dependencies]
sponsorkit = { git = "https://github.com/ffMathy/sponsorkit", branch = "main" }
# or, from a local checkout:
# sponsorkit = { path = "../sponsorkit/sdks/rust" }
tokio = { version = "1", features = ["macros", "rt-multi-thread"] }

Cargo.lock pins the exact commit. Use rev = "<commit>" or tag = "sdks/rust/v1.0.0" instead of branch to pin it in Cargo.toml. Crates.io doesn't accept Git dependencies, so switch to a version requirement before you publish a crate that depends on Sponsorkit.

Running the SDK tests#

Each SDK has its own test suite, and all of them run the shared conformance scenarios against a fake API server, so you don't need network access or real accounts. From the repository root, run bun install first; the conformance server is written in TypeScript. The exact commands per SDK are in .github/workflows/ci.yml.