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 🙏

© 2025 – Pkg Stats / Ryan Hefner

markprompt

v0.1.7

Published

A React component for adding GPT-4 powered search using the Markprompt API.

Downloads

3,637

Readme

Markprompt React

A headless React component for building a prompt interface, based on the Markprompt API.

Installation

Check out the starter template for a fully working example: Markprompt starter template.

In Motif, paste the following import statement in an MDX, JSX or TSX file:

import { Markprompt } from 'https://esm.sh/markprompt';

If you have a Node-based setup, install the markprompt package via npm or yarn:

# npm
npm install markprompt

# Yarn
yarn add markprompt

Usage

Example:

import { Markprompt } from 'markprompt';

function MyPrompt() {
  return <Markprompt projectKey="<project-key>" model="gpt-4" />;
}

where project-key can be obtained in your project settings, and model is the identifier of the OpenAI model to use for completions. Supported models are:

  • Chat completions: gpt-4 gpt-4-0314 gpt-4-32k gpt-4-32k-0314 gpt-3.5-turbo gpt-3.5-turbo-0301
  • Completions: text-davinci-003, text-davinci-002, text-curie-001, text-babbage-001, text-ada-001, davinci, curie, babbage, ada

If no model is specified, gpt-3.5-turbo will be used.

Styling

The Markprompt component is styled using Tailwind CSS, and therefore requires a working Tailwind configuration. We are planning to make it headless, for more flexible options.

Configuration

You can pass the following props to the component:

| Prop | Default value | Description | | ------------------ | ------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | projectKey | | Your project's API key, found in the project settings. | | model | gpt-3.5-turbo | The OpenAI completions model to use. Supported values: gpt-4, gpt-4-0314, gpt-4-32k, gpt-4-32k-0314, gpt-3.5-turbo, gpt-3.5-turbo-0301, text-davinci-003, text-davinci-002, text-curie-001, text-babbage-001, text-ada-001, davinci, curie, babbage, ada | | settings. | | iDontKnowMessage | Sorry, I am not sure how to answer that. | Fallback message in can no answer is found. | | placeholder | Ask me anything... | Message to show in the input box when no text has been entered. |

Example:

<Markprompt
  projectKey="..."
  model="..."
  iDontKnowMessage="Sorry, I don't know!"
  placeholder="Ask Acme docs..."
/>

Whitelisting your domain

Usage of the Markprompt API is subject to quotas, depending on the plan you have subscribed to. Markprompt has systems in place to detect abuse and excessive usage, but we nevertheless recommend being cautious when offering a prompt interface on a public website. In any case, when using the production project key, the prompt will only work on domains you have whitelisted through the Markprompt dashboard.

Local development

When developing locally, for instance on localhost, use the development test key instead. This allows you to access the API from a non-whitelisted domain. For that reason, make sure to keep this key private.

Starter Template

For a fully working setup based on Next.js + Tailwind, check out the Markprompt starter template.

Community

Authors

This library is created by the team behind Motif (@motifland).

License

MIT