1.1.4 • Published 5 months ago

lighthouse-private-markets-sdk v1.1.4

Weekly downloads
-
License
MIT
Repository
-
Last release
5 months ago

Lighthouse JS SDK

Lighthouse is an AI-powered platform that automates the entire venture capital deal flow cycle—from sourcing to due diligence. Our platform empowers investors with real-time insights and seamless workflows, helping VCs identify and evaluate high-potential startups more efficiently. Visit us at https://trylighthouse.vc to learn more.

Installation

Using npm:

npm i lighthouse-private-markets-sdk

Using yarn:

yarn add lighthouse-private-markets-sdk

Quick Start

JavaScript (CommonJS)

const { Lighthouse } = require('lighthouse-private-markets-sdk');

// Initialize the client
const lighthouse = new Lighthouse('your-api-key');

// Simple query example
async function getStartups() {
    try {
        const { data, error } = await lighthouse
            .from('startups')
            .select('*')
            .limit(10);
        
        if (error) throw error;
        console.log('Startups:', data);
    } catch (err) {
        console.error('Error:', err.message);
    }
}

JavaScript (ES Modules)

import { Lighthouse } from 'lighthouse-private-markets-sdk';

// Initialize the client
const lighthouse = new Lighthouse('your-api-key');

// Using async/await with try/catch
async function getStartup() {
    try {
        const { data, error } = await lighthouse
            .from('startups')
            .select('name, valuation, founded_date')
            .eq('id', 123)
            .single();
        
        if (error) throw error;
        console.log('Startup:', data);
    } catch (err) {
        console.error('Error:', err.message);
    }
}

Common Query Examples

Select Single Record

// Get a specific startup
const { data, error } = await lighthouse
    .from('startups')
    .select('*')
    .eq('id', 123)
    .single();

Filter Records

// Get all startups valued over $1M
const { data, error } = await lighthouse
    .from('startups')
    .select('name, valuation')
    .gte('valuation', 1000000)
    .order('valuation', { ascending: false });

Select with Relationships

// Get startups with their founders
const { data, error } = await lighthouse
    .from('startups')
    .select('name, founders (name, role)');

Pagination

// Get 10 records with offset
const { data, error } = await lighthouse
    .from('startups')
    .select('*')
    .range(0, 9);

Full Text Search

// Search startups by name
const { data, error } = await lighthouse
    .from('startups')
    .select('*')
    .textSearch('name', 'tech');

Available Methods

Basic Filters

  • select(*columns: str): Choose specific fields to return
  • single(): Request a single record
  • eq(column: str, value: Any): Equal to filter
  • neq(column: str, value: Any): Not equal to filter
  • gt(column: str, value: Any): Greater than filter
  • lt(column: str, value: Any): Less than filter
  • gte(column: str, value: Any): Greater than or equal to filter
  • lte(column: str, value: Any): Less than or equal to filter
  • is(column: str, value: Any): 'IS' filter
  • in(column: str, values: Array<Any>): 'IN' filter for array of values

Text Search

  • like(column: str, pattern: str): Pattern matching (case sensitive)
  • ilike(column: str, pattern: str): Pattern matching (case insensitive)
  • textSearch(column: str, query: str): Full text search

Array/JSON Operations

  • contains(column: str, value: Array<Any> | string | Object): Check if array/json contains value
  • containedBy(column: str, value: Array<Any> | string | Object): Check if contained by value
  • overlaps(column: str, values: Array<Any>): Overlaps with values

Result Modification

  • order(column: str, options: { ascending: boolean }): Sort results
  • limit(size: number): Limit number of rows
  • range(start: number, end: number): Get a range of rows
  • offset(size: number): Set the starting row index

Logical Operations

  • not(): Negate the next filter
  • or(filters: string): OR condition
  • match(query: Object): Match multiple columns
  • filter(column: str, operator: str, value: Any): Apply a custom filter

Output Format

  • csv(): Return results as CSV
  • explain(): Get query explanation

Error Handling

const { data, error } = await lighthouse
    .from('startups')
    .select('*');

if (error) {
    console.error('Error:', error);
}

// Process your data
console.log(data);
1.1.4

5 months ago

1.1.3

5 months ago

1.1.2

5 months ago

1.1.1

5 months ago

1.1.0

5 months ago

1.0.9

5 months ago

1.0.8

5 months ago

1.0.7

5 months ago

1.0.6

5 months ago

1.0.5

5 months ago

1.0.4

5 months ago

1.0.3

5 months ago

1.0.2

5 months ago

1.0.1

5 months ago

1.0.0

5 months ago