Skip to content

Commit 2101eb8

Browse files
committed
feat(cms): add vercel blob storage
1 parent 4ffd88f commit 2101eb8

File tree

5 files changed

+159
-3
lines changed

5 files changed

+159
-3
lines changed

cms/.env.example

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ PAYLOAD_SECRET=YOUR_SECRET_HERE
66
# POSTGRES_URL is automatically provided when you attach a Postgres database to your Vercel project
77

88
# Redis storage access for pricing data
9-
BLOB_READ_WRITE_TOKEN=your_vercel_blob_token_here
9+
SUPERFLUID_DATA_BLOB_READ_WRITE_TOKEN=your_vercel_blob_token_here
1010
LOCAL_STORAGE_PATH=./data
1111

1212
# CoinGecko API (optional, for better rate limits)
@@ -19,3 +19,6 @@ TRIGGER_SECRET_KEY=your_trigger_secret_key_here
1919
SMTP_HOST=your_smtp_host_here
2020
SMTP_USER=your_smtp_username_here
2121
SMTP_PASS=your_smtp_password_here
22+
23+
# Vercel Blob Integration
24+
BLOB_READ_WRITE_TOKEN=

cms/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
"@payloadcms/next": "^3.52.0",
3232
"@payloadcms/payload-cloud": "^3.52.0",
3333
"@payloadcms/richtext-lexical": "^3.52.0",
34+
"@payloadcms/storage-vercel-blob": "^3.52.0",
3435
"@payloadcms/ui": "^3.52.0",
3536
"@scalar/api-reference-react": "^0.7.38",
3637
"@superfluid-finance/metadata": "^1.6.0",

cms/src/payload.config.shared.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { fileURLToPath } from "node:url";
55
import { nodemailerAdapter } from "@payloadcms/email-nodemailer";
66
import { payloadCloudPlugin } from "@payloadcms/payload-cloud";
77
import { lexicalEditor } from "@payloadcms/richtext-lexical";
8+
import { vercelBlobStorage } from "@payloadcms/storage-vercel-blob";
89
import sharp from "sharp";
910
import { Chains } from "./collections/Chains";
1011
// import { Media } from './collections/Media'
@@ -28,7 +29,14 @@ export const sharedConfig = {
2829
outputFile: path.resolve(dirname, "payload-types.ts"),
2930
},
3031
sharp,
31-
plugins: [payloadCloudPlugin()],
32+
plugins: [
33+
payloadCloudPlugin(),
34+
vercelBlobStorage({
35+
enabled: true,
36+
collections: {},
37+
token: process.env.BLOB_READ_WRITE_TOKEN,
38+
}),
39+
],
3240
email: nodemailerAdapter({
3341
defaultFromAddress: "cms@superfluid.pro",
3442
defaultFromName: "Superfluid CMS",

cms/src/utils/storage.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,6 @@ export function getStorageConfig(): StorageConfig {
6767
return {
6868
type: isProduction ? "blob" : "local",
6969
localPath: process.env.LOCAL_STORAGE_PATH || "./data",
70-
blobReadWriteToken: process.env.BLOB_READ_WRITE_TOKEN,
70+
blobReadWriteToken: process.env.SUPERFLUID_DATA_BLOB_READ_WRITE_TOKEN,
7171
};
7272
}

pnpm-lock.yaml

Lines changed: 144 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)