New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

nuxt-algolia

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nuxt-algolia

Simple wrapper/integration for Algolia InstantSearch

latest
Source
npmnpm
Version
0.2.0
Version published
Maintainers
1
Created
Source

nuxt-algolia

npm version npm downloads Github Actions CI Codecov License

Simple wrapper/integration for Algolia InstantSearch.

📖 Release Notes

Setup

  • Add nuxt-algolia dependency to your project
yarn add nuxt-algolia # or npm install nuxt-algolia
  • Add nuxt-algolia to the modules section of nuxt.config.js
{
  modules: [
    'nuxt-algolia'
  ],

  publicRuntimeConfig: {
    algolia: {
      applicationId: [YOUR APPLICATION ID],
      apiKey: [YOUR API KEY],
    }
  }
}

Usage

Component

asyncData

async asyncData ({ $algolia }) {
  const index = $algolia.initIndex('instant_search');
  const results = await index.search('Google');
  return results;
}

methods/created/mounted/etc

methods: {
  async fetchResults(query) {
    const index = this.$algolia.initIndex('instant_search');
    this.results = await index.search(query);
  }
}

Store actions (including nuxtServerInit)

// In store
{
  actions: {
    async fetchGoogleProducts ({ commit }) {
      const index = this.$algolia.initIndex('instant_search');
      const products = await index.search('Google');
      commit('SET_PRODUCTS', products);
    }
  }
}

Development

  • Clone this repository
  • Install dependencies using yarn install
  • Start development server using yarn dev

License

MIT License

FAQs

Package last updated on 22 Jul 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts