Skip to content

vectorize-io/vectorize-connect-sdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

96 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Vectorize Connect SDK

TypeScript/JavaScript SDK for building multi-user connectors that integrate cloud storage platforms such as Google Drive with the Vectorize platform.

What is this?

The Vectorize Connect SDK enables you to:

  • Build applications where multiple users can connect their cloud storage accounts
  • Let users select specific files to be processed by Vectorize RAG pipelines
  • Manage user authentication and file permissions
  • Handle OAuth flows without building the authentication infrastructure yourself

This SDK is designed for developers who want to integrate multiple users' documents into their AI-powered applications using Vectorize's infrastructure.

SDK Installation

NPM

npm install @vectorize-io/vectorize-connect

Yarn

yarn add @vectorize-io/vectorize-connect

pnpm

pnpm add @vectorize-io/vectorize-connect

Quick Start

1. Install the SDK

npm install @vectorize-io/vectorize-connect

2. Set up your environment

import { createGDriveConnector } from '@vectorize-io/vectorize-connect';

const vectorizeConfig = {
  organizationId: 'your-org-id',
  authorization: 'your-api-key'
};

3. Create a connector and add users

// Create a connector
const connector = await createGDriveConnector({
  connectorName: 'My Google Drive Connector',
  config: vectorizeConfig
});

// Add users via OAuth
const authUrl = await getGDriveAuthURL({
  connectorId: connector.id,
  redirectUri: 'https://your-app.com/callback',
  config: vectorizeConfig
});

Documentation

For comprehensive guides and examples:

SDK-Specific Documentation

Implementation Examples

Supported Platforms

Google Drive

Dropbox

Notion

Two Approaches: Vectorize-Managed vs White-Label

Vectorize-Managed OAuth (Recommended for Getting Started)

  • Uses Vectorize's pre-configured OAuth apps
  • No OAuth app setup required
  • Fastest way to get started
  • Available on Starter plan and above

White-Label OAuth (For Production Apps)

  • Use your own OAuth applications
  • Full control over branding and authentication flow
  • Required for production applications with custom branding
  • Available on Pro plan and above

Core Features

OAuth Authentication

  • Handle complex OAuth flows for Google Drive, Dropbox, and Notion
  • Support for both Vectorize-managed and white-label OAuth approaches
  • Automatic token management and refresh

File Selection

  • Interactive file picker UI components
  • Granular file and folder selection
  • Support for file type filtering

User Management

  • Add multiple users to a single connector
  • Update user file selections
  • Remove users and their associated data

Connector Management

  • Create and configure connectors programmatically
  • Monitor connector status
  • Handle connector lifecycle

Example: Building a Team Knowledge Base

import { 
  createGDriveConnector, 
  getGDriveAuthURL, 
  selectGDriveFiles 
} from '@vectorize-io/vectorize-connect';

// 1. Create a connector for your team
const connector = await createGDriveConnector({
  connectorName: 'Team Knowledge Base',
  config: {
    organizationId: process.env.VECTORIZE_ORG_ID,
    authorization: process.env.VECTORIZE_API_KEY
  }
});

// 2. Each team member authorizes access
app.get('/connect-drive', async (req, res) => {
  const authUrl = await getGDriveAuthURL({
    connectorId: connector.id,
    redirectUri: 'https://your-app.com/oauth/callback',
    config: vectorizeConfig
  });
  res.redirect(authUrl);
});

// 3. Let users select which files to include
app.post('/select-files', async (req, res) => {
  await selectGDriveFiles({
    connectorId: connector.id,
    selectedFiles: req.body.files,
    config: vectorizeConfig
  });
});

Requirements

  • Node.js 16+ or modern browsers
  • TypeScript 4.7+ (optional, for TypeScript projects)
  • A Vectorize account with API credentials

Resources

Getting Help

Related Documentation

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

Vectorize Connect SDK

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 5