0.0.5 • Published 6 years ago

@wildpow/datocms-search v0.0.5

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

DatoCMS site search for ⚛️

DatoCMS Site Search is a way to deliver tailored search results to your site visitors. You can think of it as a replacement for the now discontinued Google Site Search.

This is based on DatoCMS's existing search repo found here

Installation

npm install @wildpow/datocms-search
or
yarn install @wildpow/datocms-search

Usage

import React from "react";
import { SearchComponent, DatoCmsSearch } from "@wildpow/datocms-search";

const App = () => {
  const client = new DatoCmsSearch("YOUR_API_TOKEN_HERE", "production");
  return (
    <div>
      <SearchComponent client={client} />
    </div>
  );
};
PropsTypeDefaultDescription
clientclass instanceundefinednew class instance of DatoCmsSearch passing your API key
perPagenumberundefinedNumber of search resaults per page
initialQuerystringundefinedInitial query passed into search widget
localesarrayundefined[{ label: "English", value: "en" }, { label: "Italian", value: "it" }]
initialLocaleStringundefined2 letter value of default display language

Documentation

Read the complete documentation on our site.