Getting started
Installation
Install the package into your Next.js project in two steps.
Install the package
Choose your package manager:
npm
npm install blogjs-spaceyarn
yarn add blogjs-spacepnpm
pnpm add blogjs-spacePeer requirements
| Requirement | Version | Notes |
|---|---|---|
| Node.js | >= 18 | Native fetch required |
| TypeScript | >= 5.0 | Recommended over TS 6 alpha |
Next.js configuration
To serve blog images through the Next.js Image component, add the S3 bucket to next.config.ts:
Code
import type { NextConfig } from "next";
const nextConfig: NextConfig = {
images: {
remotePatterns: [
{
protocol: "https",
hostname: "*.s3.ap-south-1.amazonaws.com",
},
],
},
};
export default nextConfig;