Skip to main content

Social Media Integration

GigaReels provides seamless integration with major social media platforms, allowing you to automatically upload your generated content to TikTok, Instagram, and Facebook with full customization and control.

Supported Platforms

TikTok

Videos and photos with privacy controls, comments, and engagement settings

Instagram

Reels, Stories, and feed posts with advanced customization

Facebook

Page posts with scheduling and visibility controls

How It Works

The GigaReels social media integration follows a simple, secure flow:
1

Connect Accounts

Users visit a secure connection URL to link their social media accounts
2

Generate Content

Create videos using any GigaReels render type
3

Upload Automatically

Use the SDK to upload content to connected platforms with custom settings

Quick Start

1. Connect Social Media Accounts

import { GigaReels } from "@gigareels/sdk";

const client = new GigaReels("your-api-key");

// Get connection URL for your users
const { access_url } = await client.socialMedia.connect();
console.log("Visit this URL to connect accounts:", access_url);
The user visits the URL, connects their accounts, and they’re automatically synced to your GigaReels integration.

2. Generate and Upload Content

// Generate a video
const task = await client.templates.brainrot.educational({
	prompt: "Explain renewable energy benefits",
	characterPack: "rick-and-morty",
	backgroundVideoPack: "minecraft-parkour",
});

// Upload to multiple platforms
const uploadResult = await client.socialMedia.uploadToMultiplePlatforms({
	videoUrl: task.outputUrl,
	title: "🌱 Amazing renewable energy facts!",
	username: "user_12345", // Your authenticated user ID
	platforms: ["tiktok", "instagram"],
	tiktokOptions: {
		privacy_level: "PUBLIC_TO_EVERYONE",
		disable_comment: false,
	},
	instagramOptions: {
		media_type: "REELS",
		share_to_feed: true,
	},
});

console.log("Upload successful:", uploadResult);

Key Features

  • JWT-based secure token management
  • No password storage required
  • Automatic token refresh
  • User-controlled account connections
  • TikTok: Privacy levels, comments, duets, stitch settings - Instagram: Media types (Reels/Stories), feed sharing, user tags - Facebook: Page posting, visibility controls, scheduling
  • Monitor upload quotas and limits - Track connected accounts status - View upload history and analytics - Real-time usage statistics
  • Simple SDK methods for each platform
  • TypeScript support with full type safety
  • Comprehensive error handling
  • Webhook support for async processing

Upload Methods

Multi-Platform Upload

Upload to multiple platforms simultaneously:
await client.socialMedia.uploadToMultiplePlatforms({
	videoUrl: "https://your-video.mp4",
	title: "Amazing content!",
	username: "user_12345",
	platforms: ["tiktok", "instagram", "facebook"],
	tiktokOptions: {
		privacy_level: "PUBLIC_TO_EVERYONE",
		disable_comment: false,
	},
	instagramOptions: {
		media_type: "REELS",
		share_to_feed: true,
	},
	facebookOptions: {
		facebook_page_id: "your-page-id",
		description: "Check out this amazing content!",
	},
});

Platform-Specific Methods

Upload to individual platforms with platform-specific optimizations:
await client.socialMedia.uploadToTikTok({
  videoUrl: "https://your-video.mp4",
  title: "My awesome TikTok video!",
  username: "user_12345",
  privacy_level: "PUBLIC_TO_EVERYONE",
  disable_comment: false,
  disable_duet: false,
  disable_stitch: false
});

Account Management

Check Connection Status

// Get usage stats and connection status
const stats = await client.socialMedia.getUsageStats();
console.log("Connected platforms:", stats.connectedPlatforms);
console.log("Upload limits:", stats.limits);
console.log("Usage this month:", stats.usage);

// Get detailed account information
const accounts = await client.socialMedia.getConnectedAccounts();
console.log("Connected accounts:", accounts);

Typical Response

{
	"connectedPlatforms": ["tiktok", "instagram"],
	"limits": {
		"tiktok": { "daily": 10, "monthly": 300 },
		"instagram": { "daily": 25, "monthly": 750 }
	},
	"usage": {
		"tiktok": { "today": 3, "thisMonth": 45 },
		"instagram": { "today": 8, "thisMonth": 156 }
	},
	"accounts": [
		{
			"platform": "tiktok",
			"username": "@myhandle",
			"connected": true,
			"lastSync": "2024-01-15T10:30:00Z"
		}
	]
}

Content Optimization

Platform-Specific Best Practices

  • Video Length: 15-60 seconds for maximum engagement
  • Aspect Ratio: 9:16 vertical format
  • Captions: Use trending hashtags and keywords
  • Timing: Post during peak hours (6-10 PM)
  • Content: Educational, entertaining, or trending topics

Content Types by Platform

Content TypeTikTokInstagramFacebookRecommended Settings
Educational Brainrot✅ Excellent✅ Great for Reels⚠️ Longer form betterUse trending audio, add captions
Breaking News✅ Perfect✅ Great for Stories✅ Good for pagesQuick, punchy titles
Text Messages✅ Viral potential✅ Story format⚠️ May need contextUse dramatic music
Reddit Stories⚠️ Too long⚠️ Clips only✅ Full stories workBreak into parts
Transform Videos✅ Perfect✅ Great✅ GoodMaintain original context

Complete Workflow Example

Here’s a complete example showing content generation and multi-platform distribution:
import { GigaReels } from "@gigareels/sdk";

async function createAndDistributeContent() {
	const client = new GigaReels("your-api-key");

	try {
		// 1. Generate educational content
		console.log("🎬 Generating video...");
		const videoTask = await client.templates.brainrot.educational({
			prompt: "Explain how cryptocurrency mining works and its environmental impact",
			characterPack: "rick-and-morty",
			backgroundVideoPack: "minecraft-parkour",
			enableGifs: true,
		});

		console.log("✅ Video generated:", videoTask.outputUrl);

		// 2. Create platform-specific variants
		const platforms = [
			{
				name: "TikTok",
				title: "🔥 Crypto mining explained! #cryptocurrency #education #rickandmorty",
				options: {
					privacy_level: "PUBLIC_TO_EVERYONE",
					disable_comment: false,
					is_aigc: true, // Mark as AI-generated
				},
			},
			{
				name: "Instagram",
				title: "Mind-blowing crypto facts! 🤯 #crypto #education #reels",
				options: {
					media_type: "REELS",
					share_to_feed: true,
					audio_name: "Educational Vibes",
				},
			},
		];

		// 3. Upload to multiple platforms
		console.log("📤 Uploading to platforms...");
		for (const platform of platforms) {
			const result = await client.socialMedia.uploadToMultiplePlatforms({
				videoUrl: videoTask.outputUrl,
				title: platform.title,
				username: "user_12345",
				platforms: [platform.name.toLowerCase()],
				[`${platform.name.toLowerCase()}Options`]: platform.options,
			});

			console.log(`✅ ${platform.name} upload:`, result.success);
		}

		// 4. Check updated usage stats
		const stats = await client.socialMedia.getUsageStats();
		console.log("📊 Updated usage:", stats.usage);
	} catch (error) {
		console.error("❌ Error:", error.message);
	}
}

createAndDistributeContent();

Error Handling

import { GigaReels } from "@gigareels/sdk";

try {
	const result = await client.socialMedia.uploadToTikTok({
		videoUrl: "https://your-video.mp4",
		title: "My video",
		username: "user_12345",
	});
} catch (error) {
	switch (error.message) {
		case "Account not connected":
			console.log("User needs to connect their TikTok account");
			// Redirect to connection flow
			break;
		case "Upload quota exceeded":
			console.log("Daily upload limit reached");
			// Show quota information
			break;
		case "Invalid video format":
			console.log("Video format not supported");
			// Convert or re-generate video
			break;
		default:
			console.log("Upload failed:", error.message);
	}
}

Rate Limits & Quotas

Platform Limits: Each social media platform has its own rate limits and quotas. GigaReels tracks these automatically and provides clear error messages when limits are reached.

Typical Limits

PlatformDaily UploadsMonthly UploadsVideo Size LimitNotes
TikTok10 videos300 videos500MBBusiness accounts may have higher limits
Instagram25 videos750 videos100MBReels have separate limits from posts
Facebook50 videos1500 videos1GBPage posting requires admin permissions

Next Steps

1

Set Up Account Connection

Implement the account connection flow for your users
2

Choose Your Platforms

Decide which platforms to target based on your audience
3

Optimize Content

Tailor your content generation for each platform’s best practices
4

Monitor Performance

Track upload success rates and platform-specific analytics
Ready to start automating your social media? Check out the platform-specific guides or explore our scheduling features.