The official Node SDK (@playcamp/node-sdk) provides a type-safe way to integrate with the PlayCamp API. It handles authentication, pagination, retries, and error handling.
Installation
Requirements: Node.js >= 18.0.0
Quick Start
Client vs Server
The SDK provides two classes depending on your API key type:
Never use PlayCampServer or expose your Server Key on the client side.
Client Resources
Server Resources
Configuration
Environments
You can also specify a custom URL directly:
List endpoints return paginated results:
Use async iteration to automatically page through all results:
Error Handling
The SDK throws typed errors for different scenarios:
Webhook Verification
The SDK provides utilities for verifying incoming webhook signatures:
For testing, you can generate signatures locally:
See the Webhook Events page for more details on webhook event types and payloads.
Example Project
For a complete working example with Express server and Web UI covering all API endpoints, see the playcamp-node-sdk-example repository.
TypeScript Types
The SDK exports all types for use in your application: