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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@trustedshops-public/cot-integration-library

v1.11.0

Published

![License](https://img.shields.io/github/license/trustedshops-public/cot-js-integration-library) [![CircleCI](https://dl.circleci.com/status-badge/img/gh/trustedshops-public/cot-js-integration-library/tree/main.svg?style=shield)](https://dl.circleci.com/s

Readme

Community of Trust Javascript/Typescript Integration Library

License CircleCI

This library provides a comprehensive JavaScript/Typescript interface for integrating with the Community of Trust (COT) platform, facilitating seamless interactions with its services.

Requirements

  • node.js for development
  • npm for package management

Installation

To install the library, run the following command in your project directory:

npm i @trustedshops-public/cot-integration-library

Usage

Here is a basic example of how to use the library:

On the backend side:

import { Client } from '@trustedshops-public/cot-integration-library';

// Initialize the client with the required parameters once
const client = new Client(
    <CLIENT_ID>, // Client ID - e.g. 'cot-switch-X1234567890123456789012345678901'
    <CLIENT_SECRET>, // Client Secret - e.g. '1234567890123456789012345678901234567890123456789012345678901234'
    <AUTH_STORAGE_INSTANCE>, // It can be any storage option implementing AuthStorageInterface - e.g. new DatabaseAuthStorage()
    <ENV> // Environment (optional) - dev, test, or prod, defaults to prod
);

// Set the cookie handler to handle cookies everytime before a request is made and handled
client.setCookieHandler(<COOKIE_HANDLER_INSTANCE>);

// Pass the actual url which the authentication has been started from to let authentication server verify the redirect uri e.g. 'https://www.example.com/shop'
client.setRedirectUri(<REDIRECT_URI>);

// Invoke handleCallback function to handle code coming from the authentication server
await client.handleCallback(authCode);

// Get consumer data for the current user
const consumerData = await client.getConsumerData();

On the frontend side, place the following code in your HTML file where you want the widget to appear:

<trstd-login tsId="X1234567890123456789012345678901"></trstd-login>
<script type="module" src="https://cdn.trstd-login.trstd.com/trstd-login/script.js"></script>

For more detailed examples, please refer to the examples/ directory.

Development

To get started with development, clone the repository and install the dependencies:

npm i

Setup the environment variables:

cp .env.example .env.local

and fill in the required values.

Hint: You can use this environment variable for local testing of examples. Copy .env.example to .env and fill in the required values in the root directory of the example, e.g., shopify-integration.

Generate local ssl certificates:

npm run generate-ssl-cert

To run local development server, use the following command:

npm run dev

To run the tests, use the following command:

npm test

To build the library, use the following command:

npm run build

Contributing

Contributions are welcome! Please refer to the CONTRIBUTING.md file for guidelines.

License

This library is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

This project relies on several open-source libraries that have made development easier and more efficient. We would like to acknowledge the following libraries:

  • jose - A comprehensive and robust JavaScript library for JSON Web Tokens (JWT) and related standards.
  • node-cache - A simple and efficient in-memory caching module for Node.js.
  • winston - A versatile and powerful logging library for Node.js.

We are grateful to the developers and maintainers of these projects for their hard work and dedication.

Versioning

This project adheres to Semantic Versioning. For the versions available, see the tags on this repository.