Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@percy/client

Package Overview
Dependencies
Maintainers
1
Versions
252
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@percy/client

Communicate with Percy's API to create builds and snapshots, upload resources, and finalize builds and snapshots. Uses [`@percy/env`](.packages/env) to send environment information with new builds. Can also be used to query for a project's builds using a

  • 1.30.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
334K
decreased by-9.5%
Maintainers
1
Weekly downloads
 
Created

What is @percy/client?

@percy/client is an npm package that provides a client for interacting with the Percy visual testing and review platform. It allows developers to automate visual testing by capturing screenshots of web pages and comparing them against baseline images to detect visual changes.

What are @percy/client's main functionalities?

Initialize Percy Client

This feature allows you to initialize the Percy client with your project token, which is necessary for authenticating API requests.

const Percy = require('@percy/client');
const percy = new Percy({ token: 'your-project-token' });

Create a Build

This feature allows you to create a new build in Percy. A build is a collection of snapshots that will be compared against the baseline images.

const build = await percy.createBuild();
console.log(`Build created: ${build.data.id}`);

Upload a Snapshot

This feature allows you to upload a snapshot to a specific build. A snapshot is a screenshot of a web page at different widths.

await percy.uploadSnapshot(build.data.id, {
  name: 'Home Page',
  url: 'http://localhost:3000',
  widths: [375, 768, 1280]
});

Finalize a Build

This feature allows you to finalize a build, which triggers Percy to process the snapshots and compare them against the baseline images.

await percy.finalizeBuild(build.data.id);
console.log('Build finalized');

Other packages similar to @percy/client

FAQs

Package last updated on 02 Dec 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc