Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
apollo-algolia-autocomplete
Advanced tools
This repo contains a custom Algolia autocomplete React component that powers the search bar in various Apollo GraphQL sites.
npm i apollo-algolia-autocomplete
https://apollo-algolia.netlify.app/
// App.js
import React from 'react';
import Autocomplete from './components/autocomplete';
function App() {
return (
<div>
...
<Autocomplete
appId={'YOUR_APP_ID'}
apiKey={'YOUR_API_KEY'}
currentSource="blog"
docset="react"
/>
{/* content that should show up beneath the search bar when the search modal is closed */}
</div>
);
}
export default App;
Name | Description | type | Default value | Required |
---|---|---|---|---|
appId | Your Algolia app ID | string | -- | yes |
apiKey | Your Algolia API key | string | -- | yes |
currentSource | Algolia index name ('docs', 'blog', 'odyssey') that you want to appear first in the search results | string | 'docs' | no |
docset | Name of the docset by which you want to filter the documentation results | string | '' | no |
sources | Algolia indices to append to the default Autocomplete sources | object | defaultSources var in Autocomplete.js | no |
If a currentSource
prop is provided, the search result sources will be sorted to put the currentSource
at the top.
Any additional props will be passed to the autocomplete
function from @algolia/autocomplete-js.
**This component has the Algolia sources baked in and is therefore not customizable on that front. The only customizable aspect of the Algolia sources is which source results are displayed first (via the currentSource
prop)
This package uses the autocomplete-theme-classic
to provide some default styling. It also uses vanilla CSS to override some of those defaults to better fit the Apollo brand.
You can find the different class names and CSS variables already being used by autocomplete-theme-classic
in the Algolia docs. This will enable you to override any of them with your own styles. Create a .css
file with any overrides and import it wherever you're rendering your Autocomplete
component.
**Some of this package's custom styles stray a bit from the default Algolia theme. Below are the additional classes that have been added:
/example
optionalFilters
option<p>
hitsPerPage
? Not sure if also happens for other categories)FAQs
Algolia autocomplete in React
The npm package apollo-algolia-autocomplete receives a total of 121 weekly downloads. As such, apollo-algolia-autocomplete popularity was classified as not popular.
We found that apollo-algolia-autocomplete demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.