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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@clerk/chrome-extension

v2.1.7

Published

Clerk SDK for Chrome extensions

Downloads

15,615

Readme

Chat on Discord Clerk documentation Follow on Twitter

Changelog · Report a Bug · Request a Feature · Get help

Getting Started

Clerk is the easiest way to add authentication and user management to your Browser Extension. Add sign up, sign in, and profile management to your application in minutes.

Prerequisites

Feature Support

Please see the latest extension authentication support matrix in the Clerk documentation for more information.

Usage

  1. Installation: npm install @clerk/chrome-extension

  2. Set a consistent extension key: A browser extension can be identified by its unique key, in a similar way to how a website can be identified by its domain. You will need to explicitly configure your extension's key or it will change often. If the key changes, it can cause the extension to fail. See the Configure a Consistent Key guide for more information.

  3. Update Clerk Settings: Once you've set up a consistent extension key, you'll need to configure your Clerk settings to allow the extension to communicate with your Clerk API. You can do this by adding the extension key to the list of allowed origins in your Clerk settings. Setting the allowed_origins is required for both Development and Production instances.

    curl  -X PATCH https://api.clerk.com/v1/instance \
          -H "Content-type: application/json" \
          -H "Authorization: Bearer <CLERK_SECRET_KEY>" \
          -d '{"allowed_origins": ["chrome-extension://<YOUR_EXTENSION_KEY>"]}'
  4. Set Environment Variables: Retrieve the Publishable key from your Clerk dashboard and set it as an environment variable.

    # Vite
    VITE_CLERK_PUBLISHABLE_KEY=pk_test_xxx
    # Plasmo
    PLASMO_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_test_xxx
  5. Update the extension manifest: You'll need to update your extension manifest permissions to support Clerk.

    1. Base configuration: Use this if you plan to only use Clerk in the context of the extention.
    2. Session sync configuration: Use this if you plan to share authentication with a website in the same browser.
  6. Add Clerk to your app: Though not required, we generally suggest using Plasmo for browser extension development. This will enforce common standards across your extension as well as allow for easier integration with other browsers in the future.

    1. Via ClerkProvider: This is the general approach to all extensions. From here you'll be able to support extension-only authentication as well as sharing authentication with a website in the same browser.
    2. Via service workers: If you also require the use of background service workers, this will allow you to access the Clerk client from the extension context.

Example repositories

  • Standalone: The extension is using its own authentication
  • WebSSO: The extensions shares authentication with a website in the same browser

Support

You can get in touch with us in any of the following ways:

Contributing

We're open to all community contributions! If you'd like to contribute in any way, please read our contribution guidelines and code of conduct.

Security

@clerk/chrome-extension follows good practices of security, but 100% security cannot be assured.

@clerk/chrome-extension is provided "as is" without any warranty. Use at your own risk.

For more information and to report security issues, please refer to our security documentation.

License

This project is licensed under the MIT license.

See LICENSE for more information.