npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@addresso/react

v0.1.0

Published

React hooks and components for Addresso UK address lookups

Readme

@addresso/react

React hooks and components for Addresso UK address lookups.

Installation

npm install @addresso/react

Quick start

Using the component

import { AddressoProvider, AddressoLookup } from "@addresso/react";
import "@addresso/react/styles.css";

function App() {
  return (
    <AddressoProvider apiKey="ak_...">
      <AddressoLookup onSelect={(address) => console.log(address)} />
    </AddressoProvider>
  );
}

Using the hook

import { AddressoProvider, useAddresso } from "@addresso/react";

function AddressForm() {
  const { lookupPostcode, addresses, isLoading, error } = useAddresso();

  return (
    <div>
      <button onClick={() => lookupPostcode("SW1A 1AA")}>
        {isLoading ? "Loading..." : "Look up"}
      </button>
      {error && <p>{error.message}</p>}
      <ul>
        {addresses.map((a) => (
          <li key={a.udprn}>
            {a.building_number} {a.street}, {a.town} {a.postcode}
          </li>
        ))}
      </ul>
    </div>
  );
}

function App() {
  return (
    <AddressoProvider apiKey="ak_...">
      <AddressForm />
    </AddressoProvider>
  );
}

Using the client directly (no React)

import { AddressoClient } from "@addresso/react";

const client = new AddressoClient({ apiKey: "ak_..." });

const result = await client.lookupPostcode("SW1A 1AA");
console.log(result.addresses);

const search = await client.searchAddresses({ q: "10 Downing Street" });
console.log(search.addresses);

API

<AddressoProvider>

Wraps your app and provides the API client to all hooks and components.

| Prop | Type | Required | Description | | --------- | -------- | -------- | -------------------------------------------- | | apiKey | string | Yes | Your Addresso API key (ak_...) | | baseUrl | string | No | Override API base URL (default: https://addresso.co.uk) |

useAddresso()

Headless hook for address lookups. Must be used within <AddressoProvider>.

Returns:

| Property | Type | Description | | ----------------- | ----------------------------------------------- | ---------------------------------- | | lookupPostcode | (postcode: string) => Promise<PostcodeLookupResponse> | Look up addresses by postcode | | searchAddresses | (params: AddressSearchParams) => Promise<AddressSearchResponse> | Search addresses by various fields | | addresses | AddressoAddress[] | Addresses from the last lookup | | isLoading | boolean | Whether a request is in progress | | error | Error \| null | Error from the last request | | reset | () => void | Clear addresses, error, and loading state |

<AddressoLookup>

Ready-made postcode lookup component with input, button, and dropdown. Must be used within <AddressoProvider>.

| Prop | Type | Default | Description | | ---------------- | ----------------------------------------- | ----------------- | ----------------------------------- | | onSelect | (address: AddressoAddress) => void | Required | Called when user selects an address | | placeholder | string | "Enter postcode" | Input placeholder text | | buttonText | string | "Find address" | Search button text | | className | string | — | Additional CSS class | | style | CSSProperties | — | Inline styles | | renderAddress | (address: AddressoAddress) => ReactNode | — | Custom address rendering | | disabled | boolean | false | Disable the input and button | | inputLabel | string | "Postcode" | Label for the input field |

AddressoClient

Standalone client class with no React dependency.

const client = new AddressoClient({ apiKey: "ak_...", baseUrl: "..." });
await client.lookupPostcode("SW1A 1AA");
await client.searchAddresses({ q: "Buckingham Palace", limit: 10 });

Types

AddressoAddress

interface AddressoAddress {
  postcode: string;
  town: string;
  locality: string;
  sub_locality: string;
  street: string;
  secondary_street: string;
  building_number: string;
  building_name: string;
  sub_building: string;
  po_box: string;
  department: string;
  organisation: string;
  udprn: number;
  postcode_type: string;
  delivery_point_suffix: string;
  latitude: number | null;
  longitude: number | null;
}

AddressSearchParams

interface AddressSearchParams {
  q?: string;
  postcode?: string;
  town?: string;
  street?: string;
  building_name?: string;
  building_number?: string;
  organisation?: string;
  limit?: number;
}

Styling

Import the default styles for <AddressoLookup>:

import "@addresso/react/styles.css";

All classes use BEM naming (addresso-lookup__*) so you can easily override them.

License

MIT