SDK Reference

@terrantula/sdk is the official TypeScript client for the Terrantula API. It wraps every project-scoped and org-scoped route with typed methods backed by the Hono RPC client.

Install

bun add @terrantula/sdk
# or
npm install @terrantula/sdk

Quick start

import { createClient } from '@terrantula/sdk'

const client = createClient('https://your-terrantula-host', 'your-api-token')

// Get an organization by ID
const org = await client.orgs.get({ id: 'my-org-id' })

Client shape

createClient returns a typed client object with top-level namespaces for every resource:

NamespaceResource
client.orgsOrganizations
client.projectsProjects within an org
client.entitiesEntities (env-scoped)
client.entityTypesEntity type catalog
client.cellsCells
client.relationshipsRelationships (env-scoped)
client.relationshipTypesRelationship type catalog
client.actionsActions
client.actionRunsAction run records
client.secretsSecrets (env-scoped)
client.applyCatalog apply
client.catalogRevisionsCatalog revision history
client.environmentsEnvironments
client.auditEventsAudit log
client.driftEventsDrift detection events
client.statsProject statistics
client.graphViewsSaved graph views
client.notificationsNotifications
client.auditExportAudit export configuration
client.userPreferencesUser preferences
client.importSourcesImport source configuration
client.exportCatalogCatalog export
client.adminAdmin-only operations
client.githubGitHub App integration

Guides

Generated API surface

The full TypeDoc-generated reference for every exported type, interface, and function is below: