Skip to content
This repository has been archived by the owner on Sep 12, 2024. It is now read-only.
/ middy-algolia Public archive

Injects Algolia into context

Notifications You must be signed in to change notification settings

airporting/middy-algolia

Repository files navigation

License: MIT Static Badge Static Badge test

middy-algolia

Injects AlgoliaSearch into AWS Lambda context.

import algoliaMiddleware from '@airporting/middy-algolia';

middy(yourHandler)
  .use(
    algoliaMiddleware({
      appId: 'ALGOLIA_APP_ID',
      apiKey: 'ALGOLIA_ADMIN_KEY',
    })
  );

Usage

export default async (params, { algolia }) => {
  const index = algolia.initIndex('indexName');
};