New:Introducing Socket Scanning for VS Code Marketplace Extensions.Learn more →
Get Started

@context-dot-dev/convex

Package Overview
Dependencies
Maintainers
2
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@context-dot-dev/convex

Convex component for calling the Context.dev API from Convex functions.

latest
Source
npmnpm
Version
1.0.1
Version published
Weekly downloads
0
Maintainers
2
Weekly downloads
 
Created
Source

Convex Component

Context.dev Convex Component

Call the Context.dev API from your Convex actions. This component wraps the Context.dev REST API with typed helpers and isolated component actions—no data is stored in Convex.

Prerequisites

Install

npm install @context-dot-dev/convex

Setup

Add the component to your Convex app config and wire your API key through component env:

import contextDev from "@context-dot-dev/convex/convex.config.js";
import { defineApp } from "convex/server";
import { v } from "convex/values";

const app = defineApp({
  env: {
    CONTEXT_DEV_API_KEY: v.string(),
  },
});

app.use(contextDev, {
  env: {
    CONTEXT_DEV_API_KEY: app.env.CONTEXT_DEV_API_KEY,
  },
});

export default app;

Set CONTEXT_DEV_API_KEY on your Convex deployment:

npx convex env set CONTEXT_DEV_API_KEY your_api_key_here
npx convex dev

Usage

Create a shared client and call it from your actions:

import { ContextDev } from "@context-dot-dev/convex";
import { v } from "convex/values";

import { components } from "./_generated/api.js";
import { action } from "./_generated/server.js";

const contextDev = new ContextDev(components.contextDev);

export const brand = action({
  args: { domain: v.string() },
  handler: async (ctx, args) => {
    return await contextDev.retrieveBrand(ctx, {
      params: { domain: args.domain },
    });
  },
});

export const scrapeMarkdown = action({
  args: { url: v.string() },
  handler: async (ctx, args) => {
    return await contextDev.scrapeMarkdown(ctx, {
      params: { url: args.url },
    });
  },
});

Direct component actions

You can also call component actions directly with ctx.runAction:

import { v } from "convex/values";

import { components } from "./_generated/api.js";
import { action } from "./_generated/server.js";

export const brand = action({
  args: { domain: v.string() },
  handler: async (ctx, args) => {
    return await ctx.runAction(components.contextDev.brand.retrieve, {
      params: { domain: args.domain },
    });
  },
});

API reference

GET endpoints take params. POST endpoints take body and may also take params when the operation defines query parameters. Responses are validated as JSON before being returned to your function.

Helper methods

MethodDescription
scrapeHtmlScrape a URL and return raw HTML
scrapeMarkdownScrape a URL and return Markdown
scrapeImagesExtract image references from a page
crawlSitemapCrawl a domain sitemap
crawlCrawl a site and return Markdown pages
extractCrawl pages and extract structured data from a JSON schema
searchSearch the web with optional filters and Markdown extraction
competitorsFind direct competitors for a domain
styleguideExtract colors, typography, and design system details
fontsExtract font usage and font asset links
screenshotCapture a website screenshot
retrieveBrandRetrieve full brand data by domain
retrieveBrandByNameRetrieve brand data by company name
retrieveBrandByEmailRetrieve brand data from a business email
retrieveBrandByTickerRetrieve brand data by stock ticker
retrieveBrandByIsinRetrieve brand data by ISIN
identifyBrandFromTransactionIdentify a brand from transaction text
retrieveSimplifiedBrandRetrieve a smaller brand payload
prefetchBrandQueue brand prefetching by domain
prefetchBrandByEmailQueue brand prefetching by email
retrievePersonRetrieve a person profile from supported identifiers
retrieveNaicsClassify a company into NAICS codes
retrieveSicClassify a company into SIC codes
aiQueryExtract custom AI-defined datapoints from a website
extractProductExtract product data from a product page URL
extractProductsExtract product listings from a domain or URL

Component action groups

Raw component actions are available under:

  • components.contextDev.brand
  • components.contextDev.web
  • components.contextDev.ai
  • components.contextDev.industry
  • components.contextDev.people

Argument and response types are inferred from the Context.dev OpenAPI spec, so your editor will autocomplete params and body fields.

Caching

This component does not persist data in Convex. Context.dev caching is controlled through API parameters such as maxAgeMs on individual requests.

Learn more

FAQs

Package last updated on 01 Jul 2026

Related posts