Prerequisite: Make sure you have the Yarn package manager installed.
The playground is a quick way to run, test, and debug the code. The playground is located in the playground directory.
Install dependencies:
yarn install
Start the playground:
yarn dev:playground
After a successful build, you can open http://localhost:3000 in your browser.
Note: Playground uses a shared hardcoded botd API token.
To build the distribution files of the library, run:
yarn install
yarn build
The files will appear in the dist
directory.
The code style is controlled by ESLint and Prettier. Run to check that the code style is ok:
yarn lint
Run to fix code style mistakes (not all mistakes can be fixed automatically):
yarn lint:fix
Important: Bot detection, crawling, and scraping techniques are continuously evolving. Before filing a new issue or discussing detection techniques publicly, consider whether the topic is suitable for the general audience. Please discuss sensitive topics directly with support@fingerprint.com or on the Discord server with the repository maintainers.
One can create a new signal source in this client-side library, however, it needs to be also accepted and processed on the backend side properly. The recommended approach is to file an issue in the repository and discuss signal details with the maintainers.
- Create a new signal source in the
src/sources
directory. - Register it in the
collector.ts
file, in thecollect()
function. The new signal and its enum number should be discussed with the maintainers of the repository.
import getNewSignal from './sources/getNewSignal'
...
[SignalName.MyNewSignal]: getNewSignal,
...
There are no tests yet - to be done later.
This section is for repository maintainers.
- Bump the version. Search the current version number in the code to know where to change it.
- Build and test the project.
- Check the content of the NPM package, make sure it contains the distributive files and no excess files.
Run
yarn pack
, an archive will appear in the root, you can open it with any archive browser. - Run
# Add '--tag beta' (without the quotes) if you release a beta version # Add '--tag dev' if you release a development version (which is expected to get new features) yarn publish --access public
- Push the changes to the repository, and a version tag like
v1.3.4
to the commit. - Describe the version changes in the releases section.