Missing access token when querying Shopify API from custom app

Actually, it turns out the problem was the tutorial was meant for instantiating a shopifyApi, not a shopifyApp. To instantiate a shopifyApp, I needed to add the configuration parameters into the api object. Here’s how I’ve now configured my shopifyApp:

const shopify = shopifyApp({
  api: {
    apiVersion: LATEST_API_VERSION,
    restResources,
    billing: undefined,
    apiKey: process.env.APP_API_KEY,
    apiSecretKey: process.env.ADMIN_API_ACCESS_TOKEN,
    isCustomStoreApp: true,
    scopes: [
      'write_customers',
      'write_products'
    ],
    isEmbeddedApp: false,
    hostName: process.env.HOST_NAME,  
  },
  auth: {
    path: "/api/auth",
    callbackPath: "/api/auth/callback",
  },
  webhooks: {
    path: "/api/webhooks",
  },
  sessionStorage: new SQLiteSessionStorage(DB_PATH),
});

And that’s why the documentation had the line correct as the below, since shopify referred to shopifyApi, not shopifyApp:

const session = shopify.session.customAppSession("my-shop.myshopify.com");