Quick Start
Make your first API call in under 5 minutes.
01
Get an API key
Go to **API Keys** in the left nav and generate a scoped key. Select `Read Only` for your first integration.
02
Install the SDK
Install the TypeScript SDK:
npm install @hqo/digital-grid-sdk
03
Make your first call
Fetch active leases from your portfolio:
import { DigitalGrid } from '@hqo/digital-grid-sdk';
const dg = new DigitalGrid({ apiKey: process.env.DG_API_KEY });
const leases = await dg.leases.list({ status: 'active' });
console.log(leases.data); // => [{ id, tenant_name, ... }]04
Handle responses
All responses follow the `{ data, error, meta }` envelope:
// Success
{ data: [...], meta: { total: 47, page: 1 } }
// Error
{ error: { code: 'UNAUTHORIZED', message: 'Invalid API key' } }05
Subscribe to events
Register a webhook to receive real-time updates:
// POST /api/v1/webhooks
{
"url": "https://your-server.com/hooks/dg",
"events": ["lease.created", "lease.expiring_soon"]
}