@uigraph/sdk
v1.1.40
Published
[](https://www.npmjs.com/package/@uigraph/sdk) [](LICENSE)
Readme
@uigraph/sdk
Official TypeScript SDK for UiGraph. Parse SQL and NoSQL schemas, convert Mermaid diagrams, and produce React Flow node and edge data for architecture and data-model diagrams.
Features
- Mermaid → React Flow — flowcharts, sequence diagrams, and more
- Context-aware conversion — apply node, edge, and group overrides after parsing
- SQL parsing — MySQL, PostgreSQL, SQLite with dialect auto-detection
- Schema → diagram — convert SQL AST into diagram-ready structures
- NoSQL schemas — MongoDB, DynamoDB, and JSON schema support
- Icon packs — AWS, Azure, and animated node icon lists
- Multiple runtimes — full, browser, and headless entry points
Install
npm install @uigraph/sdkPeer dependencies (install if you do not already have them):
npm install @xyflow/react zod quillQuick start
Convert Mermaid source into React Flow data:
import { convertMermaidToReactFlow } from '@uigraph/sdk'
const mermaid = `flowchart TD
A[Start] --> B{Decision}
B -->|Yes| C[Done]
B -->|No| D[Retry]
`
const { nodes, edges } = await convertMermaidToReactFlow(mermaid)Parse SQL and work with the schema AST:
import { SqlToAstParser } from '@uigraph/sdk'
const dialect = SqlToAstParser.detectDialect(sql)
const ast = new SqlToAstParser(dialect).parse(sql)Package entry points
| Import | Use when |
|--------|----------|
| @uigraph/sdk | Full SDK (Node.js or bundlers) |
| @uigraph/sdk/browser | Browser environments |
| @uigraph/sdk/headless | Server-side conversion without DOM APIs |
| @uigraph/sdk/aws-icons | AWS icon metadata |
| @uigraph/sdk/azure-icons | Azure icon metadata |
| @uigraph/sdk/animated-nodes | Animated node icon metadata |
import { convertMermaidToReactFlow } from '@uigraph/sdk/browser'
import { awsIcons } from '@uigraph/sdk/aws-icons'Documentation
Development
Requires Node.js 20+ and pnpm.
pnpm install
pnpm dev # watch build, typecheck, and tests
pnpm test
pnpm lint
pnpm run buildPublishing a release
- Bump the version in
package.jsonand merge tomain. - Create a GitHub Release with tag
vX.Y.Zmatching that version. - CI publishes to npm.
The repo needs an NPM_TOKEN secret (npm Automation token) configured before the first publish.
License
This project is licensed under the Business Source License 1.1 (BUSL-1.1).
- Source available today — you can read, modify, and redistribute the code under the terms of the license.
- Non-production use — free for development, testing, evaluation, and internal proof-of-concept.
- Production use — requires a commercial license from UiGraph. Production use means any use that supports the ongoing operation of your business or organization.
- Future open source — each version automatically converts to Apache License 2.0 four years after it is first published under BUSL.
BUSL is not an OSI-approved open source license during the initial term. For commercial licensing questions, open an issue or contact the maintainers.
Related projects
- uigraph-ui — web application
- uigraph-api — backend API
- uigraph-graphql — GraphQL BFF
- uigraph-gateway — CLI sync API
- uigraph-mcp — MCP server for AI assistants
- uigraph-deploy — self-hosted deployment
