Code samples

A companion repository of runnable starter projects shows the same workflow — authenticate, list projects, create a project — in several languages. Clone it and use whichever language fits your stack as a starting point for your own integration.

Get the samples

git clone https://github.com/Stardraw/stardraw-cloud-samples.git
cd stardraw-cloud-samples

Each 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/"

Languages

LanguageWhat it shows
cURLPlain HTTP scripts — get a token, list projects, create a project.
JavaScript / TypeScriptNode with openapi-fetch and types generated from the public OpenAPI document.
PythonA small httpx client with token refresh and the same example calls.
C#A minimal console app using HttpClient.

Generated client SDKs

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.

LanguageGenerator
TypeScripttypescript-fetch
Pythonpython
C#csharp
Javajava

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.

Every sample also demonstrates honouring a 429 / Retry-After response (see Conventions). You’ll need a Stardraw Cloud account to run them — the credentials drive the password grant.