@marktiderman/genesis-connect
0.4.0Primitive · DataConnect an outside account, server side: encrypted secrets with key versioning (AES-256-GCM, HKDF per purpose, a keyring with rotation) and an OAuth connector kit (authorization code with PKCE, a signed state, the verifier in a cookie, a pinned callback origin) on Web Request and Response, with Google and Todoist built in, and HMAC webhook checks. fetch and WebCrypto only, no dependencies: Node 20+, edge and Workers. Part of the Genesis framework.
Connect an outside account, server side, in a few lines. Three primitives:
- **Secrets with key versioning**: AES-256-GCM, a key per purpose (HKDF-SHA-256), each secret bound to its row, and a keyring so keys can be rotated without a migration. - **An OAuth connector kit**: the authorization-code flow with PKCE on Web `Request` and `Response`, Google and Todoist built in, any other provider as a plain object. The app keeps the rows; the kit does the flow, seals the refresh token and hands it over. - **Webhook signatures**: `verifyWebhookSignature` checks a provider's HMAC on a delivery's raw body, in constant time.
pnpm add @marktiderman/genesis-connectOther exports (20)
clearAccessTokenCache · CONNECT_RESULTS · ConnectError · createConnector · createSecrets · deriveSecretKey · GOOGLE_SCOPES · googleProvider · isConnectError · isSafeReturnOrigin · isSecretError · KEY_ID · openWithKey · parseKeyring · sealWithKey · SecretError · secretKeyBytes · TODOIST_SCOPES · todoistProvider · verifyWebhookSignature
And 25 types.
Other exports (9)
createSecrets · deriveSecretKey · isSecretError · KEY_ID · openWithKey · parseKeyring · sealWithKey · SecretError · secretKeyBytes
And 8 types.
Other exports (1)
verifyWebhookSignature
And 1 types.