git clone https://github.com/Stardraw/stardraw-cloud-samples.git
cd stardraw-cloud-samplesEach sample reads your credentials from environment variables, so nothing secret is committed:
export STARDRAW_EMAIL="you@example.com"
export STARDRAW_PASSWORD="YOUR_PASSWORD"
# optional, defaults to https://stardraw.cloud/api/v1/
export STARDRAW_BASE="https://stardraw.cloud/api/v1/"| Language | What it shows |
|---|---|
| cURL | Plain HTTP scripts — get a token, list projects, create a project. |
| JavaScript / TypeScript | Node with openapi-fetch and types generated from the public OpenAPI document. |
| Python | A small httpx client with token refresh and the same example calls. |
| C# | A minimal console app using HttpClient. |
The samples above hand-write the HTTP calls. For a fully typed client instead, the openapi-generator/ folder generates an SDK straight from the OpenAPI document with openapi-generator, so you call the API through typed methods like getApplication(), getProjectsGrid(…) and createProject(…). Each language has a generate.sh that reads the spec from the SPEC environment variable (defaulting to the live document) and writes the client into a git-ignored generated/ directory — you regenerate it rather than commit it.
| Language | Generator |
|---|---|
| TypeScript | typescript-fetch |
| Python | python |
| C# | csharp |
| Java | java |
openapi-generator is a Java tool, so generating needs a Java runtime — the scripts invoke it through the @openapitools/openapi-generator-cli npm wrapper — alongside each language’s own toolchain.
The webhooks/ folder holds a minimal receiver per language that verifies the Standard Webhooks signature and handles the event, plus two cURL scripts that register an endpoint and list its deliveries through the Admin API (curl/05-register-webhook.sh and curl/06-list-deliveries.sh).
| Language | What it shows |
|---|---|
| JavaScript | webhooks/javascript — Express with express.raw and the standardwebhooks package. |
| Python | webhooks/python — FastAPI reading the raw body and verifying with standardwebhooks. |
| C# | webhooks/csharp — an ASP.NET Core minimal API verifying the HMAC by hand. |
The event catalog, the envelope and the signature scheme they implement are described on the Webhooks page.
Every sample also demonstrates honoring a 429 / Retry-After response (see Conventions). You’ll need a Stardraw Cloud account to run them — the credentials drive the password grant.