Skip to main content

Installation

Requirements

  • Node.js 18 or higher
  • npm, yarn, or pnpm

Install from npm

npm install @structurify/sdk

Or with yarn:

yarn add @structurify/sdk

Or with pnpm:

pnpm add @structurify/sdk

Verify Installation

import { Structurify } from '@structurify/sdk';

const client = new Structurify({ apiKey: 'test' });
console.log('SDK loaded successfully');

Environment Setup

We recommend using environment variables for your API key:

# Add to your shell profile or .env file
export STRUCTURIFY_API_KEY=sk_live_your_api_key

Then in your code:

import { Structurify } from '@structurify/sdk';

const client = new Structurify({
apiKey: process.env.STRUCTURIFY_API_KEY!,
});

TypeScript Configuration

The SDK includes TypeScript definitions. Recommended tsconfig.json:

{
"compilerOptions": {
"target": "ES2020",
"module": "commonjs",
"strict": true,
"esModuleInterop": true,
"skipLibCheck": true
}
}

ESM vs CommonJS

The SDK supports both ESM and CommonJS:

// ESM
import { Structurify } from '@structurify/sdk';

// CommonJS
const { Structurify } = require('@structurify/sdk');

Upgrade

npm update @structurify/sdk