Coder Social home page Coder Social logo

Comments (2)

kcm avatar kcm commented on June 27, 2024

Hi, yes, HTTPS is generally required for most use today. You'll need to either use a local proxy or disable checks as you've found without it, generally.

The Typescript client works with both JS and TS. You should be be able to use either with React 18. Please give that a shot and see if your issues remain.

I'm going to close this issue as the client is no longer maintained.

from weaviate-javascript-client.

trengrj avatar trengrj commented on June 27, 2024

@D3SERT-Eagle,

Regarding the query for the TS client, you may be confusing Weaviate API key vs OpenAI keys. The below config will connect with a Weaviate API key and OpenAI key for the OpenAI module:

const weaviate = require('weaviate-ts-client');

// Instantiate the client with the auth config
const client = weaviate.client({
  scheme: 'https',
  host: "some-endpoint.weaviate.network",
  apiKey: new weaviate.ApiKey("YOUR-WEAVIATE-API-KEY"),  // Replace w/ your API Key for the Weaviate instance
  headers: {"X-OpenAI-Api-Key": "<THE-KEY>"}
});

For your questions around CORS. Currently the header X-OpenAI-Api-Key will not be allowed by the browser unless explicitly allowed via CORS due to browser security settings. We have an open issue to add custom CORS settings to Weaviate weaviate/weaviate#2486. A current workaround would be to use NGINX or create a simple wrapper api around Weaviate which would also give you the benefit of keeping the OpenAI key hidden from users.

from weaviate-javascript-client.

Related Issues (20)

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.