Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ This repository provides a practical implementation of the Vectorize Connect SDK
To fully test the features of this demonstration, you'll need to set up the following environment variables:

```
VECTORIZE_TOKEN=your_vectorize_token
VECTORIZE_ORG=your_vectorize_org_id
VECTORIZE_API_KEY=your_vectorize_token
VECTORIZE_ORGANIZATION_ID=your_vectorize_org_id
```

### Google Drive Features
Expand Down Expand Up @@ -81,4 +81,4 @@ The demo application provides a user interface to test various features of the V

## Support

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.
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.
10 changes: 5 additions & 5 deletions src/app/api/createSourceConnector/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,20 @@ export async function POST(request: Request) {

// 2. Gather environment variables for your Vectorize config
const config: VectorizeAPIConfig = {
organizationId: process.env.VECTORIZE_ORG ?? "",
authorization: process.env.VECTORIZE_TOKEN ?? "",
organizationId: process.env.VECTORIZE_ORGANIZATION_ID ?? "",
authorization: process.env.VECTORIZE_API_KEY ?? "",
};

// Optionally, validate environment variables before proceeding
if (!config.organizationId) {
return NextResponse.json(
{ error: "Missing VECTORIZE_ORG in environment" },
{ error: "Missing VECTORIZE_ORGANIZATION_ID in environment" },
{ status: 500 }
);
}
if (!config.authorization) {
return NextResponse.json(
{ error: "Missing VECTORIZE_TOKEN in environment" },
{ error: "Missing VECTORIZE_API_KEY in environment" },
{ status: 500 }
);
}
Expand Down Expand Up @@ -118,4 +118,4 @@ export async function POST(request: Request) {
console.error("Error creating connector:", error);
return NextResponse.json({ error: error.message || "Unexpected error" }, { status: 500 });
}
}
}
4 changes: 2 additions & 2 deletions src/app/api/getVectorizeConfig/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import { NextRequest, NextResponse } from "next/server";
export async function GET(request: NextRequest) {

const config: VectorizeAPIConfig = {
organizationId: process.env.VECTORIZE_ORG ?? "",
authorization: process.env.VECTORIZE_TOKEN ?? "",
organizationId: process.env.VECTORIZE_ORGANIZATION_ID ?? "",
authorization: process.env.VECTORIZE_API_KEY ?? "",
};

if (!config.organizationId || !config.authorization) {
Expand Down
6 changes: 3 additions & 3 deletions src/app/api/get_One_Time_Vectorize_Connector_Token/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import { NextRequest, NextResponse } from "next/server";
export async function GET(request: NextRequest) {
try {
// Get authentication details from environment variables or secure storage
const apiKey = process.env.VECTORIZE_TOKEN;
const organizationId = process.env.VECTORIZE_ORG;
const apiKey = process.env.VECTORIZE_API_KEY;
const organizationId = process.env.VECTORIZE_ORGANIZATION_ID;

if (!apiKey || !organizationId) {
return NextResponse.json({
Expand Down Expand Up @@ -69,4 +69,4 @@ export async function GET(request: NextRequest) {
message: error instanceof Error ? error.message : 'Unknown error'
}, { status: 500 });
}
}
}
10 changes: 5 additions & 5 deletions src/app/api/manage-oauth-user/[connectorId]/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,20 +54,20 @@ export async function POST(request: NextRequest) {
const connectorId = segments[segments.length - 1];

const config: VectorizeAPIConfig = {
organizationId: process.env.VECTORIZE_ORG ?? "",
authorization: process.env.VECTORIZE_TOKEN ?? "",
organizationId: process.env.VECTORIZE_ORGANIZATION_ID ?? "",
authorization: process.env.VECTORIZE_API_KEY ?? "",
};

// Optionally, validate environment variables before proceeding
if (!config.organizationId) {
return NextResponse.json(
{ error: "Missing VECTORIZE_ORG in environment" },
{ error: "Missing VECTORIZE_ORGANIZATION_ID in environment" },
{ status: 500 }
);
}
if (!config.authorization) {
return NextResponse.json(
{ error: "Missing VECTORIZE_TOKEN in environment" },
{ error: "Missing VECTORIZE_API_KEY in environment" },
{ status: 500 }
);
}
Expand Down Expand Up @@ -193,4 +193,4 @@ export async function GET(request: NextRequest) {
return buildCorsResponse({
message: 'OAuth callback endpoint is working. This endpoint expects POST requests with JSON data.'
}, 200, origin);
}
}