1
1
# Vectorize Connect SDK
2
2
3
- TypeScript/JavaScript SDK for connecting different platforms such as Google Drive and Dropbox to the Vectorize platform.
3
+ TypeScript/JavaScript SDK for building multi-user connectors that integrate cloud storage platforms such as Google Drive with the Vectorize platform.
4
4
5
- This is a lightweight client that provides functionality for OAuth authentication and Vectorize API integration. The SDK helps you create connectors to various platforms, let users select files, and manage those connections through the Vectorize platform.
5
+ ## What is this?
6
+
7
+ The Vectorize Connect SDK enables you to:
8
+ - Build applications where multiple users can connect their cloud storage accounts
9
+ - Let users select specific files to be processed by Vectorize RAG pipelines
10
+ - Manage user authentication and file permissions
11
+ - Handle OAuth flows without building the authentication infrastructure yourself
12
+
13
+ This SDK is designed for developers who want to integrate multiple users' documents into their AI-powered applications using Vectorize's infrastructure.
6
14
7
15
## SDK Installation
8
16
@@ -21,76 +29,170 @@ yarn add @vectorize-io/vectorize-connect
21
29
pnpm add @vectorize-io/vectorize-connect
22
30
```
23
31
24
- ## Documentation
25
-
26
- For detailed documentation, please refer to:
27
-
28
- - [ General Guide] ( ./docs/general-guide.md ) - Overview and common concepts
29
- - [ Google Drive Integration] ( ./docs/google-drive/ ) - Google Drive specific integration
30
- - [ Dropbox Integration] ( ./docs/dropbox/ ) - Dropbox specific integration
31
- - [ API Reference] ( ./docs/API.md ) - Complete API documentation
32
- - [ White-Label Integration] ( ./docs/google-drive/white-label-guide.md ) - White-label integration
33
- - [ Vectorize Integration] ( ./docs/google-drive/vectorize-guide.md ) - Vectorize integration
34
- - [ Setup Guide] ( ./docs/setup.md ) - Setup instructions
35
-
36
- ## SDK Example Usage
37
-
38
- ### For Google Drive Integration
39
-
40
- For detailed information and examples on Google Drive integration, please refer to the [ Google Drive Integration] ( ./docs/google-drive/ ) guides.
41
-
42
- ### For Dropbox Integration
43
-
44
- For detailed information and examples on Dropbox integration, please refer to the [ Dropbox Integration] ( ./docs/dropbox/ ) guides.
32
+ ## Quick Start
45
33
34
+ ### 1. Install the SDK
35
+ ``` bash
36
+ npm install @vectorize-io/vectorize-connect
37
+ ```
46
38
47
- ## API Reference
48
-
49
- For detailed API documentation, please refer to the [ API Reference ] ( ./docs/API.md ) which includes:
39
+ ### 2. Set up your environment
40
+ ``` typescript
41
+ import { createGDriveConnector } from ' @vectorize-io/vectorize-connect ' ;
50
42
51
- - OAuth functions for Google Drive and Dropbox
52
- - File selection functions
53
- - Connector management functions
54
- - User management functions
55
- - Token utilities
56
- - Configuration types
43
+ const vectorizeConfig = {
44
+ organizationId: ' your-org-id' ,
45
+ authorization: ' your-api-key'
46
+ };
47
+ ```
57
48
58
- ## Configuration
49
+ ### 3. Create a connector and add users
50
+ ``` typescript
51
+ // Create a connector
52
+ const connector = await createGDriveConnector ({
53
+ connectorName: ' My Google Drive Connector' ,
54
+ config: vectorizeConfig
55
+ });
56
+
57
+ // Add users via OAuth
58
+ const authUrl = await getGDriveAuthURL ({
59
+ connectorId: connector .id ,
60
+ redirectUri: ' https://your-app.com/callback' ,
61
+ config: vectorizeConfig
62
+ });
63
+ ```
59
64
60
- ### ` VectorizeAPIConfig `
65
+ ## Documentation
61
66
62
- | Property | Type | Description |
63
- | ----------| ------| -------------|
64
- | ` organizationId ` | ` string ` | Your Vectorize organization ID |
65
- | ` authorization ` | ` string ` | Your Vectorize API key |
67
+ For comprehensive guides and examples:
68
+
69
+ - [ Multi-User Connectors Overview] ( https://docs.vectorize.io/developer-guides/multi-user-connectors ) - Understanding connector types
70
+ - [ Vectorize-Managed OAuth Guide] ( https://docs.vectorize.io/developer-guides/multi-user-connectors/vectorize-managed-oauth ) - Quick setup using Vectorize's OAuth
71
+ - [ White-Label OAuth Guide] ( https://docs.vectorize.io/developer-guides/multi-user-connectors/white-labeled-oauth ) - Using your own OAuth apps
72
+
73
+ ### SDK-Specific Documentation
74
+
75
+ - [ API Reference] ( https://github.com/vectorize-io/vectorize-connect-sdk/blob/main/docs/API.md ) - Complete API documentation
76
+ - [ General Guide] ( https://github.com/vectorize-io/vectorize-connect-sdk/blob/main/docs/general-guide.md ) - SDK concepts and patterns
77
+ - [ TypeScript Definitions] ( https://github.com/vectorize-io/vectorize-connect-sdk/blob/main/docs/types.md ) - Type definitions
78
+
79
+ ### Implementation Examples
80
+
81
+ - [ Environment Setup] ( https://github.com/vectorize-io/vectorize-connect-sdk/tree/main/docs/environment-setup )
82
+ - [ Creating Connectors] ( https://github.com/vectorize-io/vectorize-connect-sdk/tree/main/docs/creating-connectors )
83
+ - [ Authentication Flows] ( https://github.com/vectorize-io/vectorize-connect-sdk/tree/main/docs/authentication )
84
+ - [ User Management] ( https://github.com/vectorize-io/vectorize-connect-sdk/tree/main/docs/user-management )
85
+ - [ Frontend Integration] ( https://github.com/vectorize-io/vectorize-connect-sdk/tree/main/docs/frontend-implementation )
86
+ - [ Testing] ( https://github.com/vectorize-io/vectorize-connect-sdk/tree/main/docs/testing )
87
+
88
+ ## Supported Platforms
89
+
90
+ ### Google Drive
91
+ - [ Google Drive Overview] ( https://docs.vectorize.io/integrations/source-connectors/google-drive )
92
+ - [ Multi-User Setup (Vectorize)] ( https://docs.vectorize.io/integrations/source-connectors/google-drive/multi-user-vectorize )
93
+ - [ Multi-User Setup (White-Label)] ( https://docs.vectorize.io/integrations/source-connectors/google-drive/multi-user-white-label )
94
+
95
+ ### Dropbox
96
+ - [ Dropbox Overview] ( https://docs.vectorize.io/integrations/source-connectors/dropbox )
97
+ - [ Multi-User Setup (Vectorize)] ( https://docs.vectorize.io/integrations/source-connectors/dropbox/multi-user-vectorize )
98
+ - [ Multi-User Setup (White-Label)] ( https://docs.vectorize.io/integrations/source-connectors/dropbox/multi-user-white-label )
99
+
100
+ ### Notion
101
+ - [ OAuth Setup] ( https://docs.vectorize.io/integrations/source-connectors/notion )
102
+
103
+ ## Two Approaches: Vectorize-Managed vs White-Label
104
+
105
+ ### Vectorize-Managed OAuth (Recommended for Getting Started)
106
+ - Uses Vectorize's pre-configured OAuth apps
107
+ - No OAuth app setup required
108
+ - Fastest way to get started
109
+ - Available on Starter plan and above
110
+
111
+ ### White-Label OAuth (For Production Apps)
112
+ - Use your own OAuth applications
113
+ - Full control over branding and authentication flow
114
+ - Required for production applications with custom branding
115
+ - Available on Pro plan and above
116
+
117
+
118
+ ## Core Features
119
+
120
+ ### OAuth Authentication
121
+ - Handle complex OAuth flows for Google Drive, Dropbox, and Notion
122
+ - Support for both Vectorize-managed and white-label OAuth approaches
123
+ - Automatic token management and refresh
124
+
125
+ ### File Selection
126
+ - Interactive file picker UI components
127
+ - Granular file and folder selection
128
+ - Support for file type filtering
129
+
130
+ ### User Management
131
+ - Add multiple users to a single connector
132
+ - Update user file selections
133
+ - Remove users and their associated data
134
+
135
+ ### Connector Management
136
+ - Create and configure connectors programmatically
137
+ - Monitor connector status
138
+ - Handle connector lifecycle
139
+
140
+ ## Example: Building a Team Knowledge Base
141
+
142
+ ``` typescript
143
+ import {
144
+ createGDriveConnector ,
145
+ getGDriveAuthURL ,
146
+ selectGDriveFiles
147
+ } from ' @vectorize-io/vectorize-connect' ;
148
+
149
+ // 1. Create a connector for your team
150
+ const connector = await createGDriveConnector ({
151
+ connectorName: ' Team Knowledge Base' ,
152
+ config: {
153
+ organizationId: process .env .VECTORIZE_ORG_ID ,
154
+ authorization: process .env .VECTORIZE_API_KEY
155
+ }
156
+ });
157
+
158
+ // 2. Each team member authorizes access
159
+ app .get (' /connect-drive' , async (req , res ) => {
160
+ const authUrl = await getGDriveAuthURL ({
161
+ connectorId: connector .id ,
162
+ redirectUri: ' https://your-app.com/oauth/callback' ,
163
+ config: vectorizeConfig
164
+ });
165
+ res .redirect (authUrl );
166
+ });
167
+
168
+ // 3. Let users select which files to include
169
+ app .post (' /select-files' , async (req , res ) => {
170
+ await selectGDriveFiles ({
171
+ connectorId: connector .id ,
172
+ selectedFiles: req .body .files ,
173
+ config: vectorizeConfig
174
+ });
175
+ });
176
+ ```
66
177
67
178
## Requirements
68
179
69
- - This SDK is compatible with Node.js environments and modern browsers
70
- - TypeScript 4.7+ for type definitions
71
- - Next.js 14.0.0+ for server components (optional)
72
-
73
- ## Summary
74
-
75
- The Vectorize Connect SDK provides:
180
+ - Node.js 16+ or modern browsers
181
+ - TypeScript 4.7+ (optional, for TypeScript projects)
182
+ - A Vectorize account with API credentials
76
183
77
- - OAuth authentication for Google Drive and Dropbox
78
- - File selection functionality
79
- - Token management for platform APIs
80
- - Vectorize API integration for connectors
81
- - User management capabilities
184
+ ## Resources
82
185
83
- ## Detailed Documentation
186
+ ### Getting Help
187
+ - [ Vectorize Documentation] ( https://docs.vectorize.io )
188
+ - [ GitHub Issues] ( https://github.com/vectorize-io/vectorize-connect-sdk/issues )
189
+ - [ Example Implementation] ( https://github.com/vectorize-io/test-vectorize-connect-sdk )
84
190
85
- For more detailed documentation, please refer to the following guides:
191
+ ### Related Documentation
192
+ - [ RAG Pipelines Overview] ( https://docs.vectorize.io/rag-pipelines/understanding )
193
+ - [ Source Connectors Guide] ( https://docs.vectorize.io/integrations/source-connectors )
194
+ - [ Vectorize Platform Overview] ( https://docs.vectorize.io/concepts/vectorize-architecture )
86
195
87
- - [ API Reference] ( ./docs/API.md )
88
- - [ Google Drive White-Label Guide] ( ./docs/google-drive/white-label-guide.md )
89
- - [ Google Drive Vectorize Guide] ( ./docs/google-drive/vectorize-guide.md )
90
- - [ Dropbox White-Label Guide] ( ./docs/dropbox/white-label-guide.md )
91
- - [ Dropbox Vectorize Guide] ( ./docs/dropbox/vectorize-guide.md )
92
- - [ TypeScript Definitions] ( ./docs/types.md )
93
- - [ Setup Guide] ( ./docs/setup.md )
94
196
95
197
## License
96
198
0 commit comments