Skip to main content

Social Integration

Publish content to social media platforms directly from the CRM.

Supported Platforms

PlatformAPIFeatures
FacebookGraph APIPages, Posts, Events
InstagramGraph API (via FB)Business posts, Stories
Twitter/XAPI v2Tweets, Media
LinkedInMarketing APICompany pages (future)

Connecting Accounts

The connection flow uses OAuth to securely link social accounts:

  1. Club admin clicks "Connect Facebook/Instagram/Twitter"
  2. User is redirected to platform authorization page
  3. User grants permissions
  4. CRM receives and encrypts access tokens
  5. Connection is saved and ready to use

Token Security

  • Access tokens encrypted at rest (AES-256)
  • Refresh tokens stored separately
  • Tokens auto-refreshed before expiry
  • Never exposed in API responses

Publishing Posts

Post Model

interface SocialPost {
id: string;
connectionId: string; // Which social account
campaignId?: string; // Optional campaign link
content: string; // Post text
mediaUrls: string[]; // Images/videos
linkUrl?: string; // Link preview
status: SocialPostStatus; // DRAFT, SCHEDULED, PUBLISHED
scheduledAt?: Date;
publishedAt?: Date;

// Engagement metrics
likes: number;
comments: number;
shares: number;
reach: number;
}

Post Status Flow

DRAFT ──▶ SCHEDULED ──▶ PUBLISHING ──▶ PUBLISHED
│ │ │ │
▼ ▼ ▼ ▼
Edit Cancel (auto) Sync metrics

FAILED ◀── On error

Engagement Tracking

Platform metrics are synced automatically:

TimingFrequency
First 24 hoursEvery hour
Days 2-7Every 6 hours
After 7 daysDaily

Rate Limits

PlatformLimitPeriod
Facebook200 posts24 hours (per page)
Instagram25 posts24 hours
Twitter200 tweets15 minutes

Event Promotion

Auto-promote tournaments and events when published in TeeTime:

  1. Event is published in TeeTime
  2. CRM receives event notification
  3. If auto-promote is enabled:
    • Create campaign targeting relevant segment
    • Generate content from event details
    • Schedule posts across all channels
    • Send reminder emails/SMS as event approaches