Universal typed API client for the Extra Chill platform. One package, every context — WordPress blocks, React Native, Node.
npm install @extrachill/api-clientimport { ExtraChillClient, FetchTransport } from '@extrachill/api-client';
const client = new ExtraChillClient(
new FetchTransport({
baseUrl: 'https://extrachill.com/wp-json',
getAuthHeaders: () => ({ Authorization: `Bearer ${token}` }),
onUnauthorized: () => handleLogout(),
})
);
const artist = await client.artists.getArtist(42);
const feed = await client.activity.getFeed();
const events = await client.events.calendar({ venue: 'continental-club' });import { ExtraChillClient } from '@extrachill/api-client';
import { WpApiFetchTransport } from '@extrachill/api-client/wordpress';
import apiFetch from '@wordpress/api-fetch';
const client = new ExtraChillClient(new WpApiFetchTransport(apiFetch));
const leaderboard = await client.users.leaderboard();
await client.blog.generateBandName();import { ExtraChillClient, FetchTransport } from '@extrachill/api-client';
const client = new ExtraChillClient(
new FetchTransport({
baseUrl: 'https://extrachill.com/wp-json',
getAuthHeaders: () => ({
Authorization: `Basic ${btoa('user:application-password')}`,
}),
})
);
await client.admin.syncTaxonomies();ExtraChillClient
├── Transport (swappable)
│ ├── FetchTransport ← native fetch (RN, Node, browser)
│ └── WpApiFetchTransport ← @wordpress/api-fetch (WP blocks)
└── Resources (typed endpoint groups)
├── auth login, register, refresh, Google OAuth, browser handoff
├── artists CRUD, links, socials, roster, subscribers, analytics
├── events calendar, venues, geocode, submissions
├── blog band name, rapper name, voting, AI adventure
├── community drafts, upvotes, taxonomy counts
├── analytics event tracking, summaries, link page analytics
├── media upload, delete
├── shop products, orders, Stripe Connect, shipping
├── users search, leaderboard, onboarding
├── admin access requests, memberships, team, QR codes
├── activity feed, object hydration
└── seo config, audits
| Entry | Import | Dependencies | Use In |
|---|---|---|---|
| Main | @extrachill/api-client |
None | React Native, Node, browsers |
| WordPress | @extrachill/api-client/wordpress |
@wordpress/api-fetch |
WordPress blocks |
The WordPress transport is a separate entry point so the main bundle stays dependency-free.
All request/response types are exported from the main entry:
import type {
Artist,
CalendarEvent,
LoginResponse,
ShopProduct,
ActivityItem,
} from '@extrachill/api-client';These are the single source of truth — both web and mobile import from the same place.
import { ApiError } from '@extrachill/api-client';
try {
await client.artists.getArtist(999);
} catch (error) {
if (error instanceof ApiError) {
console.log(error.code); // 'not_found'
console.log(error.status); // 404
console.log(error.message); // 'Artist not found'
}
}All endpoints are under extrachill/v1. This client does not call datamachine/v1 directly — events data (calendar, venues, geocode) is accessed through Extra Chill wrapper endpoints that internally call Data Machine abilities. This keeps the API surface clean and Data Machine theme-agnostic.
extrachill-app— Expo/React Native mobile appextrachill-artist-platform— Artist management blocksextrachill-blog— Interactive blog blocksextrachill-community— Community leaderboardextrachill-users— Auth blocksextrachill-events— Event submission, calendar, venuesextrachill-analytics— Analytics dashboardextrachill-seo— SEO audit dashboard
GPL-2.0+