Skip to content

Installation

generator-sdk is the platform capability layer. If you also want the official unified shell with built-in login, template actions, and floating export entry, install generator-workbench together.

If you need a focused introduction to the shell itself, see Generator Workbench.

Method 1: npm Package (Engineered Projects)

View on npm

bash
pnpm add @atomm-developer/generator-sdk
pnpm add @atomm-developer/generator-workbench
# or
npm install @atomm-developer/generator-sdk
npm install @atomm-developer/generator-workbench
typescript
import { GeneratorSDK, SdkError, withBilling } from '@atomm-developer/generator-sdk'
import { defineGeneratorWorkbench } from '@atomm-developer/generator-workbench'

// TypeScript types are also exported and can be used directly
import type { UserInfo, AuthStatus, CloudRecord, UsageInfo } from '@atomm-developer/generator-sdk'

defineGeneratorWorkbench()

⚠️ Important for Vue 3 Projects: Do not store the SDK instance in reactive data. See SDK Initialization for details.

Method 2: CDN Integration (Plain HTML / vibe coding)

html
<script src="https://static-res.atomm.com/scripts/js/generator-sdk/index.umd.js"></script>
<script src="https://static-res.atomm.com/scripts/js/generator-sdk/generator-workbench/index.umd.js"></script>
<script>
  // In UMD format, window.GeneratorSDK is the GeneratorSDK class
  const sdk = GeneratorSDK.init({ appKey: 'your_app_key' })

  // SdkError and withBilling are mounted on GeneratorSDK
  const SdkError = GeneratorSDK.SdkError
  const withBilling = GeneratorSDK.withBilling

  GeneratorWorkbench.defineGeneratorWorkbench()
</script>

generator-workbench auto-loads Vue 3 when window.Vue is absent, auto-injects the default atomm-ui stylesheet into its Shadow DOM, and auto-loads the default atomm-ui CDN script when window.AtommUI is absent, so you no longer need to add separate Vue or atomm-ui.js scripts for the shell itself. The shell now uses a single background CSS fetch and reuses that same CSS text for both the Shadow DOM patch and the global document.head patch, which means CSS loading no longer blocks the initial shell render or triggers the earlier double-channel <link> + fetch path.

That only covers the shell itself. If your runtime business UI also uses atomm-ui components and the actual runtime mount root lives inside a Shadow Root or another isolated context, you still need to inject the business UI styles into the runtime's real style host instead of relying only on page-level <head> CSS.

PackagePurposeRecommended When
@atomm-developer/generator-sdkPlatform capabilities such as auth, template, export, billing, and historyAlways required
@atomm-developer/generator-workbenchOfficial unified host shell for top bar, template entry, login area, export entry, and runtime mountingRecommended for new standard generators

Build Artifacts

@atomm-developer/generator-sdk

FileFormatPurposeUsage
dist/index.es.jsESMnpm engineered projectsimport { GeneratorSDK } from '@atomm-developer/generator-sdk'
dist/index.umd.jsUMDCDN <script> tagswindow.GeneratorSDK
dist/index.d.tsTypeScript TypesIDE autocompleteAutomatically loaded

@atomm-developer/generator-workbench

FileFormatPurposeUsage
dist/index.es.jsESMnpm engineered projectsimport { defineGeneratorWorkbench } from '@atomm-developer/generator-workbench'
dist/index.umd.jsUMDCDN <script> tagswindow.GeneratorWorkbench
dist/index.d.tsTypeScript TypesIDE autocompleteAutomatically loaded

Dependencies

DependencyVersionPurposeBundling Behavior
@makeblock/passport-client^4.0.19Login modalBundled into SDK
@makeblock/upload^1.0.0OSS uploadBundled into SDK
axios^1.7.9HTTP requestsBundled into SDK
uuid^11.1.0Generate unique IDsBundled into SDK

All dependencies are bundled into the SDK; no extra installation is required by the user.

MIT Licensed