A sample Chrome extension that demonstrates how to integrate Logto in a Chrome extension.
This is also the final result of this blog post: Monetize your Chrome extension with OpenID Connect (OAuth 2.0) authentication.
Ensure you have the following installed:
- Node.js: https://nodejs.org/
- PNPM: https://pnpm.io/ (Other package managers may work, but this sample only tests with PNPM)
To test this sample, follow these steps:
- Clone this repository.
- In this directory, run
pnpm i
. - Create a
.env
file in this directory with the following content:
LOGTO_ENDPOINT=(replace with your Logto endpoint)
LOGTO_APP_ID=(replace with your Logto app ID)
- Run
pnpm build
. - Open Chrome and navigate to
chrome://extensions
, then enable Developer mode. - Click on "Load unpacked" and select the
dist
directory in this repository.