@stattic/wpcloud-sdk
v0.0.10
Published
Generated TypeScript client for the WP.Cloud API.
Downloads
1,017
Readme
@stattic/wpcloud-sdk
Generated TypeScript client for the WP.Cloud API.
Use this package to call WP.Cloud from TypeScript spaces, automation, and infrastructure tools without hand-writing request serialization or response unwrapping code.
Install
npm install @stattic/wpcloud-sdkRuntime Configuration
import { createClientConfig } from "@stattic/wpcloud-sdk/runtime";
import { createClient } from "@stattic/wpcloud-sdk/generated/client.gen";
const client = createClient(
createClientConfig({
baseUrl: "https://wp.cloud/api",
headers: {
Authorization: `Bearer ${process.env.WPCLOUD_TOKEN}`,
},
}),
);createClientConfig configures the generated client for WP.Cloud request and
response conventions, including form-encoded request bodies, response envelope
unwrapping, and timeout-aware fetch errors.
