Structures

The following structures are available globally.

  • Encapsulates all configuration options for a TrustPin instance.

    Pass a TrustPinConfiguration to setup(_:) (or the static setup(_:autoRegisterURLProtocol:) for the default instance). All properties are immutable — construct the value once and pass it directly to setup.

    Basic usage

    try await TrustPin.setup(TrustPinConfiguration(
        organizationId: "your-org-id",
        projectId: "your-project-id",
        publicKey: "your-base64-public-key"
    ))
    

    Custom mode

    try await TrustPin.setup(TrustPinConfiguration(
        organizationId: "your-org-id",
        projectId: "your-project-id",
        publicKey: "your-base64-public-key",
        mode: .permissive
    ))
    

    Custom configuration URL

    For self-hosted or BYOK deployments, supply a configurationURL pointing to a signed JWS payload. CDN-managed projects should leave this nil.

    try await TrustPin.setup(TrustPinConfiguration(
        organizationId: "org",
        projectId: "proj",
        publicKey: key,
        configurationURL: URL(string: "https://your-server.com/pins.jws")
    ))
    
    See more

    Declaration

    Swift

    public struct TrustPinConfiguration : Sendable