Skip to content

weaviate-tutorials/quickstart-typescript

Weaviate quickstart code - TypeScript

This repo contains TypeScript code to follow along with the Weaviate Quickstart. The code corresponds to the Quickstart as of 2024-07-31.

Run the project

There are two code files. Both files use the TypeScript v3 client.

  • quickstart-setup.ts This code creates a collection.
  • quickstart-query.ts This code queries the collection.

To run the project, follow these steps:

  1. Clone the repository.
  2. Install all relevant dependencies with npm run install.
  3. Configure environment variables to connect to a Weaviate instance.
  4. Use quickstart-setup.ts to create the example collection by running npm run setup in your terminal
  5. To make a query, edit quickstart-query.ts and uncomment the line that calls the query then run npm run query in your terminal.

Configure environment variables

The client connection uses these environment variables:

Variable Meaning
WCD_URL The URL for your Weaviate instance
WCD_API_KEY The authentication API key for your Weaviate instance
OPENAI_API_KEY The authentication API key for your OpenAI account

If you are using a Weaviate Cloud instance to run the Quickstart, the instance URL and API key are listed in the cluster details panel.

If you don't have an OpenAI key, register at OpenAI to get one.

For more information, see Environment variables

About

Working typescript example of the Weaviate quickstart

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published