Third-Party Integrations Guide
Connect Selgora with your favorite tools and services
Third-Party Integrations Guide
Connect Selgora with your entire tech stack. From email providers to analytics tools, make everything work together seamlessly.
Integration Overview
Integration Types
Native Integrations (Built-in):
- Stripe (payments)
- Cloudflare (hosting)
- Brevo/SendinBlue (email)
- PostHog (analytics)
API Integrations (Custom):
- Any tool with API
- Custom workflows
- Private systems
Automation Platforms:
- Zapier
- Make (Integromat)
- n8n
- Pabbly Connect
Email Service Integrations
Brevo (SendinBlue)
Setup:
Settings > Integrations > Email
Provider: Brevo
API Key: [Your Brevo API key]
Default From: noreply@yourdomain.com
Features:
- Transactional emails
- Marketing campaigns
- Contact sync
- Automation triggers
Sync Contacts:
// Automatic sync on events
on('contact.created', async (contact) => {
await brevo.contacts.create({
email: contact.email,
attributes: {
FIRSTNAME: contact.first_name,
LASTNAME: contact.last_name
},
listIds: [2] // Your Brevo list ID
});
});
Mailchimp Integration
Via Zapier:
Trigger: New Contact in Selgora
Action: Add Subscriber to Mailchimp
Mapping:
- Email → Email Address
- First Name → FNAME
- Tags → Tags
ConvertKit Integration
Via API:
// Sync to ConvertKit
const convertkit = require('convertkit-api');
async function syncToConvertKit(contact) {
await convertkit.subscribers.create({
email: contact.email,
first_name: contact.first_name,
tags: contact.tags,
fields: {
selgora_id: contact.id
}
});
}
Payment Integrations
Stripe Connect
Primary Integration:
Settings > Payments > Stripe
Connect Account: [Connected]
Platform Fee: 5%
Application Fee: Enabled
Advanced Features:
- Subscription billing
- Multiple currencies
- Tax calculation
- Invoicing
PayPal Integration
Via Webhook:
// Handle PayPal IPN
app.post('/paypal-ipn', async (req, res) => {
if (verifyPayPalIPN(req.body)) {
await selgora.orders.create({
customer_email: req.body.payer_email,
amount: req.body.mc_gross * 100,
payment_method: 'paypal',
external_id: req.body.txn_id
});
}
});
Analytics Integrations
Google Analytics 4
Setup:
<!-- In your landing pages -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-XXXXXX"></script>
<script>
gtag('config', 'G-XXXXXX');
// Track conversions
gtag('event', 'purchase', {
transaction_id: '{{order.id}}',
value: {{order.amount}},
currency: '{{order.currency}}'
});
</script>
Facebook Pixel
Installation:
// Track events
fbq('track', 'Purchase', {
value: order.amount,
currency: 'USD',
content_ids: [product.id],
content_type: 'product'
});
fbq('track', 'CompleteRegistration', {
value: lead.potential_value,
currency: 'USD'
});
Mixpanel
Via API:
const Mixpanel = require('mixpanel');
const mixpanel = Mixpanel.init('YOUR_TOKEN');
// Track user events
selgora.webhooks.on('course.completed', (data) => {
mixpanel.track('Course Completed', {
distinct_id: data.contact_id,
course: data.course_name,
duration: data.time_spent
});
});
CRM Integrations
HubSpot
Via API:
const hubspot = require('@hubspot/api-client');
async function syncToHubSpot(contact) {
const hubspotClient = new hubspot.Client({
apiKey: process.env.HUBSPOT_KEY
});
await hubspotClient.crm.contacts.basicApi.create({
properties: {
email: contact.email,
firstname: contact.first_name,
lastname: contact.last_name,
selgora_tags: contact.tags.join(', ')
}
});
}
Salesforce
Via Zapier:
Trigger: Order Completed in Selgora
Action: Create/Update Lead in Salesforce
Mapping:
- Customer Email → Email
- Order Amount → Lead Score
- Product Name → Lead Source
Pipedrive
Webhook Integration:
// Sync deals to Pipedrive
selgora.webhooks.on('order.completed', async (data) => {
await pipedrive.deals.create({
title: `${data.customer_email} - ${data.product_name}`,
value: data.amount / 100,
currency: data.currency,
person_id: await findOrCreatePerson(data.customer_email),
status: 'won'
});
});
Automation Platforms
Zapier Integration
Available Triggers:
- New Contact
- New Order
- Course Completed
- Subscription Created
- Tag Added
Available Actions:
- Create Contact
- Update Contact
- Add Tag
- Grant Access
- Send Email
Example Zap:
Trigger: New Order in Selgora
Action 1: Add Row to Google Sheets
Action 2: Send Slack Message
Action 3: Create Invoice in QuickBooks
Make (Integromat)
Scenario Example:
{
"name": "Selgora Customer Onboarding",
"flow": [
{
"module": "selgora.watchOrders",
"parameters": {
"event": "order.completed"
}
},
{
"module": "google.sheets.addRow",
"parameters": {
"spreadsheet": "Customer_Database",
"values": ["email", "amount", "date"]
}
},
{
"module": "slack.postMessage",
"parameters": {
"channel": "#sales",
"text": "New customer: {{email}}"
}
}
]
}
n8n Workflow
Self-Hosted Automation:
// n8n workflow node
{
"nodes": [
{
"name": "Selgora Webhook",
"type": "n8n-nodes-base.webhook",
"webhookId": "selgora-events"
},
{
"name": "Process Event",
"type": "n8n-nodes-base.function",
"parameters": {
"functionCode": `
const event = items[0].json;
if (event.type === 'order.completed') {
// Process order
}
return items;
`
}
}
]
}
Communication Integrations
Slack
Notifications Bot:
const { WebClient } = require('@slack/web-api');
const slack = new WebClient(process.env.SLACK_TOKEN);
// Send notifications
selgora.webhooks.on('order.completed', async (data) => {
await slack.chat.postMessage({
channel: '#sales',
blocks: [
{
type: 'section',
text: {
type: 'mrkdwn',
text: `💰 *New Sale!*\n${data.customer_email}\n$${data.amount/100}`
}
}
]
});
});
Discord
Webhook Notifications:
const Discord = require('discord.js');
async function sendDiscordNotification(event) {
await fetch(DISCORD_WEBHOOK_URL, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
embeds: [{
title: 'New Order',
description: `Customer: ${event.customer_email}`,
color: 0x00ff00,
fields: [
{ name: 'Amount', value: `$${event.amount/100}` },
{ name: 'Product', value: event.product_name }
]
}]
})
});
}
Twilio (SMS)
SMS Notifications:
const twilio = require('twilio');
const client = twilio(ACCOUNT_SID, AUTH_TOKEN);
selgora.webhooks.on('order.completed', async (data) => {
await client.messages.create({
body: `New order: $${data.amount/100} from ${data.customer_email}`,
from: '+1234567890',
to: '+0987654321'
});
});
Video Platform Integrations
Zoom
For Events:
// Create Zoom meeting for event
const zoom = require('zoom-api');
async function createEventMeeting(event) {
const meeting = await zoom.meetings.create({
topic: event.name,
type: 2, // Scheduled meeting
start_time: event.start_time,
duration: event.duration_minutes,
settings: {
registration_type: 1,
approval_type: 0
}
});
// Save meeting URL
await selgora.events.update(event.id, {
meeting_url: meeting.join_url
});
}
Vimeo
Video Hosting:
// Upload course videos to Vimeo
const Vimeo = require('vimeo').Vimeo;
const client = new Vimeo(CLIENT_ID, CLIENT_SECRET, ACCESS_TOKEN);
async function uploadVideo(file, lesson) {
client.upload(
file,
{
name: lesson.title,
description: lesson.description,
privacy: { view: 'unlisted' }
},
(uri) => {
// Save Vimeo URL to lesson
selgora.lessons.update(lesson.id, {
video_url: `https://vimeo.com/${uri}`
});
}
);
}
Storage Integrations
Google Drive
Backup Automation:
const { google } = require('googleapis');
const drive = google.drive('v3');
async function backupToGoogleDrive(data) {
await drive.files.create({
resource: {
name: `selgora-backup-${Date.now()}.json`,
parents: ['FOLDER_ID']
},
media: {
mimeType: 'application/json',
body: JSON.stringify(data)
}
});
}
Dropbox
Content Delivery:
const Dropbox = require('dropbox').Dropbox;
const dbx = new Dropbox({ accessToken: TOKEN });
async function shareFile(filepath) {
const shareLink = await dbx.sharingCreateSharedLinkWithSettings({
path: filepath,
settings: {
requested_visibility: 'public'
}
});
return shareLink.result.url;
}
Custom Integrations
Building Your Own
Webhook Handler:
class CustomIntegration {
constructor(apiKey) {
this.apiKey = apiKey;
}
async handleSelgoraEvent(event) {
switch(event.type) {
case 'order.completed':
return this.handleNewOrder(event.data);
case 'contact.created':
return this.handleNewContact(event.data);
default:
return null;
}
}
async handleNewOrder(order) {
// Your custom logic
}
}
API Wrapper
class SelgoraClient:
def __init__(self, api_key):
self.api_key = api_key
self.base_url = 'https://api.selgora.com/v1'
def create_contact(self, email, **kwargs):
return requests.post(
f'{self.base_url}/contacts',
headers={'Authorization': f'Bearer {self.api_key}'},
json={'email': email, **kwargs}
)
Integration Best Practices
Error Handling
async function syncWithRetry(data, maxRetries = 3) {
let attempt = 0;
while (attempt < maxRetries) {
try {
await externalAPI.sync(data);
return;
} catch (error) {
attempt++;
if (attempt === maxRetries) throw error;
await sleep(Math.pow(2, attempt) * 1000);
}
}
}
Data Mapping
const fieldMapping = {
'selgora.first_name': 'crm.firstName',
'selgora.email': 'crm.emailAddress',
'selgora.tags': 'crm.labels',
'selgora.total_spent': 'crm.lifetime_value'
};
function mapFields(selgoraData) {
const mapped = {};
for (const [source, target] of Object.entries(fieldMapping)) {
mapped[target] = getNestedValue(selgoraData, source);
}
return mapped;
}
Your Integration Checklist
Planning
- [ ] List required integrations
- [ ] Check native support
- [ ] Evaluate automation platforms
- [ ] Plan data flow
- [ ] Consider rate limits
Implementation
- [ ] Set up authentication
- [ ] Configure webhooks
- [ ] Map data fields
- [ ] Add error handling
- [ ] Test thoroughly
Maintenance
- [ ] Monitor performance
- [ ] Check error logs
- [ ] Update API versions
- [ ] Document changes
- [ ] Review usage
Remember: Start with essential integrations, test thoroughly, and add complexity gradually. The best integration is one that works reliably, not one with the most features!
Was this article helpful?
Your feedback helps us improve our content