SDK Reference
Installation
Install and configure the MakePhotos SDK for Node.js and TypeScript.
Installation
The MakePhotos SDK is a zero-dependency TypeScript package that works in any Node.js environment.
Install
npm install makephotospnpm add makephotosyarn add makephotosInitialize
import MakePhotos from 'makephotos';
const client = new MakePhotos({
apiKey: process.env.MAKEPHOTOS_API_KEY,
});Configuration options
| Option | Type | Required | Description |
|---|---|---|---|
apiKey | string | Yes | Your API key (mk_live_...) |
baseUrl | string | No | API base URL (defaults to https://makephotos.ai) |
Requirements
- Node.js 18+ (uses native
fetch) - An active MakePhotos subscription
- An API key from the developer dashboard
TypeScript support
The SDK is written in TypeScript and ships with full type definitions. All methods, params, and return types are typed.
import MakePhotos, {
type GenerateParams,
type GenerateResult,
type CreditsInfo,
MakePhotosError,
} from 'makephotos';CommonJS
The SDK supports both ESM and CommonJS:
const MakePhotos = require('makephotos').default;
const client = new MakePhotos({
apiKey: process.env.MAKEPHOTOS_API_KEY,
});