apideck-best-practices
БесплатноБез исполняемых скриптовНе проверенBest practices for building Apideck integrations. Covers authentication patterns, pagination, error handling, connection management with Vault, webhook setup…
от diegosouzapw★ 68 звёзд на GitHubОб этом скилле
The Apideck Unified API base URL is https://unify.apideck.com. All API calls must be made server-side to prevent token leakage.
Authentication
Every API call requires three headers: Authorization: Bearer {API_KEY}, x-apideck-app-id, and x-apideck-consumer-id. The x-apideck-service-id header specifies which downstream connector to use (e.g., salesforce, quickbooks, xero). When a consumer has multiple connections for the same unified API, x-apideck-service-id is required.
Never hardcode API keys in source code. Always use environment variables or a secrets manager. Never expose API keys to the client/browser.
SDK Selection
Always use the official Apideck SDK for the user's language. Do not make raw HTTP calls when an SDK is available:
| Language | Package |
|---|---|
| TypeScript/Node.js | @apideck/unify |
| Python | apideck-unify |
| C# / .NET | ApideckUnifySdk |
| Java | com.apideck:unify |
| Go | github.com/apideck-libraries/sdk-go |
| PHP | apideck-libraries/sdk-php |
All SDKs follow the same CRUD pattern: client.{api}.{resource}.{operation}(). All SDKs support retry configuration with exponential backoff.
Consumer ID Architecture
The consumerId represents your end-user — the person whose third-party connections you're accessing. In multi-tenant SaaS applications:
- Create one Apideck consumer per customer/tenant
- Store the mapping between your user IDs and Apideck consumer IDs
- Pass the correct
consumerIdper request — never use a shared consumer for all users - Use Vault sessions to let each user manage their own connections
Connection Management
Always use Apideck Vault for managing end-user connections. Never build custom OAuth flows when Vault handles them.
Use @apideck/vault-js to embed the connection management modal in your frontend. Session creation must always happen server-side:
- Server-side: Create a Vault session via
vault.sessions.create()with the consumer's metadata - Client-side: Open the modal with
ApideckVault.open({ token }) - Handle
onConnectionChangecallbacks to update your UI when users authorize/modify connections
Customize the Vault modal appearance via session theme properties (logo, colors, vault name) to match your brand.
Pagination
Apideck uses cursor-based pagination across all list endpoints. Always paginate — never assume a single page returns all records.
- Set
limit(1-200, default 20) to control page size - Use the SDK's built-in pagination:
for await...of(Node.js),.next()(Python/Go/.NET),callAsStream()(Java),foreachgenerator (PHP) - Stop when the next cursor is
null
For incremental sync, use filter[updated_since] with an ISO 8601 timestamp to fetch only records modified since your last sync.
Filtering and Field Selection
Always filter server-side using the filter parameter. Never fetch all records and filter client-side — this wastes API units and increases response time.
Always use the fields parameter to request only the columns you need. This reduces response size and improves performance. Example: fields=id,name,email,updated_at.
Error Handling
Always handle errors. All SDKs provide typed error classes:
| HTTP Code | Meaning | Action |
|---|---|---|
| 400 | Bad Request | Fix request parameters |
| 401 | Unauthorized | Check API key and consumer credentials |
| 402 | Payment Required | API limit reached — upgrade plan or wait |
| 404 | Not Found | Resource does not exist or wrong service ID |
| 422 | Unprocessable | Validation error — check required fields |
| 429 | Rate Limited | Back off and retry (check x-downstream-ratelimit-reset header) |
| 5xx | Server Error | Retry with exponential backoff |
For downstream connector errors, inspect the detail and downstream_errors fields to get the original error from the third-party service.
Pass-Through for Connector-Specific Fields
When the unified model doesn't cover a connector-specific field, use pass_through in the request body:
{
"first_name": "John",
"pass_through": [
{
"service_id": "salesforce",
"operation_id": "contactsAdd",
"extend_object": { "custom_sf_field__c": "value" }
}
]
}
Use custom field mapping in Vault to let end-users map their connector-specific fields without code changes.
Webhooks
Use Apideck webhooks for real-time notifications instead of polling. Apideck supports both native webhooks (from connectors that support them) and virtual webhooks (polling-based for connectors that don't).
Always verify webhook signatures using the x-apideck-signature header with HMAC-SHA256. Never process unverified webhook payloads.
Webhook events follow the pattern {api}.{resource}.{action} (e.g.
Установить apideck-best-practices в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл apideck-best-practices?
Best practices for building Apideck integrations. Covers authentication patterns, pagination, error handling, connection management with Vault, webhook setup, and common pitfalls. Use when designing or reviewing any Apideck integration regardless of language.
Как установить скилл apideck-best-practices?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл apideck-best-practices запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic