|
1 | | -# test-vectorize-connect-sdk |
| 1 | +# test-vectorize-connect-sdk |
| 2 | + |
| 3 | +A Next.js demonstration project showcasing the functionality of the [@vectorize-io/vectorize-connect](https://www.npmjs.com/package/@vectorize-io/vectorize-connect) package. |
| 4 | + |
| 5 | +## Overview |
| 6 | + |
| 7 | +This repository provides a practical implementation of the Vectorize Connect SDK, allowing developers to quickly understand how to integrate and utilize the package's features in a Next.js environment. |
| 8 | + |
| 9 | +## Features |
| 10 | + |
| 11 | +- Integration examples with the Vectorize Connect SDK |
| 12 | +- Google Drive connectivity demonstration |
| 13 | +- White label connector implementation |
| 14 | +- Interactive UI components for testing SDK functionality |
| 15 | + |
| 16 | +## Prerequisites |
| 17 | + |
| 18 | +- Node.js (v16+) |
| 19 | +- npm or yarn |
| 20 | +- A Vectorize account and API token |
| 21 | + |
| 22 | +## Environment Setup |
| 23 | + |
| 24 | +To fully test the features of this demonstration, you'll need to set up the following environment variables: |
| 25 | + |
| 26 | +``` |
| 27 | +VECTORIZE_TOKEN=your_vectorize_token |
| 28 | +VECTORIZE_ORG=your_vectorize_org_id |
| 29 | +``` |
| 30 | + |
| 31 | +### Google Drive Features |
| 32 | + |
| 33 | +To test the Google Drive integration features, the above environment variables are required. |
| 34 | + |
| 35 | +Additionally, if you wish to try the white label connector functionality, you'll need to set these Google-specific variables: |
| 36 | + |
| 37 | +``` |
| 38 | +GOOGLE_OAUTH_CLIENT_ID=your_google_oauth_client_id |
| 39 | +GOOGLE_OAUTH_CLIENT_SECRET=your_google_oauth_client_secret |
| 40 | +GOOGLE_API_KEY=your_google_api_key |
| 41 | +``` |
| 42 | + |
| 43 | +## Installation |
| 44 | + |
| 45 | +1. Clone the repository: |
| 46 | +```bash |
| 47 | +git clone https://github.com/yourusername/test-vectorize-connect-sdk.git |
| 48 | +cd test-vectorize-connect-sdk |
| 49 | +``` |
| 50 | + |
| 51 | +2. Install dependencies: |
| 52 | +```bash |
| 53 | +npm install |
| 54 | +# or |
| 55 | +yarn install |
| 56 | +``` |
| 57 | + |
| 58 | +3. Create a `.env.local` file in the root directory and add your environment variables. |
| 59 | + |
| 60 | +4. Start the development server: |
| 61 | +```bash |
| 62 | +npm run dev |
| 63 | +# or |
| 64 | +yarn dev |
| 65 | +``` |
| 66 | + |
| 67 | +5. Open your browser and navigate to `http://localhost:3000` |
| 68 | + |
| 69 | +## Usage |
| 70 | + |
| 71 | +The demo application provides a user interface to test various features of the Vectorize Connect SDK. You can: |
| 72 | + |
| 73 | +- Connect to your Vectorize account |
| 74 | +- Test Google Drive integrations |
| 75 | +- Try out white label connector functionality |
| 76 | +- Explore SDK methods and responses |
| 77 | + |
| 78 | +## Example Code |
| 79 | + |
| 80 | +Here's a simple example of how the SDK is implemented in this demo: |
| 81 | + |
| 82 | +```jsx |
| 83 | +import { VectorizeConnectClient } from '@vectorize-io/vectorize-connect'; |
| 84 | + |
| 85 | +// Initialize the client |
| 86 | +const client = new VectorizeConnectClient({ |
| 87 | + token: process.env.VECTORIZE_TOKEN, |
| 88 | + orgId: process.env.VECTORIZE_ORG |
| 89 | +}); |
| 90 | + |
| 91 | +// Example function to connect to Google Drive |
| 92 | +async function connectGoogleDrive() { |
| 93 | + const response = await client.connectors.google.authorize(); |
| 94 | + // Handle the response |
| 95 | +} |
| 96 | +``` |
| 97 | + |
| 98 | +## Contributing |
| 99 | + |
| 100 | +Contributions are welcome! Please feel free to submit a Pull Request. |
| 101 | + |
| 102 | +## License |
| 103 | + |
| 104 | +[MIT](LICENSE) |
| 105 | + |
| 106 | +## Support |
| 107 | + |
| 108 | +For questions or support with the Vectorize Connect SDK, please refer to the [official documentation](https://docs.vectorize.io) or reach out to the Vectorize support team. |
0 commit comments