Serve frontend assets from CDN
Build your frontend, publish production assets to Smooth CDN, and use stable CDN URLs in your app, website, plugin, or integration.
The problem
Web projects generate files that must be shipped somewhere: JS, CSS, images, fonts, JSON, PDFs, audio, video or other static assets.
Without a pipeline, this becomes manual uploads, custom scripts, inconsistent paths and assets mixed directly into app deployment.
Manual asset uploads
Custom deployment scripts
Files mixed with app hosting
No repeatable publish step
Different paths per project
Harder CDN adoption
Solution
Smooth CDN adds a repeatable publish step between your build output and production usage. Instead of handling assets differently in every project, you define sources once and push them to a CDN using a single command.
1
Install and setup Smooth CDN CLI
Smooth CDN CLI is the main way to publish assets. It handles authentication, reads your config, and uploads files to your CDN project. You can run it locally or inside CI/CD.
npm install -g @smoothcdn/cliscdn login2
Define what should be published
Define asset sources in a single config file. You can generate it with scdn init and adjust it to match your build output and public files. This replaces custom scripts and manual file selection.
{
"project": "My New Project",
"projectSlug": "my-new-project",
"userSlug": "user",
"blockBots": false,
"blockHeadless": false,
"sources": [
"./dist/**/*.{js,css}",
"./public/**/*.{png,jpg,svg,webp,mp3,mp4,mov,webm,pdf}",
],
"replacePath": {
"/dist/": "/",
"/public/": "/"
},
"excludes": [
"./build/app/tmp/*"
],
}3
Run deployment
Run the same command on every release. This makes asset publishing predictable and easy to automate as part of your deployment pipeline.
npm run build
scdn push4
Use CDN assets
After publishing, assets are available under CDN URLs. Use them in your frontend, templates, plugins or integrations just like any other static files.
<link
rel="stylesheet"
href="https://cdn.smoothcdn.com/user/my-new-project/main.css"
/>
<script src="https://cdn.smoothcdn.com/user/my-new-project/app.css"></script>
<img
src="https://cdn.smoothcdn.com/user/my-new-project/image.jpg"
alt="Image"
loading="lazy"
decoding="async"
/>
What You get
A clear asset delivery step that can be repeated locally, in CI/CD or during production releases.
One command to publish assets
CDN URLs for production usage
Less manual file handling
Same flow for JS, CSS, images, JSON, PDFs, audio, and video
Cleaner separation between app deployment and asset delivery
Build once. Publish assets to Smooth CDN.
Replace manual asset handling with a simple CDN publish step.