Guides
Installation
Detailed installation instructions for Next.js, React, and static sites.
Package Installation
Install IndieFooter using your preferred package manager:
NPM
npm install indie-footerYarn
yarn add indie-footerPNPM
pnpm install indie-footerNext.js Installation
For Next.js 13+ (App Router):
app/layout.tsx
import { IndieFooter } from 'indiefooter';
import './globals.css';
export default function RootLayout({ children }) {
return (
<html lang="en">
<body>
{children}
<IndieFooter if_key={process.env.NEXT_PUBLIC_INDIEFOOTER_KEY} />
</body>
</html>
);
}For Next.js with Pages Router:
pages/_app.tsx
import { IndieFooter } from 'indiefooter';
import '../styles/globals.css';
function MyApp({ Component, pageProps }) {
return (
<>
<Component {...pageProps} />
<IndieFooter if_key={process.env.NEXT_PUBLIC_INDIEFOOTER_KEY} />
</>
);
}
export default MyApp;Make sure to add your API key to
.env.local file.React Installation
For Create React App or Vite projects:
src/App.jsx
import { IndieFooter } from 'indiefooter';
function App() {
return (
<div className="App">
<header>
<h1>My App</h1>
</header>
<main>
{/* Your content */}
</main>
<IndieFooter if_key={import.meta.env.VITE_INDIEFOOTER_KEY} />
</div>
);
}
export default App;Environment Variables
Store your API key securely in environment variables:
Next.js
.env.local
NEXT_PUBLIC_INDIEFOOTER_KEY=IF_your_api_key_hereVite / Create React App
.env
VITE_INDIEFOOTER_KEY=IF_your_api_key_hereImportant: Add
.env.local and .env to your .gitignore file.Verify Installation
Start your development server and check the footer:
# Next.js
npm run dev
# React/Vite
npm run devOpen your browser and scroll to the bottom of the page. You should see the IndieFooter component loaded.
Success! If you see the footer, you're all set. If not, check the troubleshooting guide.