TypeScript SDK
Install and use the RankVectors TypeScript SDK
The TypeScript SDK is similar to the JavaScript SDK but with enhanced type safety. See the JavaScript SDK documentation for most examples.
Installation
npm install @rankvectors/rankvectors-typescript
Quick Start
import { RankVectors } from '@rankvectors/rankvectors-typescript'
const client = new RankVectors({
apiKey: 'YOUR_API_KEY'
})
// Create a project with full type safety
const project = await client.projects.create({
name: 'My Website',
domain: 'https://example.com',
preferredSdk: 'typescript'
})
console.log('Project created:', project.id)
Type Safety
The TypeScript SDK provides full type definitions:
import {
RankVectors,
Project,
Suggestion,
CreateProjectRequest,
UpdateProjectRequest
} from '@rankvectors/rankvectors-typescript'
const client = new RankVectors({
apiKey: process.env.RANKVECTORS_API_KEY!
})
// Fully typed request
const request: CreateProjectRequest = {
name: 'My Website',
domain: 'https://example.com',
preferredSdk: 'typescript'
}
// Fully typed response
const project: Project = await client.projects.create(request)
More Examples
See the JavaScript SDK documentation for detailed examples, or check the API Reference.