Prerequisite You should have installed Node.js (version 18.10.0 or higher) and have a Supabase project set up.

Installation

Install KeyHippo in your project:

KeyHippo Class

The main class for interacting with KeyHippo functionality.

import { KeyHippo } from 'keyhippo';

const keyHippo = new KeyHippo(supabaseClient, logger);

Constructor

  • supabaseClient: SupabaseClient - Your initialized Supabase client
  • logger (optional): Logger - Custom logger object (defaults to console)

Methods

Types

Error Handling

KeyHippo uses a custom AppError type for error handling:

type AppError =
  | { _tag: "DatabaseError"; message: string }
  | { _tag: "UnauthorizedError"; message: string }
  | { _tag: "ValidationError"; message: string }
  | { _tag: "NetworkError"; message: string };

Wrap KeyHippo method calls in try-catch blocks to handle these errors appropriately in your application.

Troubleshooting

Here’s how to solve some common problems when working with the KeyHippo client:

For more detailed troubleshooting, refer to the KeyHippo GitHub repository or consult the full documentation.