Secure API token management for Convex with token lifecycle, encryption, validation, and middleware for authentication workflows.
npm install convex-api-tokensConvex component for API token management: issuance, validation, rotation, revocation, and encrypted third-party key storage
Use convex-api-tokens to implement secure token authentication in your Convex backend. The component provides createTokenAuth() middleware for HTTP actions and withTokenAuth() for mutations, handling token validation and user context automatically.
Store third-party API keys securely using convex-api-tokens encrypted storage. The component encrypts keys with AES-256-GCM before database storage and provides retrieval methods for use in your Convex functions.
Implement token lifecycle management with convex-api-tokens rotation and bulk revocation features. You can refresh existing tokens, revoke tokens by namespace, or perform bulk revocation by time range for security compliance.
Configure token expiration and idle timeouts using convex-api-tokens lifecycle management. The validation system returns detailed failure reasons including expired, idle_timeout, revoked, and invalid states for proper error handling.
convex-api-tokens generates sk_-prefixed tokens that follow industry standards. These tokens can be organized by namespaces and include configurable expiration times and idle timeout settings for security compliance.
The convex-api-tokens validation system returns specific failure reasons including expired, idle_timeout, revoked, and invalid states. This allows your application to handle different authentication failures appropriately and provide meaningful error messages.
Yes, convex-api-tokens provides encrypted storage for third-party API keys like Stripe and OpenAI credentials. It uses AES-256-GCM encryption to secure keys in your Convex database and provides safe retrieval methods.
convex-api-tokens provides createTokenAuth() middleware for HTTP actions and withTokenAuth() middleware for mutations. Both handle token validation automatically and inject user context into your Convex functions with TypeScript support.
convex-api-tokens supports bulk revocation operations by namespace or time range. You can revoke all tokens in a specific namespace or revoke tokens created within a certain time period for security incident response.