Installation & Setup
Step-by-step installation instructions for all environments.
Installation Methods
PropTechUSA can be installed via npm, yarn, or pnpm.
npm
npm install @proptechusa/sdk
yarn
yarn add @proptechusa/sdk
pnpm
pnpm add @proptechusa/sdk
Environment Setup
1. Create Environment Variables
Create a .env.local file in your project root:
PROPTECH_API_KEY=your_api_key_here
PROPTECH_WEBHOOK_SECRET=your_webhook_secret
2. Configure TypeScript (Optional)
If you're using TypeScript, the SDK includes full type definitions. No additional configuration needed.
3. Initialize in Your App
// lib/proptech.ts
import { PropTech } from '@proptechusa/sdk';
export const proptech = new PropTech({
apiKey: process.env.PROPTECH_API_KEY!,
// Optional: customize base URL for self-hosted
// baseUrl: 'https://api.yourdomain.com',
});
Framework-Specific Setup
Next.js
// app/api/leads/route.ts
import { proptech } from '@/lib/proptech';
export async function GET() {
const leads = await proptech.leads.list();
return Response.json(leads);
}
Express
import express from 'express';
import { proptech } from './lib/proptech';
const app = express();
app.get('/api/leads', async (req, res) => {
const leads = await proptech.leads.list();
res.json(leads);
});
Verify Installation
Run this quick test to verify everything is working:
import { proptech } from './lib/proptech';
async function test() {
const health = await proptech.health.check();
console.log('API Status:', health.status); // Should print "ok"
}
test();