Can we use apollo client without npm (on shopify theme basically)

I am trying to implement apollo client in our shopify theme using vanilla js. almost all the documentation and guides use npm to install the apollo client package. while on shopify we don’t use npm but instead use either cdn or locally served asset files. is there a way to use apollo in this scenario? or suggest any alternate for caching.

tried both of these ways but not working

console.log("inside apollo-client.js")
// const { ApolloClient, InMemoryCache, gql, HttpLink } = window['@apollo/client/core'];
import { ApolloClient, InMemoryCache, gql, HttpLink } from "https://unpkg.com/@apollo/[email protected]/core/core.cjs.js"

const client = new ApolloClient({
  link: new HttpLink({
    uri: 'https://my-shopify-store.myshopify.com/api/2023-07/graphql.json',
    headers: {
      'X-Shopify-Storefront-Access-Token': '******************'
    }
  }),
  cache: new InMemoryCache()
});

console.log("The client in apollo-client is: ", client)

// Make client globally accessible
window.apolloClient = client;