Fetching Content ​
Launchpad's content fetching process is designed to be flexible and robust, allowing you to fetch, transform, and manage content from various sources. This guide provides an overview of how content flows through Launchpad, from configuration to storage.
Basic Configuration ​
Content fetching requires a ContentConfig
object in your Launchpad configuration:
// launchpad.config.js
import { defineConfig } from '@bluecadet/launchpad-cli';
import { jsonSource } from '@bluecadet/launchpad-content';
export default defineConfig({
content: {
sources: [
jsonSource({
id: "example-source",
files: {
"example.json": "https://example.com/api/data",
},
}),
],
plugins: [], // Add plugins here
downloadPath: './content',
backupAndRestore: true,
},
});
See the Content Configuration Reference for all options.
Running Content Updates ​
You can update content in two ways:
# As part of the full Launchpad startup
npx launchpad start
# Content updates only
npx launchpad content
See the CLI Commands Reference for more details.
Content Sources ​
Sources define where your content comes from. Launchpad includes several built-in sources:
- JSON/REST APIs
- CMS platforms (Contentful, Sanity, etc.)
Check the Content Sources Reference to learn more about available sources and how to create custom ones.
Transform with Plugins ​
Plugins process your content after it's downloaded. Common use cases include:
- Converting Markdown to HTML
- Resizing images
- Validating data
- Custom transformations
Learn more in the Plugins Reference.
Best Practices ​
- Use Backup and Restore: Enable
backupAndRestore
to automatically recover from failures - Implement Error Handling: Use the error handling system to gracefully handle failures
- Monitor Progress: Use the logging system to track content updates
- Organize Sources: Group related content into separate sources for better management
- Cache Effectively: Configure appropriate cache settings for your content type
Next Steps ​
- Read about Content Configuration
- Learn about Content Sources
- Explore Plugin Development
- Understanding Error Handling
For complete API documentation, visit the Content Reference Documentation.