Code Monkey home page Code Monkey logo

deepgram-node-proxy's Introduction

Example Node Proxy for Deepgram

Discord Contributor Covenant

Despite our SDK working in the browser, our API is restricted by CORS. Our SDK has an option to utilise a REST proxy, so you can still benefit from the SDK's functionality in the browser.

It is your responsibility to secure this application behind your own authentication, or risk others using your Deepgram credit for their own purpose.

This is an example proxy, built using http-proxy. Please consider securing it behind your own client authentication before making it available generally.

Setup

Clone this repository from GitHub.

Initial installation

Install the dependencies to be able to run this application.

npm i

Configuring your SSL Identity

Run the following to generate an PKCS12 file, to act as your SSL indentity when making a secure request to the Deepgram API. This does not affect your ability to run this proxy behind it's own SSL.

Generate 2048-bit RSA private key:

openssl genrsa -out key.pem 2048

Generate a Certificate Signing Request:

openssl req -new -sha256 -key key.pem -out csr.csr

Generate a self-signed x509 certificate suitable for use on web servers.

openssl req -x509 -sha256 -days 365 -key key.pem -in csr.csr -out certificate.pem

Create SSL identity file in PKCS12 as mentioned here

openssl pkcs12 -export -out certificate.p12 -inkey key.pem -in certificate.pem

Setting up your environment variables

Copy the sample.env to .env and fill out the variables.

ALLOWED_ORIGIN=http://localhost:3000 # the origin of the application making the REST requests to Deepgram
PORT=4433 # the port you intend to run your proxy on
DEEPGRAM_API_KEY=5364knj5hgbnipjgp9h490g84h245h524h # your Deepgram API with atleast the usage:write scope

Running locally

npm run dev

Development and Contributing

Interested in contributing? We ❤️ pull requests!

To make sure our community is safe for all, be sure to review and agree to our Code of Conduct. Then see the Contribution guidelines for more information.

Getting Help

We love to hear from you so if you have questions, comments or find a bug in the project, let us know! You can either:

deepgram-node-proxy's People

Contributors

lukeocodes avatar

Forkers

bitnom

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.