Getting Started with JaxxDeal

Welcome to JaxxDeal! This guide will help you integrate our API management platform into your application in just a few minutes.

Note: You'll need to create an account and get your API credentials before starting. Sign up for free at jaxxdeal.xyz

Quick Start

Follow these steps to get up and running with JaxxDeal in under 5 minutes:

1Create Your Account

Sign up for a free account at JaxxDeal. No credit card required to start.

2Get Your API Key

After signing in, navigate to your dashboard and create your first API key. Keep this key secure!

# Your API key will look like this:
jx_live_1234567890abcdefghijklmnopqrstuvwxyz

3Install SDK

Install the JaxxDeal SDK for your preferred language:

# JavaScript/Node.js
npm install @jaxxdeal/sdk

# Python
pip install jaxxdeal

# Go
go get github.com/jaxxdeal/sdk-go

4Initialize the Client

Import and configure the JaxxDeal client in your application:

import { JaxxDeal } from '@jaxxdeal/sdk';

const jx = new JaxxDeal({
  apiKey: process.env.JAXXDEAL_API_KEY
});

5Verify API Keys

Start verifying incoming API keys in your endpoints:

const result = await jx.keys.verify(
  req.headers['authorization']
);

if (!result.valid) {
  return res.status(401).json({ error: 'Unauthorized' });
}

// Continue with your business logic
processRequest(result.metadata);

Authentication

JaxxDeal uses API keys for authentication. All API requests must include your API key in the Authorization header.

Header Format

Authorization: Bearer YOUR_API_KEY
Security: Never expose your API keys in client-side code or public repositories. Use environment variables or secure secret management systems.

API Key Types

  • Root Keys: Full access to all API operations (prefix: jx_root_)
  • Live Keys: Production environment keys (prefix: jx_live_)
  • Test Keys: Development and testing keys (prefix: jx_test_)

Managing API Keys

Create and manage API keys for your users programmatically or through the dashboard.

Create an API Key

POST /v1/keys

Create a new API key with custom metadata and permissions.

const key = await jx.keys.create({
  name: "Production API Key",
  prefix: "prod",
  metadata: {
    userId: "user_123",
    plan: "pro"
  },
  rateLimit: {
    limit: 1000,
    duration: "1h"
  }
});

console.log(key.key); // prod_abc123...

Verify an API Key

POST /v1/keys/verify

Verify if an API key is valid and check its permissions.

const verification = await jx.keys.verify("user_api_key");

if (verification.valid) {
  console.log("Key is valid!");
  console.log("Metadata:", verification.metadata);
  console.log("Remaining:", verification.remaining);
}

Revoke an API Key

DELETE /v1/keys/:keyId

Instantly revoke an API key globally.

await jx.keys.revoke("key_id_123");
// Key is immediately invalid across all regions

Rate Limiting

Configure flexible rate limits to protect your APIs from abuse and ensure fair usage.

Setting Rate Limits

Rate limits can be configured per API key during creation or updated later:

const key = await jx.keys.create({
  rateLimit: {
    limit: 1000,        // 1000 requests
    duration: "1h",     // per hour
    algorithm: "sliding" // sliding window
  }
});

Rate Limit Algorithms

  • Sliding Window: Smooth rate limiting over time (recommended)
  • Fixed Window: Reset limits at fixed intervals
  • Token Bucket: Allow bursts while maintaining average rate

Response Headers

Rate limit information is included in response headers:

X-RateLimit-Limit: 1000
X-RateLimit-Remaining: 847
X-RateLimit-Reset: 1640995200

Analytics

Track and analyze your API usage with real-time analytics.

Get Usage Statistics

GET /v1/analytics
const stats = await jx.analytics.getUsage({
  startDate: "2024-01-01",
  endDate: "2024-01-31",
  groupBy: "day"
});

console.log(stats.totalRequests);
console.log(stats.successRate);
console.log(stats.averageLatency);

SDK Installation

We provide official SDKs for multiple programming languages:

JavaScript / TypeScript

npm install @jaxxdeal/sdk
# or
yarn add @jaxxdeal/sdk

Python

pip install jaxxdeal

Go

go get github.com/jaxxdeal/sdk-go

Ruby

gem install jaxxdeal

PHP

composer require jaxxdeal/sdk
Language-specific docs: Each SDK has detailed documentation with examples. Visit our GitHub organization for language-specific guides.

Code Examples

Express.js Middleware

const { JaxxDeal } = require('@jaxxdeal/sdk');
const jx = new JaxxDeal({ apiKey: process.env.JAXXDEAL_API_KEY });

async function authenticateKey(req, res, next) {
  const apiKey = req.headers['authorization']?.replace('Bearer ', '');
  
  if (!apiKey) {
    return res.status(401).json({ error: 'Missing API key' });
  }
  
  const result = await jx.keys.verify(apiKey);
  
  if (!result.valid) {
    return res.status(401).json({ error: 'Invalid API key' });
  }
  
  req.user = result.metadata;
  next();
}

app.get('/api/protected', authenticateKey, (req, res) => {
  res.json({ message: 'Access granted!', user: req.user });
});

Python Flask Example

from flask import Flask, request, jsonify
from jaxxdeal import JaxxDeal

app = Flask(__name__)
jx = JaxxDeal(api_key=os.environ["JAXXDEAL_API_KEY"])

def verify_api_key():
    api_key = request.headers.get("Authorization", "").replace("Bearer ", "")
    return jx.keys.verify(key=api_key)

@app.route("/api/data")
def get_data():
    result = verify_api_key()
    if not result.valid:
        return jsonify({"error": "Unauthorized"}), 401
    
    return jsonify({"data": "Protected data"})

API Reference

Complete API reference documentation for all endpoints.

Base URL

https://api.jaxxdeal.xyz/v1

Available Endpoints

POST /keys

Create a new API key

GET /keys/:keyId

Get API key details

POST /keys/verify

Verify an API key

PUT /keys/:keyId

Update API key metadata

DELETE /keys/:keyId

Revoke an API key

GET /analytics

Get usage analytics

Need help? Join our community Discord or check out our tutorials for more detailed examples and use cases.