adonis-algoliasearch

0.1.2 • Public • Published

Adonis AlgoliaSearch

This package is a wrapper on top of algoliasearch-client-javascript.

npm version license

Getting Started

Install the package using the adonis CLI.

> adonis install adonis-algoliasearch

Follow instructions that are displayed (or read them here).

Configure

Register the provider in start/app.js:

const providers = [
  ...
  'adonis-algoliasearch/providers/AlgoliaSearchProvider'
]

Add a configuration file in config/algolia.js. For example:

'use strict'
 
const Env = use('Env')
 
module.exports = {
  id: Env.get('ALGOLIA_APP_ID'),
  index: Env.get('ALGOLIA_APP_INDEX'),
  apiKey: Env.get('ALGOLIA_API_KEY')
}

Usage

const AlgoliaSearch = use('AlgoliaSearch')
 
const index = AlgoliaSearch.index('projects')

The index returned is the client.initIndex of algoliasearch, you have then access to all methods.

Thanks

Special thanks to the creator(s) of AdonisJS for creating such a great framework.

License

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i adonis-algoliasearch

Weekly Downloads

0

Version

0.1.2

License

MIT

Unpacked Size

4.58 kB

Total Files

6

Last publish

Collaborators

  • benjamincanac