Getting Started

Authentication

Learn how to authenticate your API requests using API keys and best practices for keeping your keys secure.

All API requests require authentication using an API key.

API Keys

IndieFooter uses API keys to authenticate requests. You can create and manage API keys in your dashboard under Settings → API Keys.

API Key Format

All IndieFooter API keys are prefixed with IF_ for easy identification:

IF_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Log in to your dashboard to see your actual API key

Example Request

Here's how to use your API key in a JavaScript fetch request:

example.js
const response = await fetch('https://api.indiefooter.com/v1/products', {
  headers: {
    'Authorization': 'Bearer IF_your_api_key_here',
    'Content-Type': 'application/json'
  }
});

const data = await response.json();
console.log(data);

Code Examples

Next.js

app/page.tsx
import { IndieFooter } from 'indiefooter';

export default function Page() {
  return (
    <main>
      <h1>My App</h1>
      {/* Your content */}
      
      <IndieFooter 
        apiKey={process.env.NEXT_PUBLIC_INDIEFOOTER_KEY}
      />
    </main>
  );
}

React

App.jsx
import { IndieFooter } from 'indiefooter';

function App() {
  return (
    <div className="App">
      <header>My App</header>
      {/* Your content */}
      
      <IndieFooter 
        apiKey={import.meta.env.VITE_INDIEFOOTER_KEY}
      />
    </div>
  );
}

Creating API Keys

To create a new API key:

  1. Log in to your dashboard
  2. Navigate to Settings → API Keys
  3. Click "Create New Key"
  4. Give your key a descriptive name (e.g., "Production Site", "Blog Footer")
  5. Copy and store your key securely
Important: API keys are shown only once when created. Make sure to copy and store them securely. If you lose a key, you'll need to create a new one.

Key Management

Best practices for managing your API keys:

Use Environment Variables

Never hardcode API keys in your source code. Always use environment variables.

Separate Keys per Environment

Create different keys for development, staging, and production environments.

Rotate Keys Regularly

Periodically rotate your API keys for enhanced security.

Revoke Compromised Keys

If a key is exposed, immediately revoke it from your dashboard and create a new one.

Security Best Practices

Environment Variables

Store your API key in environment variables:

.env.local
# Next.js
NEXT_PUBLIC_INDIEFOOTER_KEY=IF_your_api_key_here

# Vite/React
VITE_INDIEFOOTER_KEY=IF_your_api_key_here
Never commit .env files to version control. Add them to your .gitignore file.

Rate Limiting

API keys are subject to rate limits to ensure fair usage:

  • Free tier: 10,000 requests per month
  • Basic plan: 50,000 requests per month
  • Pro plan: Unlimited requests

Error Responses

Common authentication errors:

401 Unauthorized

Your API key is missing or invalid.

{
  "error": {
    "message": "Invalid API key",
    "type": "authentication_error"
  }
}

429 Too Many Requests

You've exceeded your rate limit.

{
  "error": {
    "message": "Rate limit exceeded",
    "type": "rate_limit_error"
  }
}

Next Steps