Skip to main content

API Keys

API keys allow you to access Fanfare’s API programmatically, enabling integrations with your own systems, automation, and custom workflows.

Accessing API Keys

API key management is available through the developer settings or integrations section. Caption: Manage your API keys for programmatic access

API Key Types

TypeDescriptionUse Case
Public KeyClient-side, limited permissionsBrowser SDK, embedded widgets
Secret KeyServer-side, full permissionsBackend integrations, webhooks
Test KeyTesting environment onlyDevelopment and testing

Creating API Keys

Generate a New Key

  1. Navigate to API Keys settings
  2. Click Create API Key
  3. Select the key type
  4. Name the key (for identification)
  5. Set permissions (if applicable)
  6. Click Create
Caption: Create a new API key with appropriate permissions

Key Configuration

FieldRequiredDescription
NameYesDescriptive name for the key
TypeYesPublic, Secret, or Test
PermissionsNoScope limitations (if supported)
ExpirationNoOptional expiration date

After Creation

When a key is created:
  1. The key is displayed once
  2. Copy and store it securely
  3. You cannot view the full key again
  4. The key appears in your key list
Secret keys are shown only once when created. Store them securely immediately. If lost, you must create a new key.

Managing Keys

Key List

View all your API keys:
ColumnDescription
NameKey identifier
TypePublic, Secret, or Test
CreatedWhen the key was generated
Last UsedMost recent API call
StatusActive, Inactive, or Expired

Key Actions

ActionDescription
RegenerateCreate a new key, invalidate old
DeactivateTemporarily disable the key
DeletePermanently remove the key
Caption: Manage keys through the action menu

Key Permissions

Permission Scopes

If your plan supports granular permissions:
ScopeDescription
read:experiencesView experience data
write:experiencesCreate and edit experiences
read:consumersView consumer data
write:consumersCreate and edit consumers
read:analyticsAccess analytics data
adminFull administrative access

Restricting Permissions

For enhanced security:
  1. Select only needed permissions
  2. Use separate keys for different purposes
  3. Review permissions regularly
  4. Revoke unnecessary access

Using API Keys

Authentication Methods

MethodFormat
HeaderAuthorization: Bearer <api_key>
Query Param?api_key=<api_key>

Example Request

curl -X GET "https://api.fanfare.io/v1/experiences" \
  -H "Authorization: Bearer sk_live_xxxxx"

SDK Usage

import { FanfareClient } from "@waitify-io/fanfare-sdk-core";

const client = new FanfareClient({
  apiKey: "sk_live_xxxxx",
});

Key Security

Best Practices

  1. Never expose secret keys - Keep server-side only
  2. Use environment variables - Don’t hardcode keys
  3. Rotate regularly - Replace keys periodically
  4. Monitor usage - Watch for unusual activity
  5. Limit permissions - Use minimal required scope

Environment Variables

Store keys securely:
# .env file (never commit to version control)
FANFARE_API_KEY=sk_live_xxxxx
FANFARE_PUBLIC_KEY=pk_live_xxxxx

Key Rotation

Schedule regular key rotation:
ScenarioRotation Frequency
ProductionEvery 90 days
After breachImmediately
Team member leavesImmediately
Test environmentsAs needed

Rate Limits

API keys are subject to rate limits:
PlanRate Limit
Free100 requests/minute
Basic1,000 requests/minute
Pro10,000 requests/minute
EnterpriseCustom limits

Rate Limit Headers

Responses include rate limit information:
HeaderDescription
X-RateLimit-LimitMaximum requests allowed
X-RateLimit-RemainingRequests remaining
X-RateLimit-ResetWhen limit resets (timestamp)

Monitoring Usage

Usage Statistics

Track API key usage:
MetricDescription
Total RequestsRequests in current period
Success RatePercentage of successful calls
Error RatePercentage of failed calls
Last UsedMost recent API call

Usage Alerts

Configure alerts for:
  • Approaching rate limits
  • Unusual activity patterns
  • Error rate thresholds
  • Unused keys

Troubleshooting

Invalid API Key

  1. Verify the key is correct
  2. Check the key hasn’t expired
  3. Ensure the key is active
  4. Confirm correct environment (test vs. live)

Permission Denied

  1. Check key has required permissions
  2. Verify the endpoint requires no additional auth
  3. Review permission scopes
  4. Try regenerating the key

Rate Limited

  1. Check current usage against limits
  2. Implement exponential backoff
  3. Cache responses where appropriate
  4. Consider upgrading plan

API Documentation

For detailed API documentation: