+
+# Clerk Chrome Extension Starter
+
+This starter project shows how to use [Clerk](https://www.clerk.dev/?utm_source=github&utm_medium=starter_repos&utm_campaign=chrome_extension_start) authentication in a React based [Chrome Extension](https://developer.chrome.com/docs/extensions/).
+
+[![chat on Discord](https://img.shields.io/discord/856971667393609759.svg?logo=discord)](https://discord.com/invite/b5rXHjAg7A)
+[![documentation](https://img.shields.io/badge/documentation-clerk-green.svg)](https://docs.clerk.dev)
+[![twitter](https://img.shields.io/twitter/follow/ClerkDev?style=social)](https://twitter.com/intent/follow?screen_name=ClerkDev)
+
+If you run into issues, be sure to check our [main npm page](https://www.npmjs.com/package/@clerk/chrome-extension) for any updated settings/steps you may need to be aware of.
+
+---
+
+**Clerk is Hiring!**
+
+Would you like to work on Open Source software and help maintain this repository? [Apply today!](https://apply.workable.com/clerk-dev/)
+
+---
+
+## Introduction
+
+This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app). It demonstrates a basic password or OTP flow using ClerkJS Components in a Chrome Extension Popup.
+
+
+
+This repo will be enhanced with examples of authentication redirection flows such as OAuth or Magic Links and advance extension patterns
+using [Manifest V3 service workers](https://developer.chrome.com/docs/extensions/mv3/service_workers/) and the new [chrome.storage API](https://developer.chrome.com/docs/extensions/reference/storage/).
+
+## Available Scripts
+
+In the project directory, you can run:
+
+### `npm start`
+
+Runs the app in the development mode.\
+Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
+
+The page will reload if you make edits.\
+You will also see any lint errors in the console.
+
+### `npm test`
+
+Launches the test runner in the interactive watch mode.\
+See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
+
+### `npm run build`
+
+Builds the app for production to the `build` folder.\
+It correctly bundles React in production mode and optimizes the build for the best performance.
+
+The build is minified and the filenames include the hashes.\
+Your app is ready to be deployed!
+
+See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
+
+### `npm run eject`
+
+**Note: this is a one-way operation. Once you `eject`, you can’t go back!**
+
+If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
+
+Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.
+
+You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.
+
+## Learn More
+
+You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
+
+To learn React, check out the [React documentation](https://reactjs.org/).
diff --git a/playground/chrome-extension/demo.png b/playground/chrome-extension/demo.png
new file mode 100644
index 0000000000..4f7f1975a5
Binary files /dev/null and b/playground/chrome-extension/demo.png differ
diff --git a/playground/chrome-extension/manifest.dev.json.example b/playground/chrome-extension/manifest.dev.json.example
new file mode 100644
index 0000000000..fcad1a80f1
--- /dev/null
+++ b/playground/chrome-extension/manifest.dev.json.example
@@ -0,0 +1,5 @@
+{
+ "host_permissions": [
+ "*://localhost:*/*"
+ ]
+}
diff --git a/playground/chrome-extension/manifest.json.example b/playground/chrome-extension/manifest.json.example
new file mode 100644
index 0000000000..a3ba1fc727
--- /dev/null
+++ b/playground/chrome-extension/manifest.json.example
@@ -0,0 +1,21 @@
+{
+ "manifest_version": 3,
+ "name": "Clerk Chrome Extension Playground",
+ "description": "Playground App for the Clerk Chrome Extension",
+ "action": {
+ "default_popup": "src/pages/popup/index.html",
+ "default_icon": {
+ "32": "icon-32.png"
+ }
+ },
+ "icons": {
+ "128": "icon-128.png"
+ },
+ "permissions": [
+ "cookies",
+ "storage"
+ ],
+ "host_permissions": [
+ "*:///"
+ ]
+}
diff --git a/playground/chrome-extension/nodemon.json b/playground/chrome-extension/nodemon.json
new file mode 100644
index 0000000000..72faa88892
--- /dev/null
+++ b/playground/chrome-extension/nodemon.json
@@ -0,0 +1,14 @@
+{
+ "env": {
+ "__DEV__": "true"
+ },
+ "watch": [
+ ".yalc/**/*", "src", "utils", "vite.config.ts", "manifest.json", "manifest.dev.json", "node_modules/@clerk/**/*"
+ ],
+ "ext": "tsx,css,html,ts,json",
+ "ignore": [
+ "src/**/*.spec.ts"
+ ],
+ "exec": "vite build",
+ "delay": "1000"
+}
diff --git a/playground/chrome-extension/package.json b/playground/chrome-extension/package.json
new file mode 100644
index 0000000000..e3b991cb02
--- /dev/null
+++ b/playground/chrome-extension/package.json
@@ -0,0 +1,49 @@
+{
+ "name": "clerk-chrome-extension-starter",
+ "version": "0.1.0",
+ "private": true,
+ "type": "module",
+ "dependencies": {
+ "@clerk/chrome-extension": "file:.yalc/@clerk/chrome-extension",
+ "@clerk/clerk-js": "file:.yalc/@clerk/clerk-js",
+ "@clerk/clerk-react": "file:.yalc/@clerk/clerk-react",
+ "@clerk/localizations": "file:.yalc/@clerk/localizations",
+ "@clerk/shared": "file:.yalc/@clerk/shared",
+ "@clerk/themes": "file:.yalc/@clerk/themes",
+ "@clerk/types": "file:.yalc/@clerk/types",
+ "react": "^18.2.0",
+ "react-dom": "^18.2.0",
+ "react-router-dom": "^6.9.0",
+ "webextension-polyfill": "^0.10.0"
+ },
+ "devDependencies": {
+ "@crxjs/vite-plugin": "^1.0.14",
+ "@types/chrome": "^0.0.253",
+ "@types/node": "^18.17.1",
+ "@types/react": "^18.2.39",
+ "@types/react-dom": "^18.2.17",
+ "@types/webextension-polyfill": "^0.10.0",
+ "@typescript-eslint/eslint-plugin": "^5.49.0",
+ "@typescript-eslint/parser": "^5.49.0",
+ "@vitejs/plugin-react-swc": "^3.0.1",
+ "autoprefixer": "^10.4.16",
+ "eslint": "^8.32.0",
+ "eslint-config-prettier": "^8.6.0",
+ "eslint-plugin-import": "^2.27.5",
+ "eslint-plugin-jsx-a11y": "^6.7.1",
+ "eslint-plugin-react": "^7.32.1",
+ "eslint-plugin-react-hooks": "^4.3.0",
+ "fs-extra": "^11.1.0",
+ "nodemon": "^2.0.20",
+ "postcss": "^8.4.31",
+ "tailwindcss": "^3.3.5",
+ "ts-node": "^10.9.1",
+ "typescript": "^4.9.4",
+ "vite": "^4.5.0"
+ },
+ "scripts": {
+ "build": "vite build",
+ "dev": "npm run yalc:add && nodemon",
+ "yalc:add": "yalc add -- @clerk/chrome-extension @clerk/clerk-react @clerk/clerk-js @clerk/localizations @clerk/themes @clerk/types @clerk/shared"
+ }
+}
diff --git a/playground/chrome-extension/public/clerk-logo-dark.png b/playground/chrome-extension/public/clerk-logo-dark.png
new file mode 100644
index 0000000000..1faeb9411d
Binary files /dev/null and b/playground/chrome-extension/public/clerk-logo-dark.png differ
diff --git a/playground/chrome-extension/public/clerk-logo-light.png b/playground/chrome-extension/public/clerk-logo-light.png
new file mode 100644
index 0000000000..fe83c60323
Binary files /dev/null and b/playground/chrome-extension/public/clerk-logo-light.png differ
diff --git a/playground/chrome-extension/public/contentStyle.css b/playground/chrome-extension/public/contentStyle.css
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/playground/chrome-extension/public/dev-icon-128.png b/playground/chrome-extension/public/dev-icon-128.png
new file mode 100644
index 0000000000..2272f3c288
Binary files /dev/null and b/playground/chrome-extension/public/dev-icon-128.png differ
diff --git a/playground/chrome-extension/public/dev-icon-32.png b/playground/chrome-extension/public/dev-icon-32.png
new file mode 100644
index 0000000000..2b72ebdb2c
Binary files /dev/null and b/playground/chrome-extension/public/dev-icon-32.png differ
diff --git a/playground/chrome-extension/public/icon-128.png b/playground/chrome-extension/public/icon-128.png
new file mode 100644
index 0000000000..15bd934a11
Binary files /dev/null and b/playground/chrome-extension/public/icon-128.png differ
diff --git a/playground/chrome-extension/public/icon-32.png b/playground/chrome-extension/public/icon-32.png
new file mode 100644
index 0000000000..d93c9d3a09
Binary files /dev/null and b/playground/chrome-extension/public/icon-32.png differ
diff --git a/playground/chrome-extension/src/assets/img/logo.svg b/playground/chrome-extension/src/assets/img/logo.svg
new file mode 100644
index 0000000000..9dfc1c058c
--- /dev/null
+++ b/playground/chrome-extension/src/assets/img/logo.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/playground/chrome-extension/src/assets/styles/index.css b/playground/chrome-extension/src/assets/styles/index.css
new file mode 100644
index 0000000000..ca96954435
--- /dev/null
+++ b/playground/chrome-extension/src/assets/styles/index.css
@@ -0,0 +1,17 @@
+body {
+ margin: 0;
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
+ 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
+ sans-serif;
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+
+ width: 800px;
+ height: 600px;
+ max-width: 780px;
+}
+
+code {
+ font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
+ monospace;
+}
\ No newline at end of file
diff --git a/playground/chrome-extension/src/assets/styles/tailwind.css b/playground/chrome-extension/src/assets/styles/tailwind.css
new file mode 100644
index 0000000000..b5c61c9567
--- /dev/null
+++ b/playground/chrome-extension/src/assets/styles/tailwind.css
@@ -0,0 +1,3 @@
+@tailwind base;
+@tailwind components;
+@tailwind utilities;
diff --git a/playground/chrome-extension/src/global.d.ts b/playground/chrome-extension/src/global.d.ts
new file mode 100644
index 0000000000..7ad3edd14d
--- /dev/null
+++ b/playground/chrome-extension/src/global.d.ts
@@ -0,0 +1,11 @@
+declare module '*.svg' {
+ import React = require('react');
+ export const ReactComponent: React.SFC>;
+ const src: string;
+ export default src;
+}
+
+declare module '*.json' {
+ const content: string;
+ export default content;
+}
diff --git a/playground/chrome-extension/src/pages/background/index.ts b/playground/chrome-extension/src/pages/background/index.ts
new file mode 100644
index 0000000000..def0db5c2c
--- /dev/null
+++ b/playground/chrome-extension/src/pages/background/index.ts
@@ -0,0 +1 @@
+console.log('background script loaded');
diff --git a/playground/chrome-extension/src/pages/content/index.tsx b/playground/chrome-extension/src/pages/content/index.tsx
new file mode 100644
index 0000000000..693adb4fc2
--- /dev/null
+++ b/playground/chrome-extension/src/pages/content/index.tsx
@@ -0,0 +1,20 @@
+import { createRoot } from 'react-dom/client';
+import './style.css'
+const div = document.createElement('div');
+div.id = '__root';
+document.body.appendChild(div);
+
+const rootContainer = document.querySelector('#__root');
+if (!rootContainer) throw new Error("Can't find Options root element");
+const root = createRoot(rootContainer);
+root.render(
+