Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
operand-js
Advanced tools
A component library for the Operand API.
npm i operand-js
Install our npm package that contains our component.
Note: Skip this step if you are a ‘managed’ user. We will send you everything you need.
You will need to specify which document sets you want to search over via their setID. You can find this by making an API request as detailed here in our documentation or by getting it from the URL in your dashboard.
You can list any number of document sets to be searched over in a given search component.
Note: Skip this step if you are a ‘managed’ user. We will send you everything you need.
Because this API key will be exposed client side we strongly recommend setting very specific scopes. For the Operand-JS to work at its most basic functionality is only requires the “search” scope on the setIDs that are specified in the component. If you want feedback functionality an additional feedback scope is required on those same sets.
Scopes are specified as “’scope’:’setid’” in a comma separated list during API Key creation.
First you need to import the component into your project.
import { SearchBar } from 'operand-js';
Then you will create the component by providing the necessary properties.
<SearchBar apiKey="Your APIKey" setIDs={['String Array of Document Set IDs']}>
{'At Least One Child'}
</SearchBar>
Name | Type | Purpose |
---|---|---|
apiKey | string | Access to Operand API |
setIDS | string[] | Sets to search over with Operand API |
children | React.ReactNode | Rendering the search component. It will not render itself without a child. |
For your child we recommend rendering a fake search bar or just a search icon. It will be clickable to open the search modal.
<SearchBar
apiKey="Your APIKey"
setIDs={['String Array of Document Set IDs']}
placeholderText="Text you want shown in modal input"
feedback={true}
keyboardShortcut="A keyboard shortcut to open the modal"
>
{'At Least One Child'}
</SearchBar>
Name | Type | Purpose |
---|---|---|
placeholderText | string | Customize the input bar in the modal |
feedback | boolean | Sends us anonymous feedback about what results were clicked and helps improve your search. |
keyboardShortcut | string | Uses the react-hotkeys-hook package. See this section for how to define a shortcut. |
For the keyboardShortcut an example is “ctrl+k”.
Currently there is no custom styling for the component and we used tailwind to style the component.
We have provided a minified tailwind.css file that can be imported to style the component for non-tailwind projects.
import 'operand-js/dist/tailwind.css';
Projects with tailwind must simply include the node-module in the contents section of ‘tailwind.config.js’.
module.exports = {
content: [
....
"./node_modules/operand-js/dist/*.js",
],
....
}
Send us a message at support@operand.ai.
FAQs
A component library for the Operand API.
The npm package operand-js receives a total of 0 weekly downloads. As such, operand-js popularity was classified as not popular.
We found that operand-js demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 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.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.