Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add chrome extension docs #1004

Open
wants to merge 146 commits into
base: main
Choose a base branch
from
Open

Add chrome extension docs #1004

wants to merge 146 commits into from

Conversation

Copy link

github-actions bot commented May 8, 2024

Hey, here’s your docs preview: https://clerk.com/docs/pr/1004

@bradlc
Copy link
Member

bradlc commented May 9, 2024

Hey! It looks like your PR makes changes to the docs/manifest.json file. The manifest schema was recently updated so you will need to update your PR to account for this. You can see the updated documentation for the manifest here: https://github.com/clerk/clerk-docs/blob/main/CONTRIBUTING.md#navigation-manifest

If you need help with this, or would like me to make the necessary changes on your behalf please tag me in this PR or DM me on Slack 🤙

@royanger
Copy link
Member Author

royanger commented May 9, 2024

Hey! It looks like your PR makes changes to the docs/manifest.json file. The manifest schema was recently updated so you will need to update your PR to account for this. You can see the updated documentation for the manifest here: https://github.com/clerk/clerk-docs/blob/main/CONTRIBUTING.md#navigation-manifest

If you need help with this, or would like me to make the necessary changes on your behalf please tag me in this PR or DM me on Slack 🤙

All good @bradlc. Thanks for the heads up!

docs/deployments/deploy-chrome-extension.mdx Outdated Show resolved Hide resolved
docs/components/clerk-provider.mdx Outdated Show resolved Hide resolved
docs/deployments/deploy-chrome-extension.mdx Outdated Show resolved Hide resolved
docs/deployments/deploy-chrome-extension.mdx Outdated Show resolved Hide resolved
docs/deployments/deploy-chrome-extension.mdx Outdated Show resolved Hide resolved
docs/references/chrome-extension/overview.mdx Outdated Show resolved Hide resolved

## Chrome Extension CRX ID
## Configure a consistent CRX ID
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should change the order of these? This was initially established when the CRX ID guide was required. Maybe the following order?

  1. React Router
  2. Sync Host
  3. createClerkClient()
  4. Deploy to production
  5. Configure a CRX ID

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can do

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated! b089102


## Sync Host
## Sync your Chrome Extension with your web app
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

## Sync auth status between your Chrome Extension and web app

The title should probably mention something about auth or auth state.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can do!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated! b089102

@@ -0,0 +1,132 @@
---
title: Sync your Chrome Extension with your web app
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here as in ff92b58#r1809419432

With this page I'm just thinking of making the title clearer for people using search or skimming the side bar.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can do!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated! b089102

docs/deployments/deploy-chrome-extension.mdx Show resolved Hide resolved

The `createClerkClient()` helper wille initialize a new Clerk instance on demand, and refresh the session token is there is a valid, signed user. This is the same process as returning to a web application after the tab or browser was closed.
It's recommended to use `createClerkClient()` for Chrome Extension's that are configured as popups. When the popup is closed, the Clerk process that normally refreshes the user's session token every 60 seconds is no longer running, and the stored session will become stale. If a request were made 60 seconds after the popup was closed, it would fail because the session token is no longer valid. By configuring `createClerkClient()` to run in a background service worker, you can ensure that the user's session is always fresh.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The original copy said "The Chrome Extension SDK provides a new feature for developers for interacting with a signed in user while the popup is closed." and then was written to be centered around popups.

So are you saying that this issue (Clerk not refreshing the user's session token) occurs in side panels as well?

docs/references/chrome-extension/create-clerk-client.mdx Outdated Show resolved Hide resolved

## Chrome Extension CRX ID
## Configure a consistent CRX ID
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can do

docs/references/chrome-extension/sync-host.mdx Outdated Show resolved Hide resolved
docs/references/chrome-extension/sync-host.mdx Outdated Show resolved Hide resolved
docs/references/chrome-extension/sync-host.mdx Outdated Show resolved Hide resolved
docs/references/chrome-extension/sync-host.mdx Outdated Show resolved Hide resolved
Copy link
Member

@tmilewski tmilewski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems great! Just updating PLASMO_PUBLIC_SYNC_HOST to PLASMO_PUBLIC_CLERK_SYNC_HOST

docs/deployments/deploy-chrome-extension.mdx Outdated Show resolved Hide resolved
docs/deployments/deploy-chrome-extension.mdx Outdated Show resolved Hide resolved
docs/deployments/deploy-chrome-extension.mdx Outdated Show resolved Hide resolved
docs/deployments/deploy-chrome-extension.mdx Outdated Show resolved Hide resolved
docs/references/chrome-extension/sync-host.mdx Outdated Show resolved Hide resolved
docs/references/chrome-extension/sync-host.mdx Outdated Show resolved Hide resolved
docs/references/chrome-extension/sync-host.mdx Outdated Show resolved Hide resolved
docs/references/chrome-extension/sync-host.mdx Outdated Show resolved Hide resolved
docs/references/chrome-extension/sync-host.mdx Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.