Getting Started

This guide helps you authenticate and send your first request to the Byfluence API.

Prerequisites

Before you begin, ensure you have:

  • A Byfluence account with API access
  • An API token or ability to log in for OAuth
  • Optional: Node.js 18+ if calling from a Next.js app

Base URL & Environment

Add your API base URL to your environment. In a Next.js app, set it in .env.local:

NEXT_PUBLIC_API_URL=https://api.byfluence.com

Use process.env.NEXT_PUBLIC_API_URL in the browser or server components to reference the base URL.

Authentication

Most endpoints require a Bearer token. Include your access token in the Authorization header.

cURL

curl -X GET   "$NEXT_PUBLIC_API_URL/v1/health"   -H "Authorization: Bearer YOUR_ACCESS_TOKEN"

Next.js (server)

const res = await fetch(process.env.NEXT_PUBLIC_API_URL + "/v1/health", {
  headers: { Authorization: "Bearer " + token },
  cache: "no-store",
});
const data = await res.json();

Create Your First Resource

Example: create a shop. Replace placeholders with your values.

curl -X POST   "$NEXT_PUBLIC_API_URL/v1/shops"   -H "Content-Type: application/json"   -H "Authorization: Bearer YOUR_ACCESS_TOKEN"   -d '{
    "name": "My Shop",
    "slug": "my-shop",
    "country": "ET",
    "category": "fashion"
  }'

Next Steps

Explore key areas of the Byfluence API:

API Reference

Browse endpoints for Authentication, Shops, Wallet, and Physical Products.

View API Docs →

Environment & SDKs

Use NEXT_PUBLIC_API_URL and your Bearer token in your app.

Back to Overview →