Skip to content

Supercharge your AI agents with data from the web and beyond. Building the library for superintelligence. 🔥

feat(api): default VERCEL_MARKETPLACE_INTEGRATION_ID to Firecrawl's integration (#5639)

Erik Engervalla0535ec3e53a
diff --git a/apps/api/.env.example b/apps/api/.env.example
index 6626971f9..620793d0b 100644
--- a/apps/api/.env.example
+++ b/apps/api/.env.example
@@ -25,7 +25,9 @@ MCP_ACTION_LOG_SECRET=
# characters and do not reuse KEYLESS_PROXY_SECRET.
MCP_DELEGATED_CREDENTIAL_SECRET=
# Vercel Marketplace integration id (oac_...). Enables Vercel OIDC resource
-# tokens as bearer credentials. Not a secret; unset disables the branch.
+# tokens as bearer credentials when USE_DB_AUTHENTICATION=true. Not a secret.
+# Empty (as here) disables the branch, which suits self-hosted installs; remove
+# the line to use Firecrawl's integration.
VERCEL_MARKETPLACE_INTEGRATION_ID=
# Keyless signup link keys: comma-separated base64 16-byte AES keys
# (openssl rand -base64 16). The first encrypts the /k/<token> links in keyless
diff --git a/apps/api/src/config.ts b/apps/api/src/config.ts
index 1be9c775f..2b709ceb1 100644
--- a/apps/api/src/config.ts
+++ b/apps/api/src/config.ts
@@ -293,11 +293,18 @@ const configSchema = z.object({
.nonnegative()
.default(10),
- // Vercel Marketplace integration id (oac_...). When set, Vercel OIDC resource
- // tokens (iss https://integrations.vercel.com/<id>) are accepted as bearer
- // credentials. Unset disables the branch. Not a secret.
- VERCEL_MARKETPLACE_INTEGRATION_ID: emptyStringAsUndefined(
- z.string().regex(/^oac_[A-Za-z0-9]+$/),
+ // Vercel Marketplace integration id (oac_...). Vercel OIDC resource tokens
+ // (iss https://integrations.vercel.com/<id>) are accepted as bearer
+ // credentials when DB authentication is on. Unset uses Firecrawl's
+ // integration; an empty value disables the branch. Not a secret.
+ VERCEL_MARKETPLACE_INTEGRATION_ID: z.preprocess(
+ value => (value === "" ? null : value),
+ z
+ .string()
+ .regex(/^oac_[A-Za-z0-9]+$/)
+ .nullable()
+ .default("oac_jkJx3wOqOMTpj4TqJJcwA4l8")
+ .transform(value => value ?? undefined),
),
// OAuth token introspection
diff --git a/apps/api/src/lib/__tests__/vercel-marketplace-config.test.ts b/apps/api/src/lib/__tests__/vercel-marketplace-config.test.ts
new file mode 100644
index 000000000..e63987e44
--- /dev/null
+++ b/apps/api/src/lib/__tests__/vercel-marketplace-config.test.ts
@@ -0,0 +1,35 @@
+import { afterEach, describe, expect, it, vi } from "vitest";
+
+async function loadIntegrationId(
+ value: string | undefined,
+): Promise<string | undefined> {
+ vi.stubEnv("VERCEL_MARKETPLACE_INTEGRATION_ID", value);
+ vi.resetModules();
+ const { config } = await import("../../config.js");
+ return config.VERCEL_MARKETPLACE_INTEGRATION_ID;
+}
+
+describe("VERCEL_MARKETPLACE_INTEGRATION_ID config", () => {
+ afterEach(() => {
+ vi.unstubAllEnvs();
+ vi.resetModules();
+ });
+
+ it("defaults to Firecrawl's integration when unset", async () => {
+ expect(await loadIntegrationId(undefined)).toBe(
+ "oac_jkJx3wOqOMTpj4TqJJcwA4l8",
+ );
+ });
+
+ it("is disabled when explicitly empty", async () => {
+ expect(await loadIntegrationId("")).toBeUndefined();
+ });
+
+ it("uses the env value when set", async () => {
+ expect(await loadIntegrationId("oac_other123")).toBe("oac_other123");
+ });
+
+ it("rejects a malformed id", async () => {
+ await expect(loadIntegrationId("not-an-id")).rejects.toThrow();
+ });
+});