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

albert-heijn-wrapper

v3.0.0

Published

Node.js wrapper for the Albert Heijn API

Downloads

138

Readme

Unofficial Node.js API wrapper for Albert Heijn.

Installation

npm install albert-heijn-wrapper

or

pnpm i albert-heijn-wrapper

then

import { AH } from 'albert-heijn-wrapper';

Basic usage

// Creates AH object
const ah = new AH();
// Gets product as reponse from ID
const product = await ah.product.get(200486);

More information about the functions and parameters can be found on the wiki.

Example usage

For all of these examples, please keep in mind that your function in which you request something should be async since the requests return a Promise.

Products

Let's say I want to find the names of the products called "Brood" but the products have to be gluten free, vegan and I want to sort on ascending price:

import { AH, SearchProductsSortType } from 'albert-heijn-wrapper';

const getGlutenFreeVeganBread = async () => {
  const ah = new AH();

  const { products } = await ah.product.search("Brood", {
    searchInput: {
      // These facets are undocumented
      facets: [
        {
          label: "product.properties.allergie",
          values: {
            values: ["zonder-gluten"]
          }
        },
        {
          label: "product.properties.dieet",
          values: {
            values: ["veganistisch"]
          }
        }
      ],
      page: {
        size: 3
      }
    },
    sortType: SearchProductsSortType.PriceHighLow
  });
  // Map to just the product names
  const names = products.map((product) => product.title);
  console.log(names);
};

getGlutenFreeVeganBread();
[
  'BFree Pita broodjes glutenvrij',
  'Smaakt Lijnzaadcrackers maanzaad less carb',
  'BFree Naan bread gluten free'
]

Stores

Let's say I want to find the address of the nearest store to a given location:

import { AH } from 'albert-heijn-wrapper';

const findNearestStore = async (latitude: number, longitude: number) => {
  const ah = new AH();
  // Find nearest store
  const { result } = await ah.store.search({
    filter: {
      location: {
        latitude,
        longitude
      }
    }
  });
  const store = result?.[0];
  console.log(`${store?.address?.street} ${store?.address?.houseNumber}, ${store?.address?.postalCode} ${store?.address?.city}`);
};

findNearestStore(50, 4);
Westkade 48, 4551BV Sas Van Gent

Authentication

Unfortunately, it is not possible to log in with your personal AH account, which means you won't be able to access your orders. All requests are made as a guest user.

Custom request

If you want to make your own GraphQL request, you can also do that:

import { AH, Stores } from "albert-heijn-wrapper";

const STORES_INFO_QUERY = `
  query StoresInformation($id:Int!) {
    storesInformation(id:$id) {
      id
      name
      address {
        street
        houseNumber
        houseNumberExtra
        postalCode
        city
        countryCode
      }
    }
  }
`;

type StoresInfoResponse = {
  // Type is exported from the wrapper
  storesInformation: Stores;
};

const getStoreInformation = async (id: number) => {
  const ah = new AH();
  const { storesInformation } = await ah.graphql<StoresInfoResponse>(STORES_INFO_QUERY, { id });
  // Response is typed (somewhat) correctly
  console.log(storesInformation.name);
};

// ID from store found from before
getStoreInformation(1809);
AH1809 SAS VAN GENT

The wrapper will automatically provide the access token necessary to make the request.