Skip to main content
This reference documents the public APIs in baton-sdk that connector developers use. The SDK follows an inversion-of-control pattern: you implement interfaces, the SDK calls your methods.

Connector builder interfaces

Connectorbuilder (entry point)

The main interface your connector must implement:
Required sub-interfaces:
Usage:

ResourceSyncer (core sync)

The primary interface for syncing data:
V2 Sync Types:
Key differences V1 vs V2:
  • V2 receives SyncOpAttrs with session store for caching
  • V2 returns structured SyncOpResults instead of raw values
  • V2 is preferred for new connectors

ResourceTargetedSyncer (single resource fetch)

Extension for fetching a single resource by ID:
Enables CAPABILITY_TARGETED_SYNC for faster incremental updates.

ResourceProvisioner (grant/revoke)

For connectors that can modify access:
V2 advantage: Grant() returns list of created grants, useful when one grant creates multiple assignments. Enables CAPABILITY_PROVISION.

AccountManager (user provisioning)

For creating user accounts (JIT provisioning):
Response types:
  • *v2.CreateAccountResponse_SuccessResult - Account created successfully
  • *v2.CreateAccountResponse_ActionRequiredResult - User action needed
Enables CAPABILITY_ACCOUNT_PROVISIONING.

ResourceManager (create/delete resources)

For creating and deleting resources:
Enables CAPABILITY_RESOURCE_CREATE and CAPABILITY_RESOURCE_DELETE.

CredentialManager (credential rotation)

For rotating credentials:
Returns plaintext credentials; the SDK encrypts them before sending to C1. Enables CAPABILITY_CREDENTIAL_ROTATION.

CustomActionManager (custom actions)

For connectors with custom operations:
Enables CAPABILITY_ACTIONS.

EventFeed (real-time events)

For streaming events from the target system:
Enables CAPABILITY_EVENT_FEED_V2.

Type builders

Resource builder

Resource Options:

User trait options

Status values: Account types:

Entitlement builder

Entitlement Options:

Grant builder

Grant Options:

Pagination

Token types

Pagination bag

For nested or multi-resource pagination:

HTTP client utilities

Creating clients

Caching

Features: built-in response caching, rate limit extraction, automatic retry with exponential backoff on 429.

Session store

For caching data across pagination calls:
Accessing in sync methods (V2):

Capabilities matrix

Capabilities are automatically detected based on which interfaces you implement:

Quick reference

Import paths

Common patterns