Install the SDK
Choose your language and install the TopK SDK:Get your API key
Before you can use TopK, you need to obtain an API key from the TopK Console.TopK API keys are project-specific. Each project requires its own API key.
Go to the TopK Console
Visit console.topk.io in your browser.
Sign in or create an account
Authenticate with your credentials or create a new account if you don’t have one.
Navigate to your project
Select an existing project or create a new one. Projects help you organize your collections and manage access.
Keep your API key secure and never commit it to version control. Use environment variables or secret management systems to store it safely.
Initialize the client
Once you have your API key, initialize a TopK client. You’ll need to specify both your API key and a region.Configuration options
The client accepts additional configuration options:- Python
- JavaScript
Understanding regions
A region determines where your data is physically stored. TopK maps regions to specific cloud provider locations:| Region Name | Cloud Provider | Location |
|---|---|---|
aws-us-east-1-elastica | AWS | N. Virginia (us-east-1) |
aws-eu-central-1-monstera | AWS | Frankfurt (eu-central-1) |
- Data residency requirements - Where your data needs to be stored legally
- Latency - Choose a region close to your users or application
- Compliance - Specific regulatory requirements for data location
Using with SSR frameworks
If you’re using the TopK JavaScript SDK in a server-side rendering (SSR) environment, you may need additional configuration.Vite (Remix, Nuxt, SvelteKit, Astro)
Vite (Remix, Nuxt, SvelteKit, Astro)
If you’re using
topk-js in a Vite project with SSR, configure it as an external dependency:vite.config.ts
Webpack/Turbopack (Next.js)
Webpack/Turbopack (Next.js)
For Next.js projects, especially with App Router and Server Components, mark
topk-js as external:next.config.ts
Next steps
Now that you have TopK installed and configured, you’re ready to start building:Quickstart
Build your first search application in 5 minutes
Create a collection
Learn how to define schemas and create collections
Add documents
Insert your first documents
Query data
Search your collections with semantic and keyword search