@mcp-z/oauth
    Preparing search index...

    Function createAccountKey

    • Create account-scoped storage key.

      These keys are scoped to a specific account (email address) and store account-specific data like OAuth tokens and account metadata.

      Parameters

      • type: AccountKeyType

        Key type ('token' for OAuth tokens, 'metadata' for account details, 'dcr-client' for DCR registration)

      • params: AccountKeyParams

        Account key parameters with explicit field names

      Returns string

      Storage key in format: "{accountId}:{service}:{type}"

      // Store OAuth token
      const tokenKey = createAccountKey('token', {
      accountId: 'alice@gmail.com',
      service: 'gmail'
      });
      // Returns: "alice@gmail.com:gmail:token"

      // Store account metadata (alias, timestamps, profile)
      const metadataKey = createAccountKey('metadata', {
      accountId: 'alice@gmail.com',
      service: 'gmail'
      });
      // Returns: "alice@gmail.com:gmail:metadata"

      // Store DCR client registration info
      const dcrKey = createAccountKey('dcr-client', {
      accountId: 'alice@outlook.com',
      service: 'outlook'
      });
      // Returns: "alice@outlook.com:outlook:dcr-client"