When using Anon Link for web, your users will be prompted to install an extension which must run Anon’s Chrome Extension Library. This is configured using the chromeExtensionId parameter.

Chrome Extension Options

You have three options:

  1. Use Anon’s official Chrome extension

  2. Build your own custom extension

    • Use our extension example
    • Customize with your own branding
    • Includes pre-configured Anon Chrome Extension Library
  3. Integrate with your existing extension

    • Install the Anon Chrome Extension Library into your current Chrome extension

Add to Your Existing Chrome Extension

This guide assumes you have an existing chrome extension project.

If you are starting from scratch, get started with our Chrome extension example, and skip to Step: Install the Chrome Extension!

1

Create a .npmrc File

.npmrc
@anon:registry=https://npm.cloudsmith.io/anon/anon-sdk/
//npm.cloudsmith.io/anon/anon-sdk/:_authToken=YQtlU86MhKOXijPS
@npm:registry=https://registry.npmjs.org/

.npmrc files are supported by both yarn and npm for installing packages from other package registries.

And yes, this is a public authToken :)

2

Install the library

npm
npm install '@anon/sdk-browser-extension'
3

Configure the extension manifest

Add the following permissions to your extension’s manifest.

"manifest": {
  "host_permissions": [
    "<all_urls>",
    "https://*/*",
  ],
  "permissions": [
    "notifications",
    "tabs",
    "activeTab",
    "storage",
    "scripting",
    "cookies"
  ]
}

For reference, checkout our example extension manifest here.

4

Initialize the library

Add this code snippet at the top of your background script:

import { anon } from "@anon/sdk-browser-extension"

anon({ environment: "sandbox" })
5

Install the Chrome Extension

  1. Run npm build
  2. Go to “Manage extensions” in your Chrome-based browser (Google Chrome, Arc, Brave, etc)
  3. Enable developer mode (toggle in top right)
  4. Click on “Load unpacked extension”
  5. Navigate to the build directory of your Chrome extension project
  6. Select the folder containing the extension’s compiled source and assets (e.g. chrome-mv3-dev or chrome-mv3-prod)

Submit to the Chrome Web Store for Approval

Follow the Chrome Web Store guide for publishing your chrome extension. If you used the example extension template which uses the Plasmo browser extension framework, you can follow their guide for automated publishing as well.

Permission Justification

To submit your extension to the Chrome Web Store, you must justify the permissions you are requesting.

Remove any permission that is unused in your extension, then give a short justification for each used permission. For example, the following was used for the “host permission justification” in Anon’s extension:

“The extension allows the user to share access to their online account for the hosts listed in the manifest.”