Docs/Documentation/Quickstart

Next.js

Build a vacation rental dashboard with Next.js App Router + Repull API.

Installation

npm install @repull/sdk

Complete Example

// app/api/reservations/route.ts
import { Repull } from '@repull/sdk'

const dom = new Repull({
  apiKey: process.env.REPULL_API_KEY!,
  workspaceId: process.env.REPULL_WORKSPACE_ID!,
})

export async function GET() {
  const { data, pagination } = await dom.reservations.list({
    status: 'CONFIRMED',
    checkInAfter: new Date().toISOString().split('T')[0],
  })

  return Response.json({ reservations: data, total: pagination.total })
}

// app/page.tsx
export default async function Dashboard() {
  const res = await fetch('/api/reservations')
  const { reservations } = await res.json()

  return (
    <div>
      <h1>Upcoming Check-ins</h1>
      {reservations.map(r => (
        <div key={r.id}>
          {r.primaryGuest.firstName} — {r.checkIn} to {r.checkOut}
        </div>
      ))}
    </div>
  )
}

Environment Variables

REPULL_API_KEY=sk_test_YOUR_KEY
REPULL_WORKSPACE_ID=YOUR_WORKSPACE_ID

Start with sk_test_ keys for sandbox data. Switch to sk_live_ when ready for production.

AI