Cloudflare - v1.3.0
    Preparing search index...

    Module index

    Public API of the Cloudflare adapters.

    The package's main published surface. package.json#exports points here and TypeDoc documents from here, so a symbol is API when it appears below and internal when it does not.

    The Hono middleware is not here. It sits behind the ./middlewares subpath so hono stays an optional peer dependency; that module explains why.

    The platform side of the seam @bayudwiyansatria/core defines. The kernel says what an application needs — a cache, relational storage, a queue — and this package says what Cloudflare provides for it:

    • core/bindings/ — one accessor per binding, over Binding. An accessor holds the binding's name, not the binding, and resolves it from the Env passed to each call, which is what makes one module-scope instance safe across requests.
    • core/services/ — one capability service per accessor. KVService is a CacheStore, D1Service a DataStore, so business logic depends on the capability and never names Cloudflare.
    • constants/ — cloudflareDefaults, the binding-backed half of the configuration surface.
    • core/observability/ — RequestCorrelation, the header that carries one request id across a Service Binding hop, and — from constants/ — events, the names the cross-cutting log lines are filed under. Everything else about observability is Cloudflare's own and is not reimplemented here.
    • CloudflareEnv — the environment contract a consuming Worker extends.
    import { configure, systemDefaults } from '@bayudwiyansatria/core'
    import { cloudflareDefaults, KVService } from '@bayudwiyansatria/cloudflare'

    // Once, at startup, before any accessor reads a setting.
    configure({ ...systemDefaults, ...cloudflareDefaults })

    const cache = new KVService()
    const hit = await cache.get(env, 'article:1')
    Category Exports
    Bindings Binding and the eighteen accessors over it
    Services The ten capability services
    Config cloudflareDefaults and the twenty settings shapes
    Observability events, RequestCorrelation
    Platform CloudflareEnv, CloudflareRequestMetadata
    Errors MissingBindingError

    Bayu Dwiyan Satria

    1.3.0

    1.0.0

    AIBinding
    AiSearchBinding
    AiSearchNamespaceBinding
    AIService
    AnalyticsBinding
    AnalyticsService
    Binding
    BrowserBinding
    CloudflareRequestMetadata
    D1Binding
    D1Service
    DurableObjectBinding
    DurableObjectService
    FlagshipBinding
    HyperdriveBinding
    HyperdriveService
    KVBinding
    KVService
    MissingBindingError
    PipelineBinding
    QueueBinding
    QueueService
    R2Binding
    R2Service
    RateLimitBinding
    RateLimitService
    RequestCorrelation
    VectorizeBinding
    VectorizeService
    VpcNetworkBinding
    VpcServiceBinding
    WorkflowBinding
    AiSearchNamespaceSettings
    AiSearchSettings
    AISettings
    AnalyticsSettings
    BindingSettings
    BrowserSettings
    CloudflareConfiguration
    CloudflareEnv
    D1Settings
    DurableObjectSettings
    FlagshipSettings
    HyperdriveSettings
    KVSettings
    PipelineSettings
    QueueSettings
    R2Settings
    RateLimitSettings
    VectorizeSettings
    VpcNetwork
    VpcNetworkSettings
    VpcServiceSettings
    WorkflowSettings
    D1Statement
    D1WriteResult
    HyperdriveCredentials
    cloudflareDefaults
    events