@ideal-postcodes/sdk
v0.6.0
Published
Fetch-based, treeshakable TypeScript SDK for api.ideal-postcodes.co.uk
Readme
Ideal Postcodes TypeScript SDK
Typed API calls over native fetch for browsers and Node.js 22 or later.
npm install @ideal-postcodes/sdkimport { createIdpcClient, findAddress } from "@ideal-postcodes/sdk";
const client = createIdpcClient({ apiKey: "ak_test" });
const { data } = await findAddress({
client,
query: { query: "9 Malyons Road" },
});
console.log(data.result.hits);HTTP errors throw ApiError, with the HTTP status and the API's error code and message. Pass throwOnError: false to receive { data, error } instead.
Documentation covers authentication, errors, autocomplete and optional React/Preact adapters. Named ESM imports support tree-shaking.
License
SEE LICENSE IN LICENSE
