Quick Start
1. Set up your backend (required)
The browser SDK cannot talk to Opendoor directly — it needs your backend as a proxy. The server SDK handles authentication, GraphQL, and API translation.
// server.ts (Express example)import express from 'express';import { OpendoorClient } from '@opendoor/partner-sdk-server-js-core';
const app = express();app.use(express.json());
// The server SDK authenticates with Opendoor using your API keyconst opendoor = new OpendoorClient({ apiKey: process.env.OPENDOOR_API_KEY!,});
// Proxy routes — the browser SDK calls these endpointsapp.post('/api/opendoor/v1/addresses/suggestions', async (req, res) => { const result = await opendoor.getAddressSuggestions(req.body.query); res.json(result);});
app.post('/api/opendoor/v1/offer/create', async (req, res) => { const result = await opendoor.createOffer(req.body); res.json(result);});
app.listen(3002);2. Add the React components
The browser client points at your backend, not at Opendoor. All requests go through the proxy you set up in step 1.
import { OpendoorProvider, AddressEntry,} from '@opendoor/partner-sdk-client-react';import { OpendoorClient } from '@opendoor/partner-sdk-client-js-core';
// Points to YOUR backend — not to Opendoorconst client = new OpendoorClient({ baseURL: '/api/opendoor/v1',});
function App() { const handleAddressSelect = async (address) => { // This calls YOUR backend at /api/opendoor/v1/offer/create, // which uses the server SDK to forward the request to Opendoor const offer = await client.createOffer({ address }); console.log('Offer:', offer.opendoorOfferRequestId, offer.offerStatus); };
return ( <OpendoorProvider client={client}> <AddressEntry onAddressSelect={handleAddressSelect} appearance={{ theme: 'minimal' }} /> </OpendoorProvider> );}3. That’s it
The AddressEntry component handles address suggestions, address validation, and manual entry. When the user selects an address, your onAddressSelect callback fires with a typed Address object. You decide what to do next — create an offer, store the address, or navigate to another step.
The API key never leaves your server. The browser SDK only talks to your backend at /api/opendoor/v1/*.