RealComposer
Frontend / WebLinearSecurity & Secret Vault

Call linear api from client without exposing api key

Linear GraphQL from internal dashboards safely

Direct Answer & Architecture Summary

Linear API key stays in Vault; GraphQL POST runs on Workers. For "call linear api from client without exposing api key", store LINEAR_API_KEY in Secret Vault, call https://api.linear.app/graphql from a Worker, and let Frontend / Web hit only https://realcomposer.com/v1/workspace/call-linear-api-from-client-securely with an rc_live_ client token. POST upstream calls are not stored in caches.default; clients must send JSON bodies and headers forward unchanged.

Security LevelAES-256-GCM Vault
Edge LatencySub-10ms Response
InfrastructureZero Server Maintenance
The Problem Solved

Why Frontend / Web leaks Linear credentials

Attackers routinely extract Linear secrets from Frontend / Web builds. Direct browser calls also expose internal error payloads with hostnames.

Critical Security & Operational Risks:
  • Production Linear keys copied from Frontend / Web bundles
  • Compliance violations after credential leaks
  • Attackers replaying vault-grade scopes from a laptop
Architecture & Step-by-Step Implementation

How RealComposer Solves This at the Edge

1

Store upstream credentials in Secret Vault

Create LINEAR_API_KEY vault entries, then bind them to this pipeline step headers with {{secrets.NAME}} placeholders.

2

Target the real upstream URL

Configure headersTemplate to inject vault secrets, target https://api.linear.app/graphql, and Add output mapping fields that mirror the JSON contract your screen already expects.

3

Call from Frontend / Web

Allowed origins on the token should list every Frontend / Web host that calls this URL.

                    const res = await fetch('https://realcomposer.com/v1/workspace/call-linear-api-from-client-securely', {
  headers: { Authorization: 'Bearer rc_live_your_token' }
});
                  
Payload Slimming Comparison
85% Bandwidth Reduction
Raw Upstream Response255 B
              {
  "requestId": "req_call-lin",
  "upstreamLatencyMs": 142,
  "audit": {
    "region": "edge",
    "trace": "call-linear-api-from-client-securely"
  },
  "payload": {
    "id": "sample_id",
    "status": "active",
    "nested": {
      "tags": [
        "demo"
      ],
      "internal": true
    },
    "unused_blob": {
      "foo": "bar",
      "bar": "baz"
    }
  }
}
            
RealComposer Slimmed Edge Payload37 B
              {
  "issueId": "sample",
  "title": "sample"
}
            

Recipe Specs

HTTP method
POST
Upstream calls
1
Edge cache TTL
No caching
Client auth
Restricted client token
Mapped output fields
2
Payload
255 B to 37 B (-85%)
Call from Terminal or Client
curl -X POST "https://realcomposer.com/v1/workspace/call-linear-api-from-client-securely" \
  -H "Authorization: Bearer rc_live_client_token" \
  -H "Content-Type: application/json" \
  -d '{"model":"example"}'
Frequently Asked Questions

Developer Questions & Troubleshooting

Is it safe to log Linear responses in Frontend / Web?

Yes for call-linear-api-from-client-securely. Ship only an rc_live_ client token in Frontend / Web; RealComposer injects LINEAR_API_KEY on https://api.linear.app/graphql.

Will Anthropic or Linear prompt bodies be rewritten?

call-linear-api-from-client-securely vault headers attach server-side, but Anthropic or OpenAI model and messages must come from the client body.

How do I rotate upstream credentials?

Upstream steps in call-linear-api-from-client-securely honor timeoutMs and optional fallback JSON without leaking secrets.

Sources & Definitions Used in This Answer

Instant Deployment

Deploy this Frontend / Web + Linear Recipe

Clone this pre-configured pipeline into your RealComposer workspace in one click. We pre-populate upstream URLs, headers, and mapping rules.

CLONE THIS RECIPE
Related Architecture Recipes