npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@xpressai/docusaurus-vecto-search

v0.0.5

Published

Vecto search plugin for Docusaurus v2

Downloads

2

Readme

Docusaurus Vecto Search

Welcome to the Docusaurus Vecto Search repository! This plugin will provide a Vecto powered search for your Docusaurus website.

Setup

1) Install Plugin

Navigate to the root of your Docusaurus project, then install via

npm install @xpressai/docusaurus-vecto-search

2) Configuration

In your docusaurus.config.js file, add the following to the themes array:

themes: [
      [
        "docusaurus-vecto-search",
        /** type {import("docusaurus-vecto-search").PluginOptions} */
        ({
          vecto_public_token: "",
          vector_space_id: 123,
          top_k: 15
        }),
      ],
]

Alternatively, you can also set your config to fetch Vecto vars from your ENV using process.env, ie vecto_public_token = process.env.vecto_public_token.

For the token, sign up for your access here.

3) Add Vecto User Token To Environment Variables

You'll need to set the VECTO_USER_TOKEN environment variable for the docusaurus-vecto-search plugin to function properly. This token is private and is not exposed during the Docusaurus build process as it is not added in the docusaurus config.

For CI/CD (e.g., GitHub Actions)

If you are deploying your Docusaurus site using a CI/CD service like GitHub Actions, set VECTO_USER_TOKEN as an environment variable in your workflow configuration. You can use repository secrets to securely store the token.

For Local Development

For local development, you can export the VECTO_USER_TOKEN in your terminal:

export VECTO_USER_TOKEN=your_token_value_here

Make sure to replace your_token_value_here with your actual Vecto user token.

Alternatively, you can create a .env file in the root of your Docusaurus project and add the token there:

VECTO_USER_TOKEN=your_token_value_here

Using a .env file ensures that the token remains set between terminal sessions. Make sure to replace your_token_value_here with your actual Vecto user token.

4) Build!

Finally, build your Docusaurus website with the new search configuration:

yarn build

That's it! Your Docusaurus website should now be set up with the docusaurus-vecto-search functionality.

Local Plugin Development

If you would like to modify the current Vecto Search plugin, here are the steps:

  1. Clone and install the repository:

    git clone https://github.com/XpressAI/docusaurus-vecto-search
    cd docusaurus-vecto-search
    yarn install
  2. Create a symbolic link for the project:

    yarn link
  3. In a different directory, create a new Docusaurus website (ensure you're using version 2.4.3 or newer).

    yarn create docusaurus my-website

    You can also use an existing Docusaurus project, but ensure it's a recent version.

  4. Move into the Docusaurus project directory and install its dependencies:

    cd my-website
    yarn install
  5. Link the previously linked docusaurus-vecto-search to this Docusaurus project:

    yarn link docusaurus-vecto-search
  6. Build the Docusaurus project:

    yarn build

Special Thanks

Forked from Docusaurus Search Local.