Skip to content

Guide

What is teamdynamix-ts?

A secure, Node-first TypeScript client for the TeamDynamix Web API. It wraps the full REST surface with type-safe entry points, runtime request/response validation, automatic retry with backoff, and auth helpers that handle JWT lifecycle.

Packaged as @selfagency/teamdynamix-ts on npm.

Architecture

text
Client                SDK (10 domains)           Helpers
┌──────────┐         ┌────────────────┐         ┌───────────────────┐
│ Config   │  ───→   │ discovery      │         │ projectFields     │
│ Auth     │  ───→   │ tickets        │         │ previewEntity     │
│ Retry    │  ───→   │ ticketRelations│         │ bulkAddUsersToGrp │
│ Timeout  │  ───→   │ people         │         │ runTicketReport   │
│ Val.     │  ───→   │ knowledgeBase  │         └───────────────────┘
│          │  ───→   │ assets         │         ┌───────────────────┐
│          │  ───→   │ cmdb           │         │ helpers           │
│          │  ───→   │ services       │         │  findAccountByName│
│          │  ───→   │ projects       │         │  findUserByEmail  │
│          │  ───→   │ time           │         │  resolveContext   │
│          │  ───→   │ referenceData  │         └───────────────────┘
│          │         └────────────────┘
│          │         ┌────────────────┐
│          │  ───→   │ registry       │  ← Custom attributes
│          │         └────────────────┘
└──────────┘
           TeamDynamixFetchClient
           (auth middleware, retry, validation)

SDK domains

Every domain on the SDK object exposes auto-generated read methods — GET endpoints from the OpenAPI spec, method-named for consistency. Eight domains also have curated mutation methods (create, update, delete) that are hand-written for intentional API coverage.

DomainAuto readsMutationsNeeds appIdDescription
discoveryYesNoSomeApplications, auth status
ticketsYesYesYesTickets CRUD, feed, workflow
ticketRelationshipsYesYesYesTasks, assets, contacts on tickets
peopleYesYesNoPerson lookup, groups, members
knowledgeBaseYesYesYesArticles
assetsYesYesYesAssets, contracts, models, feed
cmdbYesYesYesConfiguration items, types, vendors
servicesYesYesYesServices, categories, offerings
projectsYesYesNoProjects, issues, risks, plans
timeYesYesNoTime entries, types, reports
referenceDataYesNoSomeAccounts, locations, statuses, roles

Public exports

Everything you can import from teamdynamix-ts:

ts
// Client factory
createTeamDynamixClient(config)
createTeamDynamixSdk(client)               // SDK with domains, mutations, helpers, registry

// Auth helpers (token providers)
loginWithPassword({ username, password })
loginWithServiceAccount({ beid, webServicesKey })
createTokenProviderFromJWT(jwt)             // Wrap a pre-acquired token

// Standalone helper functions (operate on raw data)
projectFields(items, fields)
previewEntity(entity, options?)
bulkAddUsersToGroup(client, input)
runTicketReport(client, input)

// Return types for helpers
BulkResult                                  // Type — result of bulkAddUsersToGroup
ReportPage                                  // Type — result of runTicketReport

// Error handling
TeamDynamixClientError                      // Class — all SDK errors
redactAuthorization(input)                  // Function — strip tokens from strings

// Zod schemas (re-exported from the package)
appIdSchema
tenantSchema
paginationSchema
confirmTrueSchema
searchTextSchema
tokenSchema