Skip to main content

Welcome, Developers! 👋

Build with Ordinary’s infrastructure services: CDN for asset delivery and OAuth for authentication.

Prerequisites

Before you start, make sure you have:
1

An Ordinary Account

Create an account if you haven’t already. The API is free for development.
2

API Keys

Generate your API keys from your account dashboard.
3

Development Environment

Set up your preferred development environment with Node.js 18+ or your language of choice.

Quick Example: Upload an Asset

Here’s a quick example of uploading a file to our CDN:
const FormData = require('form-data');
const fs = require('fs');
const fetch = require('node-fetch');

async function uploadAsset() {
  const form = new FormData();
  form.append('file', fs.createReadStream('image.png'));

  const response = await fetch('https://api.ordinary.sh/v1/cdn/upload', {
    method: 'POST',
    headers: {
      'Authorization': `Bearer ${process.env.ORDINARY_API_KEY}`,
    },
    body: form
  });

  const data = await response.json();
  console.log('Asset URL:', data.url);
  // Output: https://cdn.ordinary.sh/xyz123/image.png
}

uploadAsset();
Store your API key in environment variables, never hardcode it in your source code.

What’s Next?

SDK Libraries

Official SDK libraries are coming soon! For now, you can use our REST API directly with any HTTP client.

Need Help?