CredentialProvider SDK reference

TypeScript contract reference for provider metadata, schemas, operations, lifecycle results, setup hints, and context capabilities.

referenceFor provider authors, SDK usersOwner Constal platform teamVerified 2026-08-20

Import CredentialProvider contracts from @constal/sdk. The package validates definitions at module load and the managed builder validates the probed metadata again before catalog publication.

Primary exports

ExportPurpose
credentialProvider(definition)Build and validate a provider Driver
credentialProviderConfigSchema(schema)Validate the supported non-secret schema subset
credentialProviderSetupMetadata(value, slots)Validate optional Console presentation metadata
CredentialProviderDefinitionComplete author contract
CredentialProviderPackageMetadataProbed immutable package metadata
CredentialProviderCatalogEntryPackage reference, management, Driver, schemas, and metadata
CredentialMintRequest / CredentialMintResultMint and refresh contract
CredentialAuthorizationBeginRequestBegin browser authorization
CredentialAuthorizationCompleteRequestComplete browser authorization
CredentialMaterialRequestVerify or destroy one version

Definition fields

id, version, displayName, description, credentialSlots, configSchema, credentialConfigSchema, rotation, egress, and mint are required. documentationUrl, setup, authorization, mintRecovery, verify, and destroy are optional according to provider behavior.

Driver context

Provider callbacks use the ordinary Driver context. Important capabilities include:

  • secret(slot) for declared bootstrap Credential material;
  • egress(request) for bounded allowlisted HTTPS operations;
  • audit(event) for non-secret provider audit details.

Provider code does not receive direct database, vault, queue, analytics, tenant registry, or CredentialCoordinator bindings.

Result rules

Mint and authorization completion return non-empty material, optional positive expiresAt, and optional private lifecycle state. Verification returns { verified: boolean }. Destruction returns { destroyed: boolean }.

Do not include access material inside private state or refresh tokens inside consumer material. Keep the two lifecycles separated.

Resource selectors

ScopedCredentialRef declares kind: "scoped", a logical key, explicit owner scope, and required: true. ScopedResourceRef additionally pins a Resource contract. Read Scoped bindings for resolution semantics.

Machine-readable schemas