Created
March 26, 2023 17:28
-
-
Save bobvanluijt/cd3b967cdf3dd92e0cf9ee229542c987 to your computer and use it in GitHub Desktop.
Connect to Weaviate using an API-key using JavaScript
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const weaviate = require("weaviate-ts-client"); | |
// Create a secret based on the API key | |
const apiKey = new weaviate.ApiKey("4jne...9me1"); | |
// Create client objects | |
const client = weaviate.client({ | |
scheme: 'https', | |
host: 'your-cluster.weaviate.network', | |
apiKey: apiKey, | |
}); | |
// Run a command | |
result = client.misc | |
.metaGetter() | |
.do() | |
.then(res => { | |
console.log(res); | |
}) | |
.catch(err => { | |
console.error(err) | |
}); | |
console.log(result); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment