Registry / devops / hasura-auto-tracker

hasura-auto-tracker

JSON →
library2.3.1jsnpmunverified

Automate Hasura metadata tracking (tables, views, functions) and generate typed SQL views for JSON columns. Version 2.3.1 is current. Supports CI/CD pipelines, relationship naming control, and automatic view generation from JSON data. Key differentiators: configuration-driven tracking via JSON (no UI), custom relationship naming, and typed view generation for JSON columns. Used as a library (import) or CLI tool. Released under GPL-3.0. Low release cadence.

npm install hasura-auto-tracker
INSTALL
IMPORT
SIG · HASURA-AUTO-TRACKE
H
hasura-auto-tracker
devopsjavascriptv2.3.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

HasuraAutoTracker
import { HasuraAutoTracker } from 'hasura-auto-tracker'
const HasuraAutoTracker = require('hasura-auto-tracker')
ESM-only since v2. Use named import for the main class.
trackTables
import { trackTables } from 'hasura-auto-tracker'
const trackTables = require('hasura-auto-tracker').trackTables
Named import for function. Available in v2+.
createViews
import { createViews } from 'hasura-auto-tracker'
import createViews from 'hasura-auto-tracker'
Not a default export. Use named import.

Demonstrates creating a HasuraAutoTracker instance, tracking tables/views, and generating typed views from JSON columns.

import { HasuraAutoTracker } from 'hasura-auto-tracker'; const tracker = new HasuraAutoTracker({ hasuraUrl: 'http://localhost:8080', adminSecret: process.env.HASURA_GRAPHQL_ADMIN_SECRET ?? '' }); async function run() { await tracker.trackTables(['users', 'orders', 'products']); await tracker.trackViews(['active_users']); await tracker.createJSONViews([ { table: 'products', column: 'metadata', viewName: 'product_metadata' } ]); console.log('Tracking configured successfully'); } run().catch(console.error);
Debug
Known issues
breakingESM-only: package no longer supports require() since v2.0. Using require() will throw a runtime error.
fix
Use import syntax or switch to dynamic import().
affects: >=2.0
deprecatedConfig option 'autoTrackRelationships' is deprecated in v2.3. Use 'relationshipConfig' instead.
fix
Replace 'autoTrackRelationships' with 'relationshipConfig' in the constructor options.
affects: >=2.3
gotchaAdmin secret must be passed in options; it is not read from environment variables automatically.
fix
Provide 'adminSecret' in the constructor options, e.g., from process.env.
affects: all
gotchaIf Hasura endpoint URL is unreachable or returns HTTP error, the promise may hang or throw a generic network error without details.
fix
Wrap calls in try/catch and ensure the Hasura server is running and accessible.
affects: all
Errors
Common errors & fixes
Cannot find module 'hasura-auto-tracker'
Package not installed or imported incorrectly.
fix
Run 'npm install hasura-auto-tracker' and use ESM import syntax (import { HasuraAutoTracker } from 'hasura-auto-tracker').
hasura-auto-tracker requires ESM; use import instead of require()
Versions >=2.0 are ESM-only, but using CommonJS require().
fix
Change 'const ... = require(...)' to 'import ... from ...'.
trackTables is not a function
Attempting to use a named export as a function before calling the constructor or misimporting.
fix
Ensure you import trackTables as a destructured named export: import { trackTables } from 'hasura-auto-tracker'.
Upgrade
Version history
2.3.1latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
11 hits · last 30 days
node
10
Amazon
1
Resources
hasura-auto-tracker — npm install hasura-auto-tracker · libregistry