@yext/search-core
TypeScript icon, indicating that this package has built-in type declarations

2.5.1 • Public • Published

Search Core


Search Core is a networking library for interacting with the Yext Search API.

Full Documentation

Features

  • Works in both the browser and Node.js
  • 100% TypeScript, with detailed request and response models
  • Compatible with both CommonJS and ES6 imports
  • Offers a ponyfilled ES5 bundle which doesn't pollute the global namespace

Getting Started

For a full getting started walk through, view our official Hitchhiker Guide.

First, install Search-core via npm:

npm install @yext/search-core

Next, import and initialize the core library in your application.

The apiKey and experienceKey will come from your Search experience on yext.com. You can signup for a free trial at https://www.yext.com/free-trial/.

import { provideCore } from '@yext/search-core';

const core = provideCore({
  apiKey: '<your api key>',
  experienceKey: '<one of your experience keys>',
  locale: 'en',
  experienceVersion: 'PRODUCTION',
});

To use the library with Node, use the following import instead:

const { provideCore } = require('@yext/search-core');

Now that the core is initialized, let's run a search on an "FAQs" vertical.

core.verticalSearch({
  verticalKey: 'FAQs',
  query: 'What is Yext Search?',
}).then(results => {
  // Do something with the search results
}).catch(err => {
  // Handle errors thrown by the core library
});

Explanation of Builds

  • The ESM (ES6) build will be used automatically by module bundlers that support it (e.g. Webpack). It can be specified directly by importing @yext/search-core/lib/esm
  • The CommonJS build will be used automatically by Node, but it can be specified directly by importing @yext/search-core/lib/commonjs
  • The Legacy (UMD) bundle should be used for supporting IE11 out of the box. It is compiled to ES5 and it contains the necessary ponyfills for IE11. If your application already contains polyfills, we recommend bundling one of the other builds in order to prevent your application from including duplicate polyfills. This bundle can be specified by importing @yext/search-core/legacy

And that's it! See our documentation for a full list of supported API calls.

License

Yext Search-core is an open-sourced library licensed under the BSD-3 License.

Third Party Licenses

The licenses of our 3rd party dependencies are collected here: THIRD-PARTY-NOTICES.

Package Sidebar

Install

npm i @yext/search-core

Weekly Downloads

2,171

Version

2.5.1

License

BSD-3-Clause

Unpacked Size

1.38 MB

Total Files

812

Last publish

Collaborators

  • souravkumar
  • anguyenyext
  • gargsi
  • manash-rauta
  • rsalunke
  • johnnguyen
  • saivythik
  • scheerla
  • a_ashwik
  • slapshot-bot
  • ataing
  • prisharma
  • ttanushree
  • nlanjewar
  • abhishekbajpai
  • ajaybenno
  • tpotla
  • surya_yext
  • nbramblett
  • nsiskind
  • saahith
  • emilyzhang777
  • sscott24
  • ydaniel
  • junpark1213
  • dsurducan
  • afriedman00
  • lilwang
  • dgurland
  • dwon
  • htamirepi
  • ajgist
  • yunxiashi
  • emilyfranklin
  • msporer-yext
  • pgill
  • snagabhirava
  • twhiteyext
  • ewu42
  • bryanreed
  • dlsgusrn7577
  • klu
  • paigep
  • stellali
  • petya182
  • ptroupgalligan
  • syhanley
  • zhengzhi
  • mdavis-yext
  • jimboh
  • jballschneider
  • jknutsonn
  • jamesyang14
  • jfromm
  • tobyko
  • lymarrie
  • levyshi9945
  • mkilpatrick
  • baigel1
  • koyoldc
  • nricartsanchez
  • roser11
  • dkang3021
  • xlin97
  • mleifer
  • pmomesso
  • eefi
  • mxs2019
  • jaredhood
  • nmanu
  • jrhoads
  • npark
  • lki9419
  • mancusi
  • rchhatre
  • mtusman
  • mdavish
  • apavlick
  • yext_eng_npm
  • benmcginnis
  • kunal-p
  • data-enabler
  • tmeyer2115
  • mbowman
  • jronkin_yext
  • oshi
  • svc_jenkins_consulting_yext
  • cblair_yext
  • mwoon
  • willgorick
  • bhaines-yext
  • aliang_yext
  • zgeier
  • sgresh_yext
  • rconsalo
  • stephenrva
  • jbaik
  • sjayakumar
  • tritpham
  • ttimblin
  • sharvey
  • wenright-yext
  • npatel94
  • telliottyext
  • johncho92
  • canderson_yext
  • ssaunders
  • sukim
  • rpope
  • eal172
  • peteros
  • jachen1997
  • jesuyed
  • ytruong
  • joshuahsueh