<#1 Implement the Flyte TypeScript SDK (parity wit...
# flyte-github
a
#1 Implement the Flyte TypeScript SDK (parity with flyte-sdk-go) Pull request opened by cosmicBboy on <!date^1785290174^{date_short}|2026-07-29T01:56:14Z> Summary Implements the Flyte TypeScript SDK from scratch, matching the functionality of the Go SDK (flyteorg/flyte-sdk-go) — no extras. Import,
init
once, then
run
tasks. Public API (mirrors
flyte/
in the Go SDK)
•
init
/
initFromConfig
/
initFromApiKey
/
close
•
getTask(ref)
with automatic latest-version resolution (ListTasks by
created_at
desc, limit 1) •
run(task, inputs, options)
with the same launch path: input validation against the task's typed interface, registered defaults, data-proxy offload with inline-inputs fallback for older control planes • `RunHandle`:
name()
,
url()
,
phase()
,
wait()
,
watch()
(async iterator over
WatchActionDetails
with transparent reconnects and the same 5-failure linear-backoff give-up),
outputs()
(with legacy
RunService.GetActionData
fallback),
abort(reason)
• Run options mirror the Go
With*
options: name, project/domain, service account, labels, annotations, env vars, interruptible, overwriteCache, queue, maxActionConcurrency, rawDataPath, runBaseDir Config (mirrors
flyte/config.go
)
• API-key decoding (
endpoint:clientId:clientSecret:org
), endpoint sanitization to
dns:///
, org derivation from the endpoint's first DNS label, auth-type inference • flytectl/uctl-style YAML config loading and the same config-file search order as the Python SDK Auth (mirrors
flyte/client/
)
• PKCE (local callback server + browser, same callback HTML), device flow (RFC 8628 incl. `slow_down`/`authorization_pending`), OAuth2 client credentials (with token-endpoint/scopes/audience discovery from the anonymous auth metadata service), external command, proxy-authorization command • Token caching: in-memory, plus an OS-keyring cache using the same layout as the Python/Go SDKs (service = endpoint host, `access_token`/`refresh_token`) so logins are shared; JWT-
exp
-driven validity with the same 10s delta • Interceptor chain matching Go: retry-on-unavailable with linear backoff, lazily-materialized bearer auth with one re-auth on
unauthenticated
, proxy auth, default-org fill Transport • A minimal hand-rolled Connect-protocol client (JSON codec) over
node:http(s)
— unary + server-streaming with enveloped frames — honoring insecure / insecureSkipVerify / custom CA settings, exact procedure paths verified against the generated
flyteidl2
connect stubs (v2.0.26) Conversion (mirrors
flyte/types.go
+ the backend converter it calls)
•
src/converter.ts
is a faithful port of `flyte/v2/dataproxy/converter`'s
JSONValuesToLiterals
/
LiteralsToLaunchFormJson
, preserving its exact semantics and quirks: integer truncation toward zero, first-match union resolution, explicit NONE-union literals for absent optionals, the
{"type": "null"}
sentinel, strict RFC 3339 datetimes, Go-grammar duration parsing in / Go
Duration.String()
rendering out, msgpack-decoded binaries with base64 fallback Docs & tests • TSDoc on the full public surface; README mirroring the Go SDK's docs; runnable
example/main.ts
mirroring
example/main.go
• 169 unit tests across 14 suites, including ports of every Go test (config resolution, token sources, orchestrators, PKCE callback, device flow, cert loading) plus an end-to-end suite against a mock Connect control plane (offload + inline fallback, named-run conflicts, watch streaming/failure/reconnect, outputs, abort) Runtime dependencies are just
yaml
(config files) and
@msgpack/msgpack
(binary literal outputs, matching the Go converter's msgpack decode). Test plan •
npm test
— 169 tests, all passing •
npm run typecheck
/
npm run build
— clean 🤖 Generated with Claude Code flyteorg/flyte-sdk-typescript