TypeScript SDK
A fully typed TypeScript client for integrating applications with Data Product APIs.
Connect once, then pull data, save views, and check on pipeline health using plain TypeScript (or JavaScript). No manual fetch calls, no hand-rolled JSON parsing. Every method returns a typed object, so your editor knows the shape of the response before you've even run the code.
Zero runtime dependencies. Uses the native fetch API (Node 18+).
Install
# From a local .tgz
npm install vulcan-sdk-0.228.1.32.tgz
# Or from registry (once published)
npm install vulcan-sdkRequires Node 18+ (the SDK uses the native fetch API and has zero runtime dependencies).
Connect
That's it. Every example below just reuses this client. The client builds the base URL for you:
Every request is sent with Accept: application/json, so responses always come back as JSON, even for endpoints where the REST API defaults to something else.
Once you have a client, every resource is a property on it: client.metadata, client.query, client.perspectives, client.followers, client.notifications, client.dq, client.activity.
See what's inside a data product
Before you query anything, it helps to know what models, columns, and metrics you actually have to work with:
models is typed loosely (Record<string, unknown>[]), since its shape depends on what the data product defines, so you'll want a small cast or a runtime check if you plan to do more than log it.
Need the full catalog instead (product info, gateway, status)? Use client.metadata.get().
Run a query and get your data
There are two ways to ask for data. Use whichever one feels natural to you.
Measures and dimensions, if you think in those terms:
Or just write SQL:
Either way, you get a response back immediately with a job id. The query itself runs in the background, so you need to wait for it to finish before you can grab the results:
If you'd rather write GraphQL, you can pass that in too:
Need the generated warehouse SQL instead of executing the query? See the transpile-only recipe. Need to page through more than 50,000 rows? See the pagination recipe.
Querying a named metric
If the data product has metrics already defined, you can just ask for one by name:
If you need filters on top of that, use postMetric instead and poll for the result the same way you would for any other query:
Save a query so you don't have to rewrite it
Once a query has finished running, you can save it as a perspective: basically a named, shareable view that lives at its own slug:
Want to pick your own slug instead of letting the server derive one from the name? Just include it in the same object:
Check whether a slug is free before you commit to it:
From then on you can just fetch it whenever you need it, no need to resubmit the query:
To see what's already been saved:
And if you need to change or remove one later:
Connect from Power BI or Tableau
If you'd rather work in a BI tool, you can grab the connection files and open them there instead:
Know whether you can trust the data
If something looks off, you can dig into the specific rule behind it:
One thing to watch for: use rule.identity to look a rule up later, not rule.id; the field is called identity.
See what's been running behind the scenes
Stay in the loop
Follow a data product if you want to keep tabs on it:
And check what's happened recently:
Cancelling requests
Every method takes an optional opts.signal, so any call can be wired up to an AbortController if you need to cancel it. This is useful in a UI where the user navigates away mid-request:
Handling errors
Every failed call throws the same error class:
The instanceof check matters in TypeScript specifically: with strict settings, whatever you catch is typed unknown, not Error, so you can't reach .statusCode until you've narrowed it.
Full method reference
Everything above covers the common cases. If you need something more specific, here's every method on every client. All of them accept an optional trailing opts for { signal } (see Cancelling requests), omitted below for brevity.
client.metadata
get()
Core metadata: name, env, tenant, product, gateway, status
MetadataResponse
getSemantic()
The semantic schema: models, dimensions, measures
SemanticSchema
downloadPowerBI()
Power BI connection file as raw bytes
Uint8Array
downloadTableau()
Tableau connector file as raw bytes
Uint8Array
client.query
submitSemanticRest(req)
Run a query using measures/dimensions, or GraphQL via req.graphql_body
StatementAccepted
submitSemanticSQL(req)
Run a query written as SQL (req.sql)
StatementAccepted
submitStatement(req)
Run raw SQL directly against physical tables (req.sql)
StatementAccepted
getStatement(statementId)
Check the status of a submitted query
StatementDetail
getStatementResult(statementId)
Get the rows back for a completed query
StatementResult
getMetric(metricName, params?)
Quick lookup of a named metric via query params
Record<string, unknown>
postMetric(metricName, body)
Named metric query with filters/grouping in the body
StatementAccepted
getUsageMetrics()
Query usage stats for this data product
UsageMetrics
Query syntax references: REST query format · SQL reference · GraphQL reference
client.perspectives
list(opts?)
List saved perspectives (opts.limit, opts.offset, opts.owner, opts.is_public)
PerspectivesListResponse
get(slug)
Fetch one perspective's details
PerspectiveDetail
getResult(slug, opts?)
Run the perspective's query and get the rows (opts.force_refresh)
StatementResult
create(req)
Save a completed query as a new perspective
PerspectiveDetail
update(slug, req)
Change a perspective's name, description, visibility, etc.
PerspectiveDetail
delete(slug)
Delete a perspective
Record<string, unknown>
checkAvailability(slug)
Check whether a slug is already taken
boolean
req is a plain object matching PerspectiveCreateRequest / PerspectiveUpdateRequest, no class to construct.
client.followers
follow(req?)
Follow this data product, req is optional metadata
Follower
unfollow()
Stop following this data product
Follower
getFollowStatus()
Whether you're currently following this data product
FollowStatus
getAnalytics(opts?)
Follower counts, optionally broken down over time (opts.granularity)
FollowerAnalytics
list(opts?)
List everyone following this data product
FollowersListResponse
client.notifications
list(opts?)
List notifications, filterable by run_id, plan_id, events, or time range
NotificationsListResponse
client.dq
getSummary()
Product-level data quality roll-up
DQSummary
listRules(opts?)
List configured data quality rules and recent outcomes
RulesResponse
getRuleByName(model, dimension, name)
Look up a rule by model, dimension, and check name (result is under .rule)
RuleDetailResponse
getRule(identity)
Look up a rule by its identity UUID (result is under .rule)
RuleDetailResponse
client.quality (Data Quality, legacy)
Prefer client.dq for new code.
client.activity
listPlans(opts?)
List deployment plans
PlansListResponse
getPlan(planId)
Fetch one plan's details
Plan
getPlanGitDiff(planId)
Git diff behind a plan
PlanGitDiffResponse
listRuns(opts?)
List pipeline runs
RunsListResponse
getRun(runId)
Fetch one run's details
Run
getModelRuns(modelName, opts?)
Runs that touched a specific model
RunsListResponse
listModels(opts?)
Every model tracked in this data product, with its latest run
ModelsListResponse
Cheat sheet
Connect
new VulcanClient({ fqdn, dpName, accessToken, tenant })
See available models and columns
client.metadata.getSemantic()
Run a query (measures/dimensions)
client.query.submitSemanticRest({ query: {...} })
Run a query (SQL)
client.query.submitSemanticSQL({ sql: "SELECT ..." })
Run raw SQL (physical tables)
client.query.submitStatement({ sql: "SELECT ..." })
Get the generated warehouse SQL only
See the transpile-only recipe
Check if a query is done
client.query.getStatement(id)
Get query results
client.query.getStatementResult(id)
Query a named metric
client.query.getMetric(name, params)
Query a metric with filters
client.query.postMetric(name, body)
Save a query for reuse
client.perspectives.create({ name, statement_id, ... })
Check if a slug is free
client.perspectives.checkAvailability(slug)
Fetch a saved view
client.perspectives.getResult(slug)
Download Power BI / Tableau files
client.metadata.downloadPowerBI() / downloadTableau()
Check data quality
client.dq.getSummary()
See recent pipeline runs
client.activity.listRuns()
Follow a data product
client.followers.follow()
See notifications
client.notifications.list()
Cancel an in-flight request
pass { signal: controller.signal } as the last argument
Constructor Options
fqdn
string
Yes
DataOS FQDN, e.g. "example.dataos.io"
dpName
string
Yes
Data product name, e.g. "clothing_retail"
accessToken
string
Yes
DataOS API token
tenant
string
Yes
Tenant name, e.g. "public"
Types
All methods are fully typed. Import types directly from the package:
metadata
MetadataResponse, SemanticSchema
activity
Plan (key: plan_id), PlansListResponse, Run (key: run_id), RunsListResponse, ModelsListResponse
dq
DQSummary, RulesResponse, RuleDetailResponse
quality
ChecksListResponse, CheckDetailResponse
query
StatementAccepted (key: id), StatementDetail, StatementResult, UsageMetrics
perspectives
PerspectiveDetail, PerspectivesListResponse (items via .items)
notifications
NotificationsListResponse, Notification
followers
FollowStatus, FollowersListResponse, FollowerAnalytics
Requirements
Node.js >= 18 (native
fetchrequired)TypeScript >= 5.0 (for TypeScript projects)
Last updated
Was this helpful?