API ReferenceSDK Reference

SDK Reference

Use the Lizard SDK to interact with the platform programmatically.

Installation

npm install @lizard/sdk

Initialization

import { Lizard } from '@lizard/sdk';
 
const lizard = new Lizard({
  apiKey: process.env.LIZARD_API_KEY,
});

Deployments

List Deployments

const deployments = await lizard.deployments.list({
  project: 'my-project',
  limit: 10,
});

Get Deployment

const deployment = await lizard.deployments.get('lzd_deploy_abc123');
 
console.log(deployment.status);  // 'ready'
console.log(deployment.url);     // 'https://my-project.lizard.build'

Create Deployment

const deployment = await lizard.deployments.create({
  project: 'my-project',
  environment: 'production',
});

Environment Variables

List Variables

const vars = await lizard.env.list({
  project: 'my-project',
  environment: 'production',
});

Set Variable

await lizard.env.set({
  project: 'my-project',
  key: 'DATABASE_URL',
  value: 'postgresql://...',
  environment: 'production',
});

Logs

Query Logs

const logs = await lizard.logs.query({
  project: 'my-project',
  level: 'error',
  since: '1h',
  limit: 100,
});

Stream Logs

const stream = lizard.logs.stream({
  project: 'my-project',
  follow: true,
});
 
for await (const entry of stream) {
  console.log(`[${entry.level}] ${entry.message}`);
}

Types

interface Deployment {
  id: string;
  project: string;
  status: 'building' | 'deploying' | 'ready' | 'failed';
  url: string;
  createdAt: Date;
  environment: 'preview' | 'production';
}
 
interface LogEntry {
  timestamp: Date;
  level: 'debug' | 'info' | 'warn' | 'error';
  message: string;
  deploymentId: string;
}