@socialrouter/sdk package provides a typed client for the SocialRouter API. It handles authentication, error mapping, and optional polling for async extractions.
Installation
Quick example
What’s included
- Typed client with full TypeScript support — covers
extract,search, providers, account - Batch URLs on
extractvia theurls[]option for batch-capable actors - Per-call fallback control with the
fallbackflag (defaulttrue) - Error classes for each HTTP status (
AuthenticationError,InsufficientCreditsError,RateLimitError) - Polling helpers via
extractAndWait()andsearchAndWait() - Uses native
fetch()— requires Node.js 18+
Search
For query-driven services (e.g. Google Maps place search), usesearch / searchAndWait:
Next steps
Client reference
All methods, parameters, and return types.
Error handling
Error classes and how to handle failures.