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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@bounteous/vue-storefront-aem

v0.0.1

Published

Adobe Experience Manager integration with Vue Storefront

Downloads

1

Readme

Vue Storefront AEM Integration

The following guide walks you through setting up the Adobe Experience Manager (AEM) integration with Vue Storefront.

The main feature at this point is being able to make GraphQL queries to AEM which then returns Content Fragment data as JSON so that it can be rendered in Vue Storefront.

Installation


Install the module into your app:

npm install @bounteous/vue-storefront-aem --save

or

yarn add @bounteous/vue-storefront-aem

Setup


Register the module in the nuxt.config.js file:

export default {
  //...
  modules: [
    '@bounteous/vue-storefront-aem/nuxt',
  ]
  //...
}

Additionally, in the nuxt.config.js, you need to register the AEM module as a rawSource under the @vue-storefront/nuxt module:

export default {
  //...
  buildModules: [
    // ...
    ['@vue-storefront/nuxt', {
      useRawSource: {
        dev: [
          // ...
          '@bounteous/vue-storefront-aem',
          // ...
          ],
        prod: [
          // ...
          '@bounteous/vue-storefront-aem',
          // ...
          ],
      },
    }],
    // ...
  ]
  //...
}

Next, in middleware.config.js, configure the connection to your AEM instance:

module.exports = {
  integrations: {
    // ...
    aem: {
      location: '@bounteous/vue-storefront-aem/server',
      configuration: {
        serviceURL: 'http://localhost:4503',
        endpoint: '/content/_cq_graphql/global/endpoint.json',
        // Provide credentials if necessary (for example on Author)
        // See https://github.com/adobe/aem-headless-client-nodejs for more info.
        //auth: [process.env.AEM_USER, process.env.AEM_PW]
      },
    },
  }
}

Note that for real use cases you'll need to point the configuration to an AEM Publish instance because otherwise images won't render.

Content Rendering


First, copy the RenderContent.vue component from the integration package. You can later customize this to your needs.

cp node_modules/@bounteous/vue-storefront-aem/components/RenderContent.vue cms/

You may need to create the cms folder if it doesn't already exist in your project. Then add the package and Vue component import wherever you want to use it, for example in the Home.vue:

import { useContent } from '@bounteous/vue-storefront-aem';
import RenderContent from '~/cms/RenderContent.vue'

Add RenderContent to your list of components:

components: {
    RenderContent,
  },

And use it like this:

setup() {

  const {
    search,
    content,
    loading,
    error
  } = useContent();

  onSSR(async () => {
    const query = `
    {
      blogArticleAuthorList {
        items {
          name
          title
        }
      }
    }
    `;
    await search({ query: query });
  });

  return {
    content,
    loading,
    error,
  };
}

Lastly, render the content using the Vue component:

<RenderContent v-if="content" :content="content" />