Skip to content

Authentication

Chain Sentinel supports multiple authentication methods for both web dashboard and API access.

Web Dashboard Authentication

The fastest way to get started:

  1. Click "Sign in with Google" on the login page
  2. Select your Google account
  3. Approve permissions:
  4. Read your email address
  5. Read your basic profile info
  6. Instant access - no email verification needed

Benefits: - ✅ One-click sign in - ✅ No password to remember - ✅ Secure (OAuth 2.0) - ✅ Pre-verified email

Email & Password

Traditional authentication method:

  1. Register with email and password
  2. Verify your email address
  3. Log in with credentials

Password Requirements: - Minimum 8 characters - At least one uppercase letter - At least one lowercase letter - At least one number - At least one special character (!@#$%^&*)

Example Strong Password:

MySecure2024!

Session Management

After logging in:

  • Session Duration: 7 days
  • Auto-logout: After 7 days of inactivity
  • Remember Me: Enabled by default
  • Multi-device: Can log in from multiple devices

To log out: 1. Click your profile in the sidebar 2. Select "Logout" 3. Session is terminated immediately

API Authentication

API Key Authentication

All API requests require an API key in the request header.

Getting Your API Key

  1. Log in to app.chainsentinel.net
  2. Navigate to 🔑 API Keys
  3. Click "Create New API Key"
  4. Enter a descriptive name
  5. Select your tier (Free/Pro/Enterprise)
  6. Copy the key (shown only once!)

Important

The API key is shown only once during creation. Store it securely!

Using Your API Key

Include the API key in the X-API-Key header:

curl -H "X-API-Key: your_api_key_here" \
  https://api.chainsentinel.net/api/tokens
import requests

headers = {
    "X-API-Key": "your_api_key_here"
}

response = requests.get(
    "https://api.chainsentinel.net/api/tokens",
    headers=headers
)

print(response.json())
const response = await fetch(
  'https://api.chainsentinel.net/api/tokens',
  {
    headers: {
      'X-API-Key': 'your_api_key_here'
    }
  }
);

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

import (
    "fmt"
    "net/http"
    "io/ioutil"
)

func main() {
    client := &http.Client{}
    req, _ := http.NewRequest("GET", 
        "https://api.chainsentinel.net/api/tokens", nil)

    req.Header.Add("X-API-Key", "your_api_key_here")

    resp, _ := client.Do(req)
    defer resp.Body.Close()

    body, _ := ioutil.ReadAll(resp.Body)
    fmt.Println(string(body))
}

Alternative Methods

You can also pass the API key via:

Authorization Header:

curl -H "Authorization: Bearer your_api_key_here" \
  https://api.chainsentinel.net/api/tokens

Query Parameter (not recommended for production):

curl "https://api.chainsentinel.net/api/tokens?api_key=your_api_key_here"

Security

Query parameters are logged in server logs and browser history. Use headers in production!

Rate Limiting

API requests are rate-limited based on your subscription tier:

Tier Requests/Day Requests/Second
Free 100 1
Pro 1,000 10
Enterprise Unlimited 100

Rate Limit Headers

Every API response includes rate limit information:

X-RateLimit-Limit: 100
X-RateLimit-Remaining: 95
X-RateLimit-Reset: 1704067200
  • X-RateLimit-Limit - Total requests allowed per day
  • X-RateLimit-Remaining - Requests remaining today
  • X-RateLimit-Reset - Unix timestamp when limit resets

Handling Rate Limits

When you exceed the rate limit, you'll receive:

Status Code: 429 Too Many Requests

Response:

{
  "error": "Rate limit exceeded",
  "message": "You have exceeded your free tier limit of 100 requests per day",
  "tier": "free",
  "limit": 100,
  "upgrade": "https://chainsentinel.net/pricing"
}

Best Practices: - Cache responses when possible - Implement exponential backoff - Monitor X-RateLimit-Remaining header - Upgrade to Pro tier for higher limits

API Key Management

Viewing Your Keys

Navigate to 🔑 API Keys to see:

  • Key name
  • Creation date
  • Last used date
  • Request count (last 24h)
  • Status (active/revoked)

Revoking Keys

To revoke a compromised key:

  1. Go to 🔑 API Keys
  2. Find the key to revoke
  3. Click "Revoke"
  4. Confirm the action

Immediate Effect

Revoked keys stop working immediately. All requests will return 401 Unauthorized.

Key Rotation

For security, rotate your API keys regularly:

  1. Create a new API key
  2. Update your applications with the new key
  3. Test that everything works
  4. Revoke the old key

Recommended Rotation Schedule: - Production: Every 90 days - Development: Every 30 days

Security Best Practices

For Web Dashboard

Do: - Use strong, unique passwords - Enable Google OAuth when possible - Log out from shared computers - Keep your email secure

Don't: - Share your password - Use the same password across sites - Stay logged in on public computers

For API Keys

Do: - Store keys in environment variables - Use different keys for dev/prod - Rotate keys regularly - Monitor usage in dashboard

Don't: - Commit keys to version control - Share keys publicly - Use keys in client-side code - Log keys in application logs

Environment Variables

Store API keys securely:

export CHAIN_SENTINEL_API_KEY="your_key_here"
# .env file
CHAIN_SENTINEL_API_KEY=your_key_here

# Load in code
from dotenv import load_dotenv
import os

load_dotenv()
api_key = os.getenv("CHAIN_SENTINEL_API_KEY")
// .env file
CHAIN_SENTINEL_API_KEY=your_key_here

// Load in code
require('dotenv').config();
const apiKey = process.env.CHAIN_SENTINEL_API_KEY;

.gitignore

Always exclude sensitive files:

# Environment variables
.env
.env.local
.env.production

# API keys
api_keys.txt
secrets.json

Troubleshooting

401 Unauthorized

Possible causes: - Invalid API key - Revoked API key - Missing X-API-Key header - Expired session (web dashboard)

Solutions: - Verify the API key is correct - Check if key was revoked - Ensure header is included - Log in again (web dashboard)

403 Forbidden

Possible causes: - Insufficient permissions - Subscription tier restriction

Solutions: - Check your subscription tier - Upgrade to access premium features - Contact support for permission issues

429 Too Many Requests

Possible causes: - Rate limit exceeded - Too many requests in short time

Solutions: - Wait for rate limit reset - Implement request throttling - Upgrade to higher tier - Cache responses

Need Help?


Next: Dashboard Guide