Supabase कनेक्टर

customer engagement automation के लिए database records, user authentication data, file storage events, और real-time changes sync करने हेतु अपने Supabase project को कनेक्ट करें।

अवलोकन

PropertyValue
PlatformSupabase
CategoryDatabase & Backend
Setup ComplexityEasy
Official IntegrationYes
Data SyncedUsers, Tables, Storage, Events
Available Skills11
API TypeREST (PostgREST) + Realtime WebSocket
Official Docssupabase.com/docs

विशेषताएं

  • Auto-generated REST API, PostgREST के माध्यम से किसी भी Postgres table पर CRUD operations, बिना किसी code के
  • Auth user sync, Supabase Auth users (email, phone, social logins) को अपने engagement platform से sync करें
  • Real-time subscriptions, किसी भी table पर INSERT, UPDATE, DELETE events को real-time में सुनें
  • Row Level Security, सभी API access secure multi-tenant data के लिए Postgres RLS policies का सम्मान करता है
  • Storage integration, file uploads ट्रैक करें और Storage buckets में assets manage करें
  • Edge Functions, custom logic और webhooks के लिए serverless Deno functions invoke करें
  • Full-text search, API के माध्यम से Postgres full-text search capabilities का लाभ उठाएं

पूर्वावश्यकताएं

शुरू करने से पहले, सुनिश्चित करें कि आपके पास हैं:

  1. एक Supabase project (app.supabase.com)
  2. आपके project का API URL और API keys (Settings → API में पाया जाता है)
  3. API access वाला एक Tajo account

API Keys

Supabase दो keys प्रदान करता है: anon (public, RLS का सम्मान करती है) और service_role (RLS को bypass करती है, admin access)। server-side integrations के लिए service_role और client-side के लिए anon का उपयोग करें।

प्रमाणीकरण

Supabase API key authentication का उपयोग करता है। हर request के लिए apikey header आवश्यक है और user-scoped access के लिए वैकल्पिक रूप से एक Authorization bearer token।

Terminal window
# anon key का उपयोग (RLS का सम्मान करती है)
curl 'https://<project_ref>.supabase.co/rest/v1/customers' \
-H "apikey: <SUPABASE_ANON_KEY>" \
-H "Authorization: Bearer <SUPABASE_ANON_KEY>"
# service_role key का उपयोग (RLS को bypass करती है)
curl 'https://<project_ref>.supabase.co/rest/v1/customers' \
-H "apikey: <SUPABASE_SERVICE_ROLE_KEY>" \
-H "Authorization: Bearer <SUPABASE_SERVICE_ROLE_KEY>"

कॉन्फ़िगरेशन

बेसिक सेटअप

connectors:
supabase:
enabled: true
project_url: "https://xyzcompany.supabase.co"
api_key: "${SUPABASE_SERVICE_ROLE_KEY}"
# Data sync options
sync:
users: true
tables:
- customers
- orders
- products
storage: true
realtime: true
# Supabase Auth users को contacts से map करें
user_mapping:
email: email
phone: SMS
user_metadata.full_name: FIRSTNAME
created_at: SIGNUP_DATE

Field Mapping

Supabase table columns को engagement platform attributes से map करें:

Default User Mappings

Parameter Type Description
email required
string

Supabase Auth से User email (unique identifier)

phone optional
string

SMS/WhatsApp engagement के लिए Phone number

user_metadata.full_name optional
string

Auth user metadata से Display name

user_metadata.avatar_url optional
string

Profile image URL

created_at optional
timestamp

Account creation timestamp

last_sign_in_at optional
timestamp

engagement scoring के लिए सबसे हालिया login

app_metadata.provider optional
string

Auth provider (email, google, github, आदि)

confirmed_at optional
timestamp

Email confirmation timestamp

Custom Table Mapping

table_mapping:
customers:
# Column → Attribute mapping
email: email
full_name: FIRSTNAME
company: COMPANY
plan: SUBSCRIPTION_PLAN
mrr: MONTHLY_REVENUE
created_at: SIGNUP_DATE
orders:
# events के रूप में ट्रैक करें
sync_as: events
event_name: "order_placed"
properties:
total: amount
status: order_status
items: line_items

API Endpoints

Supabase REST API आपके database schema से https://<ref>.supabase.co/rest/v1/ पर auto-generated होता है।

EndpointMethodविवरण
/rest/v1/{table}GETfiltering, ordering, pagination के साथ rows क्वेरी करें
/rest/v1/{table}POSTrows insert करें (bulk और upsert को support करता है)
/rest/v1/{table}PATCHfilters से match होने वाले rows अपडेट करें
/rest/v1/{table}DELETEfilters से match होने वाले rows हटाएं
/rest/v1/rpc/{function}POSTPostgres function call करें
/auth/v1/signupPOSTनया user बनाएं
/auth/v1/token?grant_type=passwordPOSTpassword के साथ sign in करें
/auth/v1/userGETवर्तमान user प्राप्त करें
/auth/v1/admin/usersGETसभी users list करें (service_role)
/storage/v1/object/{bucket}/{path}POSTfile upload करें
/storage/v1/object/list/{bucket}POSTbucket में files list करें
/functions/v1/{function_name}POSTEdge Function invoke करें

Filtering Operators

Operatorविवरणउदाहरण
eqबराबर?status=eq.active
neqबराबर नहीं?status=neq.deleted
gt, gteसे अधिक?amount=gt.100
lt, lteसे कम?created_at=lt.2024-01-01
like, ilikePattern match?name=ilike.%john%
inArray में?status=in.(active,trial)
isNull check?deleted_at=is.null

Events

Auth Events

EventTriggerउपयोग मामला
user.signed_upनया user registrationWelcome series
user.signed_inUser loginActivity tracking
user.updatedProfile changesData sync
user.deletedAccount deletionCleanup workflows

Database Events (Realtime)

EventTriggerउपयोग मामला
INSERTनया row जोड़ा गयानए order/customer notifications
UPDATERow modifiedStatus change workflows
DELETERow removedChurn detection

Webhook Events

EventTriggerउपयोग मामला
auth.user.createdwebhook के माध्यम से User signuponboarding trigger करें
storage.object.createdFile uploadedAsset processing

कोड उदाहरण

कनेक्टर शुरू करें

import { TajoClient } from '@tajo/sdk';
import { createClient } from '@supabase/supabase-js';
const tajo = new TajoClient({
apiKey: process.env.TAJO_API_KEY,
});
// Supabase project कनेक्ट करें
await tajo.connectors.connect('supabase', {
projectUrl: process.env.SUPABASE_URL,
serviceRoleKey: process.env.SUPABASE_SERVICE_ROLE_KEY,
});

Users को Contacts से Sync करें

// सभी Supabase Auth users को contacts के रूप में sync करें
await tajo.connectors.sync('supabase', {
type: 'full',
resources: ['users'],
});
// Incremental sync (केवल नए/बदले गए users)
await tajo.connectors.sync('supabase', {
type: 'incremental',
resources: ['users'],
since: '2024-01-01T00:00:00Z',
});

Real-time Changes सुनें

// engagement triggers के लिए नए orders की subscribe करें
const supabase = createClient(
process.env.SUPABASE_URL,
process.env.SUPABASE_SERVICE_ROLE_KEY
);
supabase
.channel('orders')
.on('postgres_changes',
{ event: 'INSERT', schema: 'public', table: 'orders' },
async (payload) => {
// Tajo को एक event के रूप में forward करें
await tajo.events.track({
email: payload.new.customer_email,
event: 'order_placed',
properties: {
order_id: payload.new.id,
total: payload.new.total,
items: payload.new.line_items,
},
});
}
)
.subscribe();

Query और Segment

// targeted campaigns के लिए plan द्वारा customers क्वेरी करें
const { data: proUsers } = await supabase
.from('customers')
.select('email, full_name, plan, mrr')
.eq('plan', 'pro')
.gt('mrr', 100)
.order('mrr', { ascending: false });
// campaign targeting के लिए Brevo list से sync करें
await tajo.lists.addContacts(PRO_LIST_ID, proUsers);

Rate Limits

API Rate Limits

Supabase rate limits आपके plan पर निर्भर करते हैं। Free tier: 500 requests/minute। Pro: 1,000 requests/second। Enterprise limits के लिए Supabase से संपर्क करें।

PlanRate LimitRealtime Connections
Free500 req/min200 concurrent
Pro1,000 req/s500 concurrent
Team2,000 req/s1,000 concurrent
EnterpriseCustomCustom

समस्या निवारण

सामान्य समस्याएं

समस्याकारणसमाधान
401 Unauthorizedअमान्य या expired API keySupabase Dashboard → Settings → API में API keys जांचें
403 ForbiddenRLS policy access block कर रही हैadmin operations के लिए service_role key का उपयोग करें, या RLS policies जांचें
कोई realtime events नहींtable के लिए Realtime enable नहींDatabase → Replication में enable करें → publication में table जोड़ें
खाली query resultsRLS सभी rows filter कर रहा हैसत्यापित करें कि RLS policies authenticated role को read करने की अनुमति देती हैं
Storage upload failBucket policiesजांचें कि Storage bucket public सेट है या इसमें सही RLS policies हैं

Debug Mode

connectors:
supabase:
debug: true
log_level: verbose
log_queries: true
log_realtime: true

Connection Test करें

Terminal window
tajo connectors test supabase
# ✓ API connection successful
# ✓ Auth endpoint accessible
# ✓ Tables readable (12 tables found)
# ✓ Storage accessible (3 buckets)
# ✓ Realtime connection established
# ✓ Edge Functions available (4 functions)

सर्वोत्तम प्रथाएं

  1. service_role key केवल server-side उपयोग करें, इसे client code में कभी expose न करें
  2. सभी tables पर RLS enable करें, service_role के साथ भी, defense in depth के लिए RLS के साथ design करें
  3. Event-driven sync के लिए Realtime का उपयोग करें, changes के लिए polling की तुलना में अधिक efficient
  4. Operations को batch करें, high-volume operations के लिए bulk inserts और in filter का उपयोग करें
  5. User metadata map करें, signup के दौरान engagement-relevant fields को user_metadata में store करें
  6. Webhooks के लिए Edge Functions का उपयोग करें, low-latency handling के लिए Supabase Edge Functions के साथ incoming webhooks process करें

सुरक्षा

  • API Key Authentication, सभी requests के लिए valid API keys आवश्यक
  • Row Level Security (RLS), प्रति row Postgres-native access control
  • JWT Verification, Auth tokens signed JWTs हैं जो हर request पर verified होते हैं
  • SSL/TLS, transit में सभी connections encrypted
  • SOC 2 Type II, Supabase SOC 2 compliant है
  • Network Restrictions, paid plans पर Optional IP allowlisting

संबंधित संसाधन

Subscribe to updates

developer-docs

Drop your email or phone number — we'll send you what matters next.

auto-detect
AI Assistant

Hi! Ask me anything about the docs.