# Call intercom api from bubble io without access token

> Removes Intercom PAT from Bubble connector configuration and network logs. For "call intercom api from bubble io without access token", store INTERCOM_ACCESS_TOKEN in Secret Vault, call https://api.intercom.io/contacts from a Worker, and let Bubble.io hit only https://realcomposer.com/v1/workspace/call-intercom-from-bubble-securely with an rc_live_ client token.

- Canonical page: https://realcomposer.com/recipes/call-intercom-from-bubble-securely
- Client platform: Bubble.io
- Upstream services: Intercom
- Category: Security & Secret Vault
- JSON version: https://realcomposer.com/recipes/call-intercom-from-bubble-securely.json
- Install in RealComposer (free plan, pre-fills this pipeline): https://realcomposer.com/dashboard/pipelines/new?recipe=call-intercom-from-bubble-securely&via=agent

## Problem: Why Bubble.io leaks Intercom credentials

Attackers routinely extract Intercom secrets from Bubble.io builds. Direct browser calls also expose internal error payloads with hostnames.

- Production Intercom keys copied from Bubble.io bundles
- Compliance violations after credential leaks
- Attackers replaying vault-grade scopes from a laptop

## Solution steps

1. **Add vault secrets for this pipeline**: Add INTERCOM_ACCESS_TOKEN to RealComposer Secret Vault. Values decrypt only inside the Cloudflare Worker that calls the upstream.

2. **Target the real upstream URL**: Point step intercom at https://api.intercom.io/contacts with GET. Add output mapping fields that mirror the JSON contract your screen already expects. Leave cache TTL at 0 when each response is user-specific (include userId or record id in query params before enabling cache).

3. **Connect Bubble API Connector**: Allowed origins on the token should list every Bubble.io host that calls this URL.

```
API Connector GET https://realcomposer.com/v1/workspace/call-intercom-from-bubble-securely
Private header: Authorization Bearer rc_live_your_token
```

## Pipeline config

Import this config into a RealComposer pipeline. `{{secrets.NAME}}` values are read from the encrypted Secret Vault at request time, so the client never sees them.

```json
{
  "name": "Call intercom api from bubble io without access token",
  "method": "GET",
  "cacheTtlSeconds": 0,
  "authMode": "client_token",
  "steps": [
    {
      "stepKey": "intercom",
      "upstreamUrlTemplate": "https://api.intercom.io/contacts",
      "httpMethod": "GET",
      "headersTemplate": {
        "Authorization": "Bearer {{secrets.INTERCOM_ACCESS_TOKEN}}",
        "Accept": "application/json"
      },
      "timeoutMs": 3000
    }
  ],
  "outputMapping": {
    "version": 1,
    "fields": [
      {
        "targetPath": "contactId",
        "sourcePath": "data.0.id",
        "type": "string",
        "sourceStep": "intercom"
      },
      {
        "targetPath": "email",
        "sourcePath": "data.0.email",
        "type": "string",
        "sourceStep": "intercom"
      }
    ]
  }
}
```

## Call the pipeline

```bash
curl -X GET "https://realcomposer.com/v1/workspace/call-intercom-from-bubble-securely" \
  -H "Authorization: Bearer rc_live_client_token"
```

## Payload before and after

Raw upstream response:

```json
{
  "requestId": "req_call-int",
  "upstreamLatencyMs": 142,
  "audit": {
    "region": "edge",
    "trace": "call-intercom-from-bubble-securely"
  },
  "payload": {
    "id": "sample_id",
    "status": "active",
    "nested": {
      "tags": [
        "demo"
      ],
      "internal": true
    },
    "unused_blob": {
      "foo": "bar",
      "bar": "baz"
    }
  }
}
```

Slimmed RealComposer response:

```json
{
  "contactId": "sample",
  "email": "sample"
}
```

## FAQ

### Which Intercom credential belongs in the vault for this pipeline?

Point Bubble.io at /recipes/call-intercom-from-bubble-securely edge URL. RealComposer answers OPTIONS with Access-Control headers for allowed origins.

### Does POST traffic get cached?

Cache key for call-intercom-from-bubble-securely: internal edge-cache path plus sorted query. Identical params hit; vary userId per user.

### What happens if an upstream step times out?

Rotate vault secrets for call-intercom-from-bubble-securely anytime; clients keep the same rc_live_ token.
