> ## Documentation Index
> Fetch the complete documentation index at: https://usegately.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Integrations

> Connect Gately with your favorite tools and services

Gately integrates with popular tools and services to extend functionality and automate workflows.

## Available Integrations

<CardGroup cols={3}>
  <Card title="Stripe" icon="stripe">
    Payment processing
  </Card>

  <Card title="Zapier" icon="bolt">
    Workflow automation
  </Card>

  <Card title="Slack" icon="slack">
    Team notifications
  </Card>

  <Card title="Google Sheets" icon="table">
    Data sync
  </Card>

  <Card title="Mailchimp" icon="envelope">
    Email marketing
  </Card>

  <Card title="Make" icon="gear">
    Advanced automation
  </Card>
</CardGroup>

## Stripe

Accept payments and manage subscriptions with Stripe.

### Setup

1. Go to **Settings > Integrations > Stripe**
2. Click **Connect Stripe**
3. Authorize Gately in your Stripe account
4. Configure webhook endpoints

### Features

* One-time payments
* Recurring subscriptions
* Customer portal
* Invoices
* Refunds

### Webhook Events

Gately automatically handles these Stripe events:

| Event                           | Action                |
| ------------------------------- | --------------------- |
| `checkout.session.completed`    | Activate subscription |
| `invoice.paid`                  | Record payment        |
| `customer.subscription.updated` | Update plan           |
| `customer.subscription.deleted` | Cancel subscription   |

## Zapier

Connect Gately to 5,000+ apps with Zapier.

### Available Triggers

| Trigger         | Description                      |
| --------------- | -------------------------------- |
| New Member      | When a member signs up           |
| Form Submission | When a form is submitted         |
| New Ticket      | When a support ticket is created |
| Plan Changed    | When a member changes plans      |

### Available Actions

| Action        | Description              |
| ------------- | ------------------------ |
| Create Member | Add a new member         |
| Update Member | Update member data       |
| Send Email    | Send transactional email |
| Create Ticket | Create support ticket    |

### Setup

1. Go to [zapier.com](https://zapier.com)
2. Search for "Gately"
3. Connect your Gately account
4. Create your Zap

## Slack

Get real-time notifications in Slack.

### Setup

1. Go to **Settings > Integrations > Slack**
2. Click **Connect Slack**
3. Select your workspace
4. Choose notification channel

### Notification Types

| Event           | Notification                                                 |
| --------------- | ------------------------------------------------------------ |
| New Member      | "🎉 New member: [john@example.com](mailto:john@example.com)" |
| New Ticket      | "🎫 New ticket: Login issue"                                 |
| Payment         | "💰 Payment received: \$99"                                  |
| Form Submission | "📝 New submission: Contact Form"                            |

### Customization

Configure which events trigger notifications:

```json theme={null}
{
  "member.created": true,
  "ticket.created": true,
  "payment.succeeded": true,
  "form.submitted": false
}
```

## Google Sheets

Sync data to Google Sheets automatically.

### Setup

1. Go to **Settings > Integrations > Google Sheets**
2. Click **Connect Google**
3. Select or create a spreadsheet
4. Map fields to columns

### Sync Options

| Option      | Description           |
| ----------- | --------------------- |
| Members     | Sync member data      |
| Submissions | Sync form submissions |
| Payments    | Sync payment records  |

### Field Mapping

```json theme={null}
{
  "A": "email",
  "B": "full_name",
  "C": "plan_id",
  "D": "created_at"
}
```

## Mailchimp

Sync members with Mailchimp audiences.

### Setup

1. Go to **Settings > Integrations > Mailchimp**
2. Click **Connect Mailchimp**
3. Select your audience
4. Configure sync settings

### Sync Options

| Option        | Description                 |
| ------------- | --------------------------- |
| Auto-add      | Add new members to audience |
| Sync tags     | Sync plan as Mailchimp tag  |
| Double opt-in | Require email confirmation  |

### Tag Mapping

Map Gately plans to Mailchimp tags:

| Plan       | Tag        |
| ---------- | ---------- |
| free       | Free User  |
| pro        | Pro Member |
| enterprise | Enterprise |

## Make (Integromat)

Build advanced automations with Make.

### Available Modules

**Triggers:**

* Watch Members
* Watch Form Submissions
* Watch Tickets

**Actions:**

* Create/Update Member
* Submit Form
* Create Ticket
* Send Email

### Example Scenario

```
New Form Submission → Filter (rating < 3) → Create Ticket → Notify Slack
```

## Custom Integrations

### Webhooks

Use webhooks for custom integrations:

```bash theme={null}
curl -X POST "https://your-server.com/webhook" \
  -H "Content-Type: application/json" \
  -d '{
    "event": "member.created",
    "data": {...}
  }'
```

### API

Use the REST API for full control:

```javascript theme={null}
// Fetch members and sync to your system
const members = await fetch('https://api.usegately.com/api/v1/members', {
  headers: {
    'Authorization': `Bearer ${API_KEY}`,
    'X-Project-ID': PROJECT_ID
  }
}).then(r => r.json())

// Sync to your database
for (const member of members.data) {
  await syncToMyDatabase(member)
}
```

## OAuth Apps

Build OAuth apps that integrate with Gately:

### Register Your App

1. Go to **Settings > Developers > OAuth Apps**
2. Click **Create App**
3. Configure redirect URIs
4. Get client ID and secret

### OAuth Flow

```javascript theme={null}
// 1. Redirect to authorization
const authUrl = `https://app.usegately.com/oauth/authorize?
  client_id=${CLIENT_ID}&
  redirect_uri=${REDIRECT_URI}&
  scope=read:members write:members`

// 2. Exchange code for token
const token = await fetch('https://api.usegately.com/api/v1/oauth/token', {
  method: 'POST',
  body: JSON.stringify({
    grant_type: 'authorization_code',
    code: authCode,
    client_id: CLIENT_ID,
    client_secret: CLIENT_SECRET
  })
}).then(r => r.json())

// 3. Use access token
const members = await fetch('https://api.usegately.com/api/v1/members', {
  headers: {
    'Authorization': `Bearer ${token.access_token}`
  }
})
```

## Best Practices

<AccordionGroup>
  <Accordion title="Test in Development">
    Use test/sandbox modes before enabling in production.
  </Accordion>

  <Accordion title="Monitor Sync Status">
    Regularly check integration logs for errors.
  </Accordion>

  <Accordion title="Handle Rate Limits">
    Implement retry logic for rate-limited requests.
  </Accordion>

  <Accordion title="Secure Credentials">
    Store API keys and secrets securely.
  </Accordion>
</AccordionGroup>
