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

create-secure-chatgpt-app

v0.0.6

Published

Create Pangea-powered secure OpenAI apps with a single command

Downloads

16

Readme

secure-chatgpt

The goal of this boilerplate is to show how developers can use Pangea's various services to secure their own ChatGPT implementation.

We are using the following Pangea services:

  • Auth Service: To add authentication to a NextJS App and prevent unauthenticated users from using ChatGPT
  • Redact Service: To redact sensitive information from the user's prompt before the entry reaches to OpenAI API
  • Audit Service: To audit the user prompts
  • Reputation/Threat Intel services: To detect and neutralize the malicious URLs and domain names in the OPENAI API's responses.

For more in depth information please go to our blog about protecting PII from ChatGPT models

If you would like to see a demo of this application, go to this youtube video

Setup

Pre Reqs Check

In order to run this application you are going to need:

  • Node
  • OpenAI
  • Pangea Account

OpenAI API Key

  1. Create an account to sign in to OpenAI
  2. Once signed in, this link will begin the flow to create an API Token.
  3. Name your token.
  4. Copy the API Key and save it somewhere. We will not be able to access it again.

Enable Pangea Services

  1. Create and sign into your Pangea account

  2. Once you land on the Pangea User Console, You can see AuthN, Secure Audit Log, Redact, IP Intel, and Domain Intel on the left. Note that the Domain is shown on the right and will be needed when we run the application.

  3. Select AuthN to enable and begin the token creation process. While creating the token, you can enable it for all the services we are going to require for this application: AuthN, Redact, IP Intel, URL Intel, Secure Audit Log, and Domain Intel.

  1. Landing on the AuthN Service Overview page you'll see all the token information you will need from Pangea to run the application. Copy these values into a note pad or keep this page open.
  1. Go to the Redirects tab and add http://localhost:3000 to the redirect list.

NOTE: By going to Customize > View project branding, you'll be able to customize your login page

  1. Go to back to the Main Menu and then navigate to Redact > Rulesets. This is where you will be able to configure what gets redacted and how. For the demo, it's recommended that we enable redaction for:
    • PII: email address and phone number
    • US Identification Numbers: US Social Security Number

Setup App & Run

During the generator script, you will need the following information ready:

  • OpenAI API Key: If you haven't done so, please head over to the OpenAI site and register a user and get an API Key for using OpenAI services https://platform.openai.com/account/api-keys
  • Pangea Service Token: Go to Pangea Console and create a service token that has access to AuthN, Redact, URL Intel, File Intel, and Audit services https://console.pangea.cloud/
  • Pangea Domain: This is visible in the project settings on the Pangea Console
  • Pangea AuthN Client Token and URL: Located in the AuthN settings of your project on the Pangea Console, and copy the Authn Client Token, Hosted Login URL.

Now that you have the necessary information to go through the setup

  1. Run the following command, and enter the required information when you are prompted.
    npx create-secure-chatgpt-app@latest
  1. Input the appropriate token values

  2. Now you can cd into the newly generated app directory and run

    npm run dev
  1. If everything went well, you should be able to open a browser and navigate to
http://localhost:3000