.NET SDK API Reference
KiketSDK
var sdk = new KiketSDK(new SDKConfig
{
WebhookSecret = "sh_test",
WorkspaceToken = "wk_test",
BaseUrl = "https://kiket.dev",
Settings = new Dictionary<string, object?> { ["retries"] = 3 },
ExtensionId = "com.example.integration",
ExtensionVersion = "1.2.0",
ManifestPath = ".kiket/manifest.yaml",
AutoEnvSecrets = true,
TelemetryEnabled = true,
FeedbackHook = record => { /* ... */ },
TelemetryUrl = Environment.GetEnvironmentVariable("KIKET_SDK_TELEMETRY_URL")
});
Methods
| Method |
Description |
Register(string eventName, string version, WebhookHandler handler) |
Registers a handler. |
Run(string host = "127.0.0.1", int port = 8000) |
Starts the ASP.NET Core server. |
StopAsync() |
Stops the server gracefully. |
WebhookHandler
public delegate Task<object?> WebhookHandler(
IDictionary<string, object?> payload,
HandlerContext context);
HandlerContext
| Property |
Description |
Event / EventVersion |
Metadata for the current invocation. |
Headers |
Request headers. |
Client |
Low-level REST client (GetAsync/PostAsync/...). |
Endpoints |
High-level helper surface. |
Settings |
Manifest configuration merged with env overrides. |
ExtensionId / ExtensionVersion |
Metadata for diagnostics. |
Secrets |
Alias for Endpoints.Secrets. |
Endpoint helpers
LogEventAsync(string name, IDictionary<string, object?> payload)
NotifyAsync(string title, string message, string level = "info")
CustomData(projectId) – exposes ListAsync, GetAsync, CreateAsync, UpdateAsync, DeleteAsync
SlaEvents(projectId) – exposes ListAsync and GetAsync
Secrets – GetAsync, SetAsync, DeleteAsync, RotateAsync, ListAsync
Telemetry
TelemetryReporter emits JSON records to /api/v1/ext/telemetry. Fields include event, version, status, duration (ms), optional error message/class, metadata, and extension identifiers.
await sdk.Telemetry.RecordAsync(
"issue.created",
"v1",
"error",
120,
"Validation failed",
errorClass: typeof(ValidationException).Name,
metadata: new Dictionary<string, object?> { ["attempt"] = 2 }
);
The reporter injects X-Kiket-Runtime-Token automatically using the runtime token from webhook payloads.
Testing helpers
- Use
TestServer from Microsoft.AspNetCore.Mvc.Testing with sdk.App to issue signed requests.
- The SDK ships factories for generating signed payloads (
SignedPayloadFactory.Create(secret, body)).
- Combine with xUnit/NUnit to ensure handlers remain deterministic.
Health endpoints
| Path |
Description |
GET /health |
Provides status + registered events. |
POST /webhooks/{event} |
Default webhook endpoint; requires header X-Kiket-Event-Version. |
POST /v/{version}/webhooks/{event} |
Explicit version path. |