npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@adobe/spacecat-shared-drs-client

v1.4.1

Published

Shared modules of the Spacecat Services - Data Retrieval Service Client

Readme

Spacecat Shared - DRS Client

A JavaScript client for the Data Retrieval Service (DRS) API, part of the SpaceCat Shared library. It supports job submission (prompt generation, web scraping), scrape result lookups, and brand detection triggers.

Installation

Install the package using npm:

npm install @adobe/spacecat-shared-drs-client

Configuration

Set the following environment variables:

  • DRS_API_URL — Base URL of the DRS API
  • DRS_API_KEY — API key for authentication

Usage

Creating an instance from Helix UniversalContext

import DrsClient from '@adobe/spacecat-shared-drs-client';

const client = DrsClient.createFrom(context);

Constructor

import DrsClient from '@adobe/spacecat-shared-drs-client';

const client = new DrsClient({
  apiBaseUrl: '<DRS_API_URL>',
  apiKey: '<DRS_API_KEY>',
}, log);

Methods

submitScrapeJob(params)

Submits a web scraping job via the Bright Data provider.

import { SCRAPE_DATASET_IDS } from '@adobe/spacecat-shared-drs-client';

const result = await client.submitScrapeJob({
  datasetId: SCRAPE_DATASET_IDS.YOUTUBE_VIDEOS,
  siteId: 'site-uuid',
  urls: ['https://www.youtube.com/watch?v=abc123'],
  priority: 'HIGH', // optional, defaults to 'HIGH'. Also accepts 'LOW'
});
// Returns: { job_id: '...', ... }

Valid datasetId values (available via SCRAPE_DATASET_IDS):

  • youtube_videos
  • youtube_comments
  • reddit_posts
  • reddit_comments
  • wikipedia

lookupScrapeResults(params)

Looks up scraping results for an array of URLs.

const lookup = await client.lookupScrapeResults({
  datasetId: SCRAPE_DATASET_IDS.REDDIT_POSTS,
  siteId: 'site-uuid',
  urls: ['https://www.reddit.com/r/technology/comments/abc123/post_title/'],
});
// Returns:
// {
//   results: [
//     { url: '...', status: 'available', presigned_url: '...', scraped_at: '...', expires_in: 3600 },
//     { url: '...', status: 'scraping', job_id: '...', message: '...' },
//     { url: '...', status: 'not_found', message: '...' },
//   ],
//   summary: { total: 3, available: 1, scraping: 1, not_found: 1 }
// }

submitPromptGenerationJob(params)

Submits a prompt generation job.

const result = await client.submitPromptGenerationJob({
  baseUrl: 'https://example.com',
  brandName: 'Example',
  audience: 'consumers',
  siteId: 'site-uuid',
  imsOrgId: 'org-uuid',
  region: 'US',       // optional, defaults to 'US'
  numPrompts: 50,     // optional, defaults to 50
  source: 'onboarding', // optional, defaults to 'onboarding'
});

triggerBrandDetection(siteId, options?)

Triggers brand detection re-analysis for a site.

await client.triggerBrandDetection('site-uuid', { batchId: 'batch-abc', priority: 'HIGH' });

getJob(jobId)

Retrieves job status and details.

const job = await client.getJob('job-uuid');

submitJob(params)

Submits a generic job to DRS. Used internally by the higher-level methods, but available for custom job types.

const result = await client.submitJob({
  provider_id: 'custom-provider',
  parameters: { /* ... */ },
});

Testing

To run tests:

npm test

Linting

Lint your code:

npm run lint

Cleaning

To remove node_modules and package-lock.json:

npm run clean

Additional Information