Docs/Documentation/Connect framework

Next.js

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

1

Prerequisites

Node.js 18+ installed on your machine.

You also need a Repull API key. Get one from your dashboard.

2

Install

npm install @repull/sdk
3

Set up environment variables

Add your credentials to a .env file in your project root:

REPULL_API_KEY=sk_live_YOUR_KEY

There is one key type — sk_live_ — created from /dashboard/keys. It acts on whatever channels your workspace has connected.

4

Make your first API call

Initialize the SDK with your API key, then call any endpoint. The example below lists properties and fetches reservations.

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

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

export async function GET() {
  const { data, pagination } = await repull.reservations.list({
    status: 'confirmed',
    check_in_after: new Date().toISOString().split('T')[0],
    include_total: true,
  })

  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>
  )
}
AI