0.0.4 • Published 6 years ago

swiftype-interface v0.0.4

Weekly downloads
4
License
MIT
Repository
github
Last release
6 years ago

Test:

npm run test
test are pending.

Usage:

You can import or require this library as:

import SwiftypeInterface from 'swiftype-interface'

Comes with 2 methods

  • search.

  • suggestions.

The search and suggestions methods return a promise.

Search Example:

import SwiftypeInterface from 'swiftype-interface'

SwiftypeInterface.search({
  engine_key: 'xxxxxxx',
  q: 'query terms'
}).then(r => {
  // Do something with the response json object.
  console.log(r)
}).catch(err => console.log(err))

Suggestions example

import SwiftypeInterface from 'swiftype-interface'

SwiftypeInterface.suggestions({
  engine_key: 'xxxxxxx',
  q: 'query terms'
}).then(r => {
  // Do something with the response json object.
  console.log(r)
}).catch(err => console.log(err))

This library sends the configuration object as the request body (POST), this is only a utility and should be used as is

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago