IProviderEncryptionOptions Interface

Configuration object for the Katlux end-to-end encryption pipeline. Accepted by RequestProvider.setEncryption(), and the encryption option on AAPIDataProvider-based providers (CAPIFlatClientDataProvider, CAPITreeClientDataProvider). Uses the standard Web Crypto API (crypto.subtle) with AES-256-GCM by default โ€” zero external npm dependencies.

๐Ÿ“– Encryption & SSR Security Guide ยท ๐Ÿ”’ CWebCryptoEncryptionProvider ยท ๐Ÿ›๏ธ AEncryptionProvider ยท ๐Ÿ”Œ IEncryptionProvider

Usage Examples

โš ๏ธ Security Notice: Never store symmetric secrets in public client configs (such as useRuntimeConfig().public). Keys must be retrieved dynamically per session via authenticated APIs. Offline mutation queues automatically persist payloads in encrypted form.

Use IProviderEncryptionOptions to configure encryption on a data provider (e.g. ADataProvider implementations) or directly on RequestProvider:

1 ยท Simple key string
const provider = new CAPIFlatClientDataProvider({
  encryption: {
    enabled: true,
    key: 'my-32-char-secret-passphrase!!!'
  }
})
2 ยท SSR Security Guard
const provider = new CAPIFlatClientDataProvider({
  encryption: {
    enabled: true,
    key: 'my-32-char-secret-passphrase!!!',
    decryptOnSSR: false
  }
})
3 ยท Async key provider (session / KMS)
const provider = new CAPIFlatClientDataProvider({
  encryption: {
    enabled: true,
    key: () => useAuth().getSessionKey()
  }
})
4 ยท Field-level encryption
const provider = new CAPIFlatClientDataProvider({
  encryption: {
    enabled: true,
    key: 'secret',
    fields: ['ssn', 'balance', 'fullName']
  }
})