Skip to main content
The SDK lets you fetch a user’s upcoming or past events. You need the user ID and your API key (for example from process.env.PEERPOP_API_KEY).

Usage

const peerpop = require("peerpop");

// Upcoming events
const upcoming = await peerpop.events.list("upcoming", userId, process.env.PEERPOP_API_KEY);

// Past events
const past = await peerpop.events.list("past", userId, process.env.PEERPOP_API_KEY);

API

peerpop.events.list(type, userId, apiKey)
ParameterTypeDescription
typestring"upcoming" or "past"
userIdstringThe user ID whose events you want to list.
apiKeystringYour PeerPop API key.
Returns a Promise that resolves to the API response (parsed JSON). For the exact request/response shape, see the API Reference endpoints (POST /v1/events/upcoming and POST /v1/events/past).