diff --git a/.changeset/remove-playground-templates.md b/.changeset/remove-playground-templates.md new file mode 100644 index 00000000000..a845151cc84 --- /dev/null +++ b/.changeset/remove-playground-templates.md @@ -0,0 +1,2 @@ +--- +--- diff --git a/.cursor/rules/development.mdc b/.cursor/rules/development.mdc index f8e641d3f2f..fc0cc1232a6 100644 --- a/.cursor/rules/development.mdc +++ b/.cursor/rules/development.mdc @@ -14,7 +14,6 @@ Development Environment Setup Monorepo Development Workflow - Make changes in the relevant package under `/packages/` - Use `pnpm dev` to watch for changes and rebuild automatically -- Test changes using playground applications in `/playground/` - Run specific package commands using pnpm workspace syntax: `pnpm --filter @clerk/nextjs build` - Use Turbo for efficient builds: `turbo build --filter=@clerk/nextjs` @@ -111,7 +110,6 @@ Release Process - Maintain detailed changelogs Local Development Tips -- Use playground applications to test changes quickly - Set up multiple test environments for different scenarios - Use pkglab for local npm registry testing (`pkglab pub` to publish, `pkglab add` to install) - Leverage hot reloading for faster development cycles diff --git a/.cursor/rules/global.mdc b/.cursor/rules/global.mdc index 877d4c8ace7..6c06d904b08 100644 --- a/.cursor/rules/global.mdc +++ b/.cursor/rules/global.mdc @@ -22,7 +22,6 @@ Clerk JavaScript SDK Monorepo - `packages/` - All publishable packages (@clerk/\*) - `integration/` - Framework integration templates and E2E tests -- `playground/` - Development and testing applications - `scripts/` - Build automation and utilities - `.cursor/rules/` - Additional rule files for specific domains @@ -38,7 +37,6 @@ Clerk JavaScript SDK Monorepo 5. Development Workflow - Make changes in relevant package under packages/ -- Use playground apps for testing changes - Follow established testing and documentation requirements - Use Changesets for version management and releases - If you are provided a commit SHA, always read the commit message and description for extra context. diff --git a/.cursor/rules/monorepo.mdc b/.cursor/rules/monorepo.mdc index 56780f1c63d..b55848466ed 100644 --- a/.cursor/rules/monorepo.mdc +++ b/.cursor/rules/monorepo.mdc @@ -27,7 +27,6 @@ Directory Structure - `packages/` - All publishable packages - `integration/` - End-to-end tests and integration templates -- `playground/` - Development and testing applications - `docs/` - Documentation and contribution guides - `scripts/` - Build and automation scripts - `tools/` - Internal development tools diff --git a/.dockerignore b/.dockerignore index e86c3fe23cd..0981c2d7efe 100644 --- a/.dockerignore +++ b/.dockerignore @@ -3,4 +3,3 @@ npm-debug.log .next .dev.lock *.md -playground diff --git a/.github/labeler.yml b/.github/labeler.yml index 6b8a713c04d..642ff9645ad 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -80,10 +80,6 @@ vue: - changed-files: - any-glob-to-any-file: packages/vue/** -playground: - - changed-files: - - any-glob-to-any-file: playground/** - actions: - changed-files: - any-glob-to-any-file: .github/workflows/** diff --git a/.gitignore b/.gitignore index 1ad61a1435f..8f8291cf7f3 100644 --- a/.gitignore +++ b/.gitignore @@ -7,9 +7,6 @@ out-tsc out **/dist/* **/build/* -!playground/browser-extension-js/build/manifest.json -!playground/browser-extension-js/build/popup.html -!playground/browser-extension-js/build/popup.css packages/*/dist/** **/.pnpm-store/** @@ -64,17 +61,10 @@ lerna-debug.log .next .dev.vars .env.local -playground/*/build -!playground/browser-extension-js/build -playground/*/public/build -playground/*/.cache -playground/custom -# Examples & Playground apps dependency locks +# Examples apps dependency locks packages/*/examples/*/package-lock.json packages/*/examples/*/yarn.lock -playground/*/package-lock.json -playground/*/yarn.lock /test-results/ /playwright-report/ /playwright/.cache/ diff --git a/.prettierignore b/.prettierignore index f469f34fac0..ec4d75c8331 100644 --- a/.prettierignore +++ b/.prettierignore @@ -17,7 +17,6 @@ dist node_modules package-lock.json pnpm-lock.yaml -playground packages/backend/tests/**/*.js packages/clerk-js/src/core/resources/internal.ts packages/clerk-js/src/core/resources/index.ts diff --git a/.vscode/launch.json b/.vscode/launch.json index 6851e3696c8..76bc1a686b3 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -1,27 +1,6 @@ { "version": "0.2.0", "configurations": [ - { - "name": "playground/nextjs: debug server", - "type": "node-terminal", - "request": "launch", - "command": "pnpm dev", - "cwd": "${workspaceFolder}/playground/nextjs" - }, - { - "name": "playground/nextjs12: debug server", - "type": "node-terminal", - "request": "launch", - "command": "pnpm dev", - "cwd": "${workspaceFolder}/playground/nextjs12" - }, - { - "name": "playground/express: debug server", - "type": "node-terminal", - "request": "launch", - "command": "npm start", - "cwd": "${workspaceFolder}/playground/express" - }, { "name": "Debug Vitest", "type": "node", diff --git a/eslint.config.mjs b/eslint.config.mjs index 742a6b90bd9..0624c8f75fe 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -267,7 +267,6 @@ export default tseslint.config([ 'commitlint.config.ts', 'packages/*/dist/**', 'packages/*/examples', - 'playground/*', 'pnpm-lock.json', 'eslint.config.mjs', 'typedoc.config.mjs', diff --git a/playground/app-router/.gitignore b/playground/app-router/.gitignore deleted file mode 100644 index 927a115dba8..00000000000 --- a/playground/app-router/.gitignore +++ /dev/null @@ -1,38 +0,0 @@ -# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. - -# dependencies -/node_modules -/.pnp -.pnp.js - -# testing -/coverage - -# next.js -/.next/ -/out/ - -# production -/build - -# misc -.DS_Store -*.pem - -# debug -npm-debug.log* -yarn-debug.log* -yarn-error.log* - -# local env files -.env* - -# vercel -.vercel - -# typescript -*.tsbuildinfo -next-env.d.ts - -# clerk configuration (can include secrets) -/.clerk/ diff --git a/playground/app-router/.vscode/settings.json b/playground/app-router/.vscode/settings.json deleted file mode 100644 index d0679104bda..00000000000 --- a/playground/app-router/.vscode/settings.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "typescript.tsdk": "node_modules/typescript/lib", - "typescript.enablePromptUseWorkspaceTsdk": true -} \ No newline at end of file diff --git a/playground/app-router/README.md b/playground/app-router/README.md deleted file mode 100644 index 293d5ade579..00000000000 --- a/playground/app-router/README.md +++ /dev/null @@ -1,36 +0,0 @@ -This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app). - -## Getting Started - -First, run the development server: - -```bash -npm run dev -# or -yarn dev -# or -pnpm dev -``` - -Open [http://localhost:4011](http://localhost:4011) with your browser to see the result. - -You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file. - -[http://localhost:4011/api/hello](http://localhost:4011/api/hello) is an endpoint that uses [Route Handlers](https://nextjs.org/docs/routing/route-handlers). This endpoint can be edited in `app/api/hello/route.ts`. - -This project uses [`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to automatically optimize and load Inter, a custom Google Font. - -## Learn More - -To learn more about Next.js, take a look at the following resources: - -- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API. -- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial. - -You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome! - -## Deploy on Vercel - -The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js. - -Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details. diff --git a/playground/app-router/next.config.js b/playground/app-router/next.config.js deleted file mode 100644 index 62c7c9de887..00000000000 --- a/playground/app-router/next.config.js +++ /dev/null @@ -1,13 +0,0 @@ -/** @type {import('next').NextConfig} */ -const nextConfig = { - experimental: { - appDir: true, - typedRoutes: true, - serverActions: true, - }, - eslint: { - ignoreDuringBuilds: true, - }, -}; - -module.exports = nextConfig; diff --git a/playground/app-router/package.json b/playground/app-router/package.json deleted file mode 100644 index 6e9785ea2e9..00000000000 --- a/playground/app-router/package.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "name": "app-router", - "version": "0.1.0", - "private": true, - "scripts": { - "dev": "next dev --port 4011", - "build": "next build", - "start": "next start", - "lint": "next lint" - }, - "dependencies": { - "@clerk/backend": "workspace:*", - "@clerk/react": "workspace:*", - "@clerk/nextjs": "workspace:*", - "@clerk/shared": "workspace:*", - "@clerk/types": "workspace:*", - "@types/node": "18.16.0", - "@types/react": "18.0.38", - "@types/react-dom": "18.0.11", - "next": "^14.2.4", - "react": "18.2.0", - "react-dom": "18.2.0", - "typescript": "5.0.4", - "ezheaders": "^0.0.3" - } -} diff --git a/playground/app-router/public/next.svg b/playground/app-router/public/next.svg deleted file mode 100644 index 5174b28c565..00000000000 --- a/playground/app-router/public/next.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/playground/app-router/public/vercel.svg b/playground/app-router/public/vercel.svg deleted file mode 100644 index d2f84222734..00000000000 --- a/playground/app-router/public/vercel.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/playground/app-router/src/app/action/page.tsx b/playground/app-router/src/app/action/page.tsx deleted file mode 100644 index 5962909a82b..00000000000 --- a/playground/app-router/src/app/action/page.tsx +++ /dev/null @@ -1,22 +0,0 @@ -import { auth, currentUser } from '@clerk/nextjs/server'; - -export default function AddToCart() { - async function addItem(data: any) { - 'use server'; - console.log((await auth()).userId); - console.log((await currentUser())?.firstName); - console.log('add item server action', data); - } - - return ( - // @ts-ignore -
- - -
- ); -} diff --git a/playground/app-router/src/app/api/hello/route.ts b/playground/app-router/src/app/api/hello/route.ts deleted file mode 100644 index 36379216174..00000000000 --- a/playground/app-router/src/app/api/hello/route.ts +++ /dev/null @@ -1,3 +0,0 @@ -export async function GET(request: Request) { - return new Response('Hello, Next.js!'); -} diff --git a/playground/app-router/src/app/client/page.tsx b/playground/app-router/src/app/client/page.tsx deleted file mode 100644 index 0869fb69863..00000000000 --- a/playground/app-router/src/app/client/page.tsx +++ /dev/null @@ -1,12 +0,0 @@ -'use client'; - -import { useEffect } from 'react'; - -export default () => { - console.log('cient/page'); - useEffect(() => { - console.log('cient/page side only component'); - }); - - return
this is a client components
; -}; diff --git a/playground/app-router/src/app/favicon.ico b/playground/app-router/src/app/favicon.ico deleted file mode 100644 index 718d6fea483..00000000000 Binary files a/playground/app-router/src/app/favicon.ico and /dev/null differ diff --git a/playground/app-router/src/app/globals.css b/playground/app-router/src/app/globals.css deleted file mode 100644 index 4d750b87d77..00000000000 --- a/playground/app-router/src/app/globals.css +++ /dev/null @@ -1,77 +0,0 @@ -:root { - --max-width: 1100px; - --border-radius: 12px; - --font-mono: ui-monospace, Menlo, Monaco, 'Cascadia Mono', 'Segoe UI Mono', 'Roboto Mono', 'Oxygen Mono', - 'Ubuntu Monospace', 'Source Code Pro', 'Fira Mono', 'Droid Sans Mono', 'Courier New', monospace; - - --foreground-rgb: 0, 0, 0; - --background-start-rgb: 214, 219, 220; - --background-end-rgb: 255, 255, 255; - - --primary-glow: conic-gradient( - from 180deg at 50% 50%, - #16abff33 0deg, - #0885ff33 55deg, - #54d6ff33 120deg, - #0071ff33 160deg, - transparent 360deg - ); - --secondary-glow: radial-gradient(rgba(255, 255, 255, 1), rgba(255, 255, 255, 0)); - - --tile-start-rgb: 239, 245, 249; - --tile-end-rgb: 228, 232, 233; - --tile-border: conic-gradient(#00000080, #00000040, #00000030, #00000020, #00000010, #00000010, #00000080); - - --callout-rgb: 238, 240, 241; - --callout-border-rgb: 172, 175, 176; - --card-rgb: 180, 185, 188; - --card-border-rgb: 131, 134, 135; -} - -@media (prefers-color-scheme: dark) { - :root { - --foreground-rgb: 255, 255, 255; - --background-start-rgb: 0, 0, 0; - --background-end-rgb: 0, 0, 0; - - --primary-glow: radial-gradient(rgba(1, 65, 255, 0.4), rgba(1, 65, 255, 0)); - --secondary-glow: linear-gradient(to bottom right, rgba(1, 65, 255, 0), rgba(1, 65, 255, 0), rgba(1, 65, 255, 0.3)); - - --tile-start-rgb: 2, 13, 46; - --tile-end-rgb: 2, 5, 19; - --tile-border: conic-gradient(#ffffff80, #ffffff40, #ffffff30, #ffffff20, #ffffff10, #ffffff10, #ffffff80); - - --callout-rgb: 20, 20, 20; - --callout-border-rgb: 108, 108, 108; - --card-rgb: 100, 100, 100; - --card-border-rgb: 200, 200, 200; - } -} - -* { - box-sizing: border-box; - padding: 0; - margin: 0; -} - -html, -body { - max-width: 100vw; - overflow-x: hidden; -} - -body { - color: rgb(var(--foreground-rgb)); - background: linear-gradient(to bottom, transparent, rgb(var(--background-end-rgb))) rgb(var(--background-start-rgb)); -} - -a { - color: inherit; - text-decoration: none; -} - -@media (prefers-color-scheme: dark) { - html { - color-scheme: dark; - } -} diff --git a/playground/app-router/src/app/layout.tsx b/playground/app-router/src/app/layout.tsx deleted file mode 100644 index 89d40d4d778..00000000000 --- a/playground/app-router/src/app/layout.tsx +++ /dev/null @@ -1,28 +0,0 @@ -import './globals.css'; -import { Inter } from 'next/font/google'; -import { ClerkProvider } from '@clerk/nextjs'; -import { Links } from '@/common/Links'; - -const inter = Inter({ subsets: ['latin'] }); - -export const metadata = { - title: 'Create Next App', - description: 'Generated by create next app', -}; - -export default function RootLayout({ children }: { children: React.ReactNode }) { - // console.log(auth()); - return ( - - - - -
-

Root layout

- {children} -
- - -
- ); -} diff --git a/playground/app-router/src/app/page.module.css b/playground/app-router/src/app/page.module.css deleted file mode 100644 index b51e699f734..00000000000 --- a/playground/app-router/src/app/page.module.css +++ /dev/null @@ -1,221 +0,0 @@ -.main { - display: flex; - flex-direction: column; - justify-content: space-between; - align-items: center; - padding: 6rem; - min-height: 100vh; -} - -.description { - display: inherit; - justify-content: inherit; - align-items: inherit; - font-size: 0.85rem; - max-width: var(--max-width); - width: 100%; - z-index: 2; - font-family: var(--font-mono); -} - -.description a { - display: flex; - justify-content: center; - align-items: center; - gap: 0.5rem; -} - -.description p { - position: relative; - margin: 0; - padding: 1rem; - background-color: rgba(var(--callout-rgb), 0.5); - border: 1px solid rgba(var(--callout-border-rgb), 0.3); - border-radius: var(--border-radius); -} - -.code { - font-weight: 700; - font-family: var(--font-mono); -} - -.grid { - display: grid; - grid-template-columns: repeat(4, minmax(25%, auto)); - width: var(--max-width); - max-width: 100%; -} - -.card { - padding: 1rem 1.2rem; - border-radius: var(--border-radius); - background: rgba(var(--card-rgb), 0); - border: 1px solid rgba(var(--card-border-rgb), 0); - transition: background 200ms, border 200ms; -} - -.card span { - display: inline-block; - transition: transform 200ms; -} - -.card h2 { - font-weight: 600; - margin-bottom: 0.7rem; -} - -.card p { - margin: 0; - opacity: 0.6; - font-size: 0.9rem; - line-height: 1.5; - max-width: 30ch; -} - -.center { - display: flex; - justify-content: center; - align-items: center; - position: relative; - padding: 4rem 0; -} - -.center::before { - background: var(--secondary-glow); - border-radius: 50%; - width: 480px; - height: 360px; - margin-left: -400px; -} - -.center::after { - background: var(--primary-glow); - width: 240px; - height: 180px; - z-index: -1; -} - -.center::before, -.center::after { - content: ''; - left: 50%; - position: absolute; - filter: blur(45px); - transform: translateZ(0); -} - -.logo { - position: relative; -} -/* Enable hover only on non-touch devices */ -@media (hover: hover) and (pointer: fine) { - .card:hover { - background: rgba(var(--card-rgb), 0.1); - border: 1px solid rgba(var(--card-border-rgb), 0.15); - } - - .card:hover span { - transform: translateX(4px); - } -} - -@media (prefers-reduced-motion) { - .card:hover span { - transform: none; - } -} - -/* Mobile */ -@media (max-width: 700px) { - .content { - padding: 4rem; - } - - .grid { - grid-template-columns: 1fr; - margin-bottom: 120px; - max-width: 320px; - text-align: center; - } - - .card { - padding: 1rem 2.5rem; - } - - .card h2 { - margin-bottom: 0.5rem; - } - - .center { - padding: 8rem 0 6rem; - } - - .center::before { - transform: none; - height: 300px; - } - - .description { - font-size: 0.8rem; - } - - .description a { - padding: 1rem; - } - - .description p, - .description div { - display: flex; - justify-content: center; - position: fixed; - width: 100%; - } - - .description p { - align-items: center; - inset: 0 0 auto; - padding: 2rem 1rem 1.4rem; - border-radius: 0; - border: none; - border-bottom: 1px solid rgba(var(--callout-border-rgb), 0.25); - background: linear-gradient(to bottom, rgba(var(--background-start-rgb), 1), rgba(var(--callout-rgb), 0.5)); - background-clip: padding-box; - backdrop-filter: blur(24px); - } - - .description div { - align-items: flex-end; - pointer-events: none; - inset: auto 0 0; - padding: 2rem; - height: 200px; - background: linear-gradient(to bottom, transparent 0%, rgb(var(--background-end-rgb)) 40%); - z-index: 1; - } -} - -/* Tablet and Smaller Desktop */ -@media (min-width: 701px) and (max-width: 1120px) { - .grid { - grid-template-columns: repeat(2, 50%); - } -} - -@media (prefers-color-scheme: dark) { - .vercelLogo { - filter: invert(1); - } - - .logo { - filter: invert(1) drop-shadow(0 0 0.3rem #ffffff70); - } -} - -@keyframes rotate { - from { - transform: rotate(360deg); - } - to { - transform: rotate(0deg); - } -} diff --git a/playground/app-router/src/app/page.tsx b/playground/app-router/src/app/page.tsx deleted file mode 100644 index fadb08b5a08..00000000000 --- a/playground/app-router/src/app/page.tsx +++ /dev/null @@ -1,100 +0,0 @@ -import Image from 'next/image'; -import styles from './page.module.css'; - -declare global { - interface UserPublicMetadata { - spotifyToken?: string; - isNewUser?: boolean; - } -} - -export default function Home() { - return ( -
-
-

- Get started by editing  - src/app/page.tsx -

-
- - By{' '} - Vercel Logo - -
-
- -
- Next.js Logo -
- -
- -

- Docs -> -

-

Find in-depth information about Next.js features and API.

-
- - -

- Learn -> -

-

Learn about Next.js in an interactive course with quizzes!

-
- - -

- Templates -> -

-

Explore the Next.js 13 playground.

-
- - -

- Deploy -> -

-

Instantly deploy your Next.js site to a shareable URL with Vercel.

-
-
-
- ); -} \ No newline at end of file diff --git a/playground/app-router/src/app/protected/ClientSideWrapper.tsx b/playground/app-router/src/app/protected/ClientSideWrapper.tsx deleted file mode 100644 index 989e2726540..00000000000 --- a/playground/app-router/src/app/protected/ClientSideWrapper.tsx +++ /dev/null @@ -1,26 +0,0 @@ -'use client'; - -import React from 'react'; -import { useAuth, useUser } from '@clerk/react'; - -export const ClientSideWrapper = (props: React.PropsWithChildren) => { - React.useEffect(() => {}); - - const useUserRes = useUser(); - const useAuthRes = useAuth(); - return ( -
-

"use client";

-
-        useUser
-        {JSON.stringify({ isLoaded: useUserRes.isLoaded, user: useUserRes.user?.id }, null, 2)}
-        useAuth2
-        {JSON.stringify({ isSignedIn: useAuthRes.isSignedIn, user: useAuthRes.userId }, null, 2)}
-      
-
-

children

- {props.children} -
-
- ); -}; diff --git a/playground/app-router/src/app/protected/page.tsx b/playground/app-router/src/app/protected/page.tsx deleted file mode 100644 index a61537e515d..00000000000 --- a/playground/app-router/src/app/protected/page.tsx +++ /dev/null @@ -1,38 +0,0 @@ -import { ClerkLoaded, Show, UserButton } from '@clerk/nextjs'; -import { auth } from '@clerk/nextjs/server'; -import React from 'react'; -import { ClientSideWrapper } from '@/app/protected/ClientSideWrapper'; -import { header } from 'ezheaders'; - -export default async function Page() { - const { userId } = await auth(); - const xClerkDebug = await header('x-clerk-debug'); - - console.log('Auth run in /protected', userId, xClerkDebug); - return ( -
-

Protected page

-

-      
-        

Signed in

-
- -

Signed out

-
- -

Clerk loaded

-
- - - - server content - -
SignedIn
-
- -
ClerkLoaded
-
-
-
- ); -} diff --git a/playground/app-router/src/app/sign-in/[[...catchall]]/page.tsx b/playground/app-router/src/app/sign-in/[[...catchall]]/page.tsx deleted file mode 100644 index 39021a5f67d..00000000000 --- a/playground/app-router/src/app/sign-in/[[...catchall]]/page.tsx +++ /dev/null @@ -1,14 +0,0 @@ -import { SignIn } from '@clerk/nextjs'; - -export default function Page() { - return ( -
- here? - -
- ); -} diff --git a/playground/app-router/src/app/sign-up/[[...catchall]]/page.tsx b/playground/app-router/src/app/sign-up/[[...catchall]]/page.tsx deleted file mode 100644 index dc8d5cfd0d7..00000000000 --- a/playground/app-router/src/app/sign-up/[[...catchall]]/page.tsx +++ /dev/null @@ -1,9 +0,0 @@ -import { SignUp } from '@clerk/nextjs'; - -export default function Page() { - return ( -
- -
- ); -} diff --git a/playground/app-router/src/common/Links.tsx b/playground/app-router/src/common/Links.tsx deleted file mode 100644 index 67b83072143..00000000000 --- a/playground/app-router/src/common/Links.tsx +++ /dev/null @@ -1,25 +0,0 @@ -import Link from 'next/link'; - -export const Links = () => { - return ( -
-
-

App router:

-
- Home - Sign in - Sign up - Protected (auth()) - Server action -
-
-
-

Pages:

-
- /user (SSR and gSSP) (getAuth()) - /profile (no SSR) -
-
-
- ); -}; diff --git a/playground/app-router/src/middleware.ts b/playground/app-router/src/middleware.ts deleted file mode 100644 index 8c4dd060d10..00000000000 --- a/playground/app-router/src/middleware.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { clerkMiddleware } from '@clerk/nextjs/server'; - - -export default clerkMiddleware() - -export const config = { - matcher: ['/((?!.*\\..*|_next).*)', '/', '/(api|trpc)(.*)'], -}; diff --git a/playground/app-router/src/pages/_app.tsx b/playground/app-router/src/pages/_app.tsx deleted file mode 100644 index 5d0f6828b52..00000000000 --- a/playground/app-router/src/pages/_app.tsx +++ /dev/null @@ -1,19 +0,0 @@ -import type { AppProps } from 'next/app'; - -import { ClerkProvider } from '@clerk/nextjs'; -import React from 'react'; -import { Links } from '@/common/Links'; - -function MyApp({ Component, pageProps }: AppProps) { - return ( - - -
-

Pages

- -
-
- ); -} - -export default MyApp; diff --git a/playground/app-router/src/pages/profile/[[...index]].tsx b/playground/app-router/src/pages/profile/[[...index]].tsx deleted file mode 100644 index 2bf9980099d..00000000000 --- a/playground/app-router/src/pages/profile/[[...index]].tsx +++ /dev/null @@ -1,19 +0,0 @@ -import { UserProfile } from '@clerk/nextjs'; -import type { NextPage } from 'next'; -import React from 'react'; - -const UserProfilePage: NextPage = (props: any) => { - return ( -
-

/pages/profile

-

experimental-edge

- -
- ); -}; - -export default UserProfilePage; - -export const config = { - runtime: 'experimental-edge', -}; diff --git a/playground/app-router/src/pages/user/[[...index]].tsx b/playground/app-router/src/pages/user/[[...index]].tsx deleted file mode 100644 index 65c03834d2c..00000000000 --- a/playground/app-router/src/pages/user/[[...index]].tsx +++ /dev/null @@ -1,25 +0,0 @@ -import { Show, UserProfile } from '@clerk/nextjs'; -import { getAuth } from '@clerk/nextjs/server'; -import type { GetServerSideProps, NextPage } from 'next'; -import React from 'react'; - -export const getServerSideProps: GetServerSideProps = async ({ req }) => { - const { userId } = getAuth(req); - console.log(userId); - return { props: { message: 'hello from server' } }; -}; - -const UserProfilePage: NextPage = (props: any) => { - return ( -
-

/pages/user

-
{props.message}
- -

SignedIn

-
- -
- ); -}; - -export default UserProfilePage; \ No newline at end of file diff --git a/playground/app-router/tsconfig.json b/playground/app-router/tsconfig.json deleted file mode 100644 index 0c7555fa765..00000000000 --- a/playground/app-router/tsconfig.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "compilerOptions": { - "target": "es5", - "lib": ["dom", "dom.iterable", "esnext"], - "allowJs": true, - "skipLibCheck": true, - "strict": true, - "forceConsistentCasingInFileNames": true, - "noEmit": true, - "esModuleInterop": true, - "module": "esnext", - "moduleResolution": "node", - "resolveJsonModule": true, - "isolatedModules": true, - "jsx": "preserve", - "incremental": true, - "plugins": [ - { - "name": "next" - } - ], - "paths": { - "@/*": ["./src/*"] - } - }, - "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"], - "exclude": ["node_modules"] -} diff --git a/playground/browser-extension-js/.env.example b/playground/browser-extension-js/.env.example deleted file mode 100644 index 044f7822c33..00000000000 --- a/playground/browser-extension-js/.env.example +++ /dev/null @@ -1 +0,0 @@ -CLERK_PUBLISHABLE_KEY= diff --git a/playground/browser-extension-js/.gitignore b/playground/browser-extension-js/.gitignore deleted file mode 100644 index d83a4589141..00000000000 --- a/playground/browser-extension-js/.gitignore +++ /dev/null @@ -1,7 +0,0 @@ -node_modules/ -pnpm-lock.yaml -build/*.js -.env -.yalc -yalc.lock -.npmrc diff --git a/playground/browser-extension-js/README.md b/playground/browser-extension-js/README.md deleted file mode 100644 index a97991314f7..00000000000 --- a/playground/browser-extension-js/README.md +++ /dev/null @@ -1,126 +0,0 @@ -# Browser Extension JS Playground - -A Chrome extension demo using `@clerk/chrome-extension` with plain TypeScript. No Chrome extension frameworks (no WXT, Plasmo, CRXJS, etc.). Uses `bun build` to bundle the TypeScript source. - -## Project structure - -``` -src/ - popup.ts # TypeScript source (bundled to build/popup.js) -build/ - manifest.json # Chrome extension manifest (Manifest V3) - popup.html # Popup page - popup.css # Popup styles - popup.js # Bundled output (gitignored) -.env.example # Environment variable template -.env # Your publishable key (gitignored) -``` - -Static extension files (`manifest.json`, `popup.html`, `popup.css`) live directly in `build/` and are checked into git. `bun build` automatically loads `.env`, replaces `process.env.CLERK_PUBLISHABLE_KEY` at build time, and bundles `src/popup.ts` into `build/popup.js`. - -## Getting started - -### 1. Build `@clerk/chrome-extension` and its dependencies - -From the repository root: - -```bash -pnpm turbo build --filter=@clerk/chrome-extension... -``` - -### 2. Start pkglab and publish packages - -From the repository root, start the local registry and publish `@clerk/chrome-extension` (along with its workspace dependencies): - -```bash -pnpm pkglab up -pnpm pkglab pub @clerk/chrome-extension -``` - -### 3. Add packages from pkglab - -```bash -cd playground/browser-extension-js -``` - -To see which packages have been published: - -```bash -pnpm pkglab:ls -``` - -From this playground directory (`playground/browser-extension-js`): - -```bash -pnpm pkglab:add -``` - -### 4. Install dependencies - -This playground is not a pnpm workspace member, so use `pnpm install` to install dependencies: - -```bash -pnpm install --ignore-workspace -``` - -The first time you install packages you will will may to approve builds. Use: - -```bash -pnpm approve-builds --ignore-workspace -``` - -### 5. Set up environment - -Copy `.env.example` to `.env` and add your Clerk publishable key: - -```bash -cp .env.example .env -``` - -Then edit `.env`: - -``` -CLERK_PUBLISHABLE_KEY=pk_test_... -``` - -### 6. Build the extension - -```bash -pnpm build -``` - -### 7. Load the extension in Chrome - -1. Open `chrome://extensions/` -2. Enable **Developer mode** (top right) -3. Click **Load unpacked** -4. Select the `build/` directory inside this playground - -## Development - -To rebuild on file changes: - -```bash -pnpm dev -``` - -## Rebuilding after package changes - -When you make changes to `@clerk/chrome-extension` (or its dependencies), rebuild and republish to pkglab: - -```bash -# From repo root -pnpm turbo build --filter=@clerk/chrome-extension... && pnpm pkglab pub @clerk/chrome-extension - - -# From this playground - -# If you haven't approved build yet -pnpm install --ignore-workspace -pnpm approve-builds -pnpm dev - -# If you have approved builds already -pnpm install -pnpm dev -``` diff --git a/playground/browser-extension-js/build/manifest.json b/playground/browser-extension-js/build/manifest.json deleted file mode 100644 index dcab155d51b..00000000000 --- a/playground/browser-extension-js/build/manifest.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "manifest_version": 3, - "name": "Clerk Extension JS Demo", - "description": "A Chrome extension demo using @clerk/chrome-extension with plain TypeScript.", - "version": "0.0.1", - "permissions": [ - "cookies", - "storage" - ], - "host_permissions": [ - "http://localhost/*" - ], - "action": { - "default_title": "Clerk Extension Demo", - "default_popup": "popup.html" - } -} diff --git a/playground/browser-extension-js/build/popup.css b/playground/browser-extension-js/build/popup.css deleted file mode 100644 index 223269c6f61..00000000000 --- a/playground/browser-extension-js/build/popup.css +++ /dev/null @@ -1,134 +0,0 @@ -* { - margin: 0; - padding: 0; - box-sizing: border-box; -} - -body { - width: 600px; - max-height: 600px; - height: 600px; - background: #111; - color: #fff; - font-family: system-ui, sans-serif; -} - -#app { - display: flex; - flex-direction: column; - min-height: 600px; -} - -#content { - flex: 1; - display: flex; - flex-direction: column; - align-items: center; - justify-content: start; - padding: 1rem; -} - -h1 { - font-size: 1.1rem; - font-weight: 600; - padding: 1rem 2rem; - text-align: center; -} - -#nav { - display: flex; - align-items: center; - justify-content: flex-end; - padding: 0.75rem 1rem; - background: #222; - border-top: 1px solid #333; -} - -#nav:has(#sign-out-btn) { - justify-content: space-between; -} - -#sign-in-btn { - background: #2563eb; - color: #fff; - border: none; - border-radius: 6px; - padding: 0.5rem 1.25rem; - font-size: 0.875rem; - cursor: pointer; - transition: background 0.15s; -} - -#sign-in-btn:hover { - background: #1d4ed8; -} - -#sign-in-btn:active { - background: #1e40af; -} - -#sign-out-btn { - background: #6C47FF; - color: #fff; - border: none; - border-radius: 6px; - padding: 0.5rem 1.25rem; - font-size: 0.875rem; - cursor: pointer; - transition: background 0.15s; -} - -#sign-out-btn:hover { - background: #5639CC; -} - -#sign-out-btn:active { - background: #4A30B3; -} - -.user-card { - width: 100%; - margin-top: 0.75rem; - background: #1a1a1a; - border: 1px solid #333; - border-radius: 10px; - padding: 0.75rem; - text-align: left; -} - -.user-card-header { - display: flex; - align-items: center; - gap: 0.75rem; - margin-bottom: 0.75rem; -} - -.user-avatar { - width: 48px; - height: 48px; - border-radius: 50%; - object-fit: cover; -} - -.user-name { - font-size: 1rem; - font-weight: 600; -} - -.user-info-row { - display: flex; - justify-content: space-between; - padding: 0.3rem 0; - font-size: 0.8rem; - border-top: 1px solid #2a2a2a; -} - -.info-label { - color: #888; -} - -.info-value { - color: #fff; - text-align: right; - word-break: break-all; -} diff --git a/playground/browser-extension-js/build/popup.html b/playground/browser-extension-js/build/popup.html deleted file mode 100644 index 3cc1c64380d..00000000000 --- a/playground/browser-extension-js/build/popup.html +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - Clerk Extension Demo - - - - -
-
-

Clerk JS Chrome Extension Quickstart

-
-
- -
- - - - diff --git a/playground/browser-extension-js/esbuild.config.mjs b/playground/browser-extension-js/esbuild.config.mjs deleted file mode 100644 index 9e54d8bda5b..00000000000 --- a/playground/browser-extension-js/esbuild.config.mjs +++ /dev/null @@ -1,31 +0,0 @@ -import esbuild from 'esbuild'; - -process.loadEnvFile(); - -if (!process.env.CLERK_PUBLISHABLE_KEY) { - throw new Error('Missing CLERK_PUBLISHABLE_KEY in .env'); -} - -const watch = process.argv.includes('--watch'); - -/** @type {import('esbuild').BuildOptions} */ -const options = { - entryPoints: ['./src/popup.ts'], - outfile: './build/popup.js', - bundle: true, - format: 'iife', - platform: 'browser', - target: 'es2022', - sourcemap: true, - define: { - 'process.env.CLERK_PUBLISHABLE_KEY': JSON.stringify(process.env.CLERK_PUBLISHABLE_KEY ?? ''), - }, -}; - -if (watch) { - const ctx = await esbuild.context(options); - await ctx.watch(); - console.log('Watching for changes...'); -} else { - await esbuild.build(options); -} diff --git a/playground/browser-extension-js/package.json b/playground/browser-extension-js/package.json deleted file mode 100644 index 45e31f3bb37..00000000000 --- a/playground/browser-extension-js/package.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "name": "browser-extension-js", - "private": true, - "version": "0.0.1", - "description": "A Chrome extension demo using @clerk/chrome-extension with plain TypeScript.", - "author": "Clerk", - "type": "module", - "scripts": { - "build": "node esbuild.config.mjs", - "dev": "node esbuild.config.mjs --watch", - "pkglab:add": "pnpm pkglab add @clerk/chrome-extension", - "pkglab:ls": "pnpm pkglab pkg ls" - }, - "dependencies": { - "@clerk/chrome-extension": "0.0.0-pkglab.1772136211844" - }, - "devDependencies": { - "@types/chrome": "^0.1.12", - "esbuild": "^0.25.0", - "typescript": "5.8.3" - } -} diff --git a/playground/browser-extension-js/pnpm-workspace.yaml b/playground/browser-extension-js/pnpm-workspace.yaml deleted file mode 100644 index b5ac8b5e39d..00000000000 --- a/playground/browser-extension-js/pnpm-workspace.yaml +++ /dev/null @@ -1,6 +0,0 @@ -onlyBuiltDependencies: - - '@clerk/shared' - - browser-tabs-lock - - bufferutil - - core-js - - utf-8-validate diff --git a/playground/browser-extension-js/src/env.d.ts b/playground/browser-extension-js/src/env.d.ts deleted file mode 100644 index d41502e388e..00000000000 --- a/playground/browser-extension-js/src/env.d.ts +++ /dev/null @@ -1 +0,0 @@ -declare const process: { env: { CLERK_PUBLISHABLE_KEY: string } }; diff --git a/playground/browser-extension-js/src/popup.ts b/playground/browser-extension-js/src/popup.ts deleted file mode 100644 index b4bced92bbf..00000000000 --- a/playground/browser-extension-js/src/popup.ts +++ /dev/null @@ -1,117 +0,0 @@ -import { createClerkClient } from '@clerk/chrome-extension/client'; - -const publishableKey = process.env.CLERK_PUBLISHABLE_KEY; - -const EXTENSION_URL = chrome.runtime.getURL('.'); -const POPUP_URL = `${EXTENSION_URL}popup.html`; - -const clerk = createClerkClient({ publishableKey }); - -const contentEl = document.getElementById('content') as HTMLDivElement; -const navEl = document.getElementById('nav') as HTMLDivElement; - -function render() { - contentEl.innerHTML = ''; - navEl.innerHTML = ''; - - if (clerk.user) { - const user = clerk.user; - - const card = document.createElement('div'); - card.className = 'user-card'; - - const header = document.createElement('div'); - header.className = 'user-card-header'; - - const avatar = document.createElement('img'); - avatar.className = 'user-avatar'; - avatar.src = user.imageUrl; - avatar.alt = 'Profile'; - - const name = document.createElement('span'); - name.className = 'user-name'; - name.textContent = user.fullName ?? 'Anonymous'; - - header.appendChild(avatar); - header.appendChild(name); - card.appendChild(header); - - const email = user.primaryEmailAddress?.emailAddress; - if (email) { - card.appendChild(createInfoRow('Email', email)); - } - - if (user.username) { - card.appendChild(createInfoRow('Username', user.username)); - } - - if (clerk.session) { - card.appendChild(createInfoRow('Session ID', truncate(clerk.session.id))); - } - - if (user.lastSignInAt) { - card.appendChild(createInfoRow('Last sign-in', user.lastSignInAt.toLocaleDateString())); - } - - if (user.createdAt) { - card.appendChild(createInfoRow('Account created', user.createdAt.toLocaleDateString())); - } - - contentEl.appendChild(card); - - const userBtnEl = document.createElement('div'); - navEl.appendChild(userBtnEl); - clerk.mountUserButton(userBtnEl); - - const signOutBtn = document.createElement('button'); - signOutBtn.textContent = 'Sign Out'; - signOutBtn.id = 'sign-out-btn'; - signOutBtn.addEventListener('click', () => { - clerk.signOut({ redirectUrl: POPUP_URL }); - }); - navEl.appendChild(signOutBtn); - } else { - const signInBtn = document.createElement('button'); - signInBtn.textContent = 'Sign In'; - signInBtn.id = 'sign-in-btn'; - signInBtn.addEventListener('click', () => { - clerk.openSignIn({}); - }); - navEl.appendChild(signInBtn); - } -} - -function truncate(str: string): string { - if (str.length <= 15) return str; - const charsToKeep = str.length - 15; - const front = Math.ceil(charsToKeep / 2); - const back = Math.floor(charsToKeep / 2); - return `${str.slice(0, front)}...${str.slice(str.length - back)}`; -} - -function createInfoRow(label: string, value: string): HTMLDivElement { - const row = document.createElement('div'); - row.className = 'user-info-row'; - const labelSpan = document.createElement('span'); - labelSpan.className = 'info-label'; - labelSpan.textContent = label; - const valueSpan = document.createElement('span'); - valueSpan.className = 'info-value'; - valueSpan.textContent = value; - row.appendChild(labelSpan); - row.appendChild(valueSpan); - return row; -} - -clerk - .load({ - afterSignOutUrl: POPUP_URL, - signInForceRedirectUrl: POPUP_URL, - signUpForceRedirectUrl: POPUP_URL, - allowedRedirectProtocols: ['chrome-extension:'], - }) - .then(() => { - console.log('working') - clerk.addListener(render); - render(); - }); diff --git a/playground/browser-extension-js/tsconfig.json b/playground/browser-extension-js/tsconfig.json deleted file mode 100644 index b773145b856..00000000000 --- a/playground/browser-extension-js/tsconfig.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "compilerOptions": { - "target": "ES2020", - "module": "ES2020", - "moduleResolution": "bundler", - "outDir": "build", - "rootDir": "src", - "strict": true, - "skipLibCheck": true - }, - "include": ["src/**/*.ts"] -} - diff --git a/playground/browser-extension/.env.chrome.example b/playground/browser-extension/.env.chrome.example deleted file mode 100644 index beb66b4ed14..00000000000 --- a/playground/browser-extension/.env.chrome.example +++ /dev/null @@ -1 +0,0 @@ -CRX_PUBLIC_KEY= diff --git a/playground/browser-extension/.env.development.example b/playground/browser-extension/.env.development.example deleted file mode 100644 index 267a1b46ca5..00000000000 --- a/playground/browser-extension/.env.development.example +++ /dev/null @@ -1,2 +0,0 @@ -PLASMO_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_test_***** -CLERK_FRONTEND_API=https://*****.clerk.accounts.dev diff --git a/playground/browser-extension/.gitignore b/playground/browser-extension/.gitignore deleted file mode 100644 index 3d462e4c950..00000000000 --- a/playground/browser-extension/.gitignore +++ /dev/null @@ -1,5 +0,0 @@ -.plasmo -.env -.env.* -!.env.example -!.env.*.example diff --git a/playground/browser-extension/README.md b/playground/browser-extension/README.md deleted file mode 100644 index 7886935d2a3..00000000000 --- a/playground/browser-extension/README.md +++ /dev/null @@ -1,70 +0,0 @@ -## Running the Playground - -Standard: - -```bash -pnpm dev -``` - -On changes to upstream monorepo packages: - -```bash -pnpm update @clerk/chrome-extension && pnpm dev -``` - -## Introduction - -Clerk is a developer-first authentication and user management solution. It provides pre-built React components and hooks for sign-in, sign-up, user profile, and organization management. Clerk is designed to be easy to use and customize, and can be dropped into any Chrome Extension application. - -After following the quickstart you'll have learned how to: - -* Scaffold a new application using the Plasmo framework -* Install `@clerk/chrome-extension` -* Set your environment variables -* Add `` to your application -* Create a header with Clerk components for users to sign in and out -* Configure a consistent CRX key -* Load your Chrome Extension into your Chromium-based browser -* Test your Chrome Extension - -## Running the template - -```bash -git clone https://github.com/clerkinc/clerk-chrome-extension-quickstart -``` - -To run the example locally, you need to: - -1. Sign up for a Clerk account at [https://clerk.com](https://dashboard.clerk.com/sign-up?utm_source=readme\&utm_medium=owned\&utm_campaign=chrome-extension\&utm_content=10-24-2023\&utm_term=clerk-chrome-extension-quickstart). - -2. Go to the [Clerk dashboard](https://dashboard.clerk.com?utm_source=readme\&utm_medium=owned\&utm_campaign=chrome-extension\&utm_content=10-24-2023\&utm_term=clerk-chrome-extension-quickstart) and create an application. - -3. Set the required Clerk environment variables as shown in [the example `.env.development` file](./.env.development.example). - -4. Create a [consistent CRX ID](https://clerk.com/docs/references/chrome-extension/configure-consistent-key) for your extension. - -5. Set the public key are shown in [the example `.env.chrome` file](./.env.chrome.example). - -6. `pnpm install` the required dependencies. - -7. `pnpm dev` to launch the development server. - -## Learn more - -To learn more about Clerk and Chrome Extensions, check out the following resources: - -* [Quickstart: Get started with Chrome Extensions and Clerk](https://clerk.com/docs/quickstarts/chrome-extension?utm_source=readme\&utm_medium=owned\&utm_campaign=chrome-extension\&utm_content=10-24-2023\&utm_term=clerk-chrome-extension-quickstart) - -* [Clerk Documentation](https://clerk.com/docs?utm_source=readme\&utm_medium=owned\&utm_campaign=chrome-extension\&utm_content=10-24-2023\&utm_term=clerk-chrome-extension-quickstart) - -* [Chrome Extensions](https://developer.chrome.com/docs/extensions) - -## Found an issue or want to leave feedback - -Feel free to create a support thread on our [Discord](https://clerk.com/discord). Our support team will be happy to assist you in the `#support` channel. - -## Connect with us - -You can discuss ideas, ask questions, and meet others from the community in our [Discord](https://discord.com/invite/b5rXHjAg7A). - -If you prefer, you can also find support through our [Twitter](https://twitter.com/ClerkDev), or you can [email](mailto:support@clerk.dev) us! diff --git a/playground/browser-extension/assets/icon.png b/playground/browser-extension/assets/icon.png deleted file mode 100644 index df3eaad5939..00000000000 Binary files a/playground/browser-extension/assets/icon.png and /dev/null differ diff --git a/playground/browser-extension/package.json b/playground/browser-extension/package.json deleted file mode 100644 index 9400e034dd7..00000000000 --- a/playground/browser-extension/package.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "name": "browser-extension", - "private": true, - "displayName": "Clerk Chrome Extension Demo", - "version": "0.0.1", - "description": "A feature rich implementation of Clerk with a Plasmo-based Chrome Extension.", - "author": "Clerk", - "scripts": { - "build": "plasmo build", - "build:firefox": "plasmo build --target=firefox-mv2", - "debug": "plasmo dev --verbose", - "debug:firefox": "plasmo dev --target=firefox-mv2 --verbose", - "dev": "plasmo dev", - "dev:firefox": "plasmo dev --target=firefox-mv2", - "start:firefox": "web-ext run --source-dir ./build/firefox-mv2-dev" - }, - "dependencies": { - "@clerk/chrome-extension": "workspace:*", - "@radix-ui/react-slot": "^1.1.0", - "class-variance-authority": "^0.7.0", - "clsx": "^2.1.1", - "plasmo": "0.90.5", - "react": "^19.1.0", - "react-dom": "^19.1.0", - "react-router-dom": "^6.27.0", - "tailwind-merge": "^2.5.4", - "tailwindcss": "3.4.14", - "webextension-polyfill": "^0.12.0" - }, - "devDependencies": { - "@ianvs/prettier-plugin-sort-imports": "4.1.1", - "@types/chrome": "0.0.280", - "@types/node": "20.16.14", - "@types/react": "19.1.0", - "@types/react-dom": "19.1.0", - "@types/webextension-polyfill": "^0.12.1", - "postcss": "8.4.49", - "prettier": "3.3.3", - "typescript": "5.6.3" - }, - "manifest": { - "permissions": [ - "cookies", - "storage", - "sidePanel" - ], - "host_permissions": [ - "$CLERK_FRONTEND_API/*", - "$PLASMO_PUBLIC_CLERK_SYNC_HOST/*", - "http://localhost/*" - ], - "key": "$CRX_PUBLIC_KEY" - } -} diff --git a/playground/browser-extension/postcss.config.js b/playground/browser-extension/postcss.config.js deleted file mode 100644 index 2484180d45e..00000000000 --- a/playground/browser-extension/postcss.config.js +++ /dev/null @@ -1,8 +0,0 @@ -/** - * @type {import('postcss').ProcessOptions} - */ -module.exports = { - plugins: { - tailwindcss: {} - } -} diff --git a/playground/browser-extension/src/assets/chrome-extension-sdk-2.jpg b/playground/browser-extension/src/assets/chrome-extension-sdk-2.jpg deleted file mode 100644 index 6d74f3fe55a..00000000000 Binary files a/playground/browser-extension/src/assets/chrome-extension-sdk-2.jpg and /dev/null differ diff --git a/playground/browser-extension/src/assets/dark-logo.png b/playground/browser-extension/src/assets/dark-logo.png deleted file mode 100644 index e2635defc9b..00000000000 Binary files a/playground/browser-extension/src/assets/dark-logo.png and /dev/null differ diff --git a/playground/browser-extension/src/assets/icon.png b/playground/browser-extension/src/assets/icon.png deleted file mode 100644 index 674c4e13b11..00000000000 Binary files a/playground/browser-extension/src/assets/icon.png and /dev/null differ diff --git a/playground/browser-extension/src/assets/light-logo.png b/playground/browser-extension/src/assets/light-logo.png deleted file mode 100644 index 2941bed4b60..00000000000 Binary files a/playground/browser-extension/src/assets/light-logo.png and /dev/null differ diff --git a/playground/browser-extension/src/background/index.ts b/playground/browser-extension/src/background/index.ts deleted file mode 100644 index d549bdb338b..00000000000 --- a/playground/browser-extension/src/background/index.ts +++ /dev/null @@ -1,44 +0,0 @@ -import { createClerkClient } from '@clerk/chrome-extension/background'; - -console.log('[Service Worker]: Loaded') - -const publishableKey = process.env.PLASMO_PUBLIC_CLERK_PUBLISHABLE_KEY -if (!publishableKey) { - throw new Error('Please add the PLASMO_PUBLIC_CLERK_PUBLISHABLE_KEY to the .env.development file') -} - -async function getToken() { - const clerk = await createClerkClient({ - publishableKey, - syncHost: process.env.PLASMO_PUBLIC_CLERK_SYNC_HOST - }); - - // is there is no signed in user then return null - if (!clerk.session) { - return null; - } - - const token = await clerk.session?.getToken(); - return `${token} - ${clerk.user.id}` -} -// asdf -// create a listener to listen for messages from content scripts -// NOTE: A runtime listener cannot be async. -// It must return true, in order to keep the connection open and send a response later. -chrome.runtime.onMessage.addListener((request, sender, sendResponse) => { - console.log('[Service Worker]: Handling request for the user\'s current token') - getToken() - .then((token) => { - console.log('[Service Worker]: Sending token in response') - console.log('[Service Worker]:', token) - sendResponse({ token }) - }) - .catch((error) => { - console.error('[Service Worker]: Error occured -> ', JSON.stringify(error)) - // Send `null` when there is no authenticated user - sendResponse({ token: null }) - }); - return true; -}); - - diff --git a/playground/browser-extension/src/components/nav-bar.tsx b/playground/browser-extension/src/components/nav-bar.tsx deleted file mode 100644 index d2ba1084856..00000000000 --- a/playground/browser-extension/src/components/nav-bar.tsx +++ /dev/null @@ -1,44 +0,0 @@ -import { Show, UserButton } from "@clerk/chrome-extension" -import { Link } from "react-router-dom" -import { Button } from "./ui/button" - -export const NavBar = () => { - return ( - <> - -
- - -
- - -
-
-
- -
- -
- - - -
-
-
- - - ) -} diff --git a/playground/browser-extension/src/components/ui/button.tsx b/playground/browser-extension/src/components/ui/button.tsx deleted file mode 100644 index f4456688403..00000000000 --- a/playground/browser-extension/src/components/ui/button.tsx +++ /dev/null @@ -1,56 +0,0 @@ -import * as React from 'react' -import { Slot } from '@radix-ui/react-slot' -import { cva, type VariantProps } from 'class-variance-authority' -import { cn } from '~utils/components'; - - -const buttonVariants = cva( - 'plasmo-inline-flex plasmo-items-center plasmo-justify-center plasmo-rounded-md plasmo-text-sm plasmo-font-medium plasmo-ring-offset-background plasmo-transition-colors focus-visible:plasmo-outline-none focus-visible:plasmo-ring-2 focus-visible:plasmo-ring-ring focus-visible:plasmo-ring-offset-2 disabled:plasmo-pointer-events-none disabled:plasmo-opacity-50', - { - variants: { - variant: { - default: 'plasmo-bg-gray-200 plasmo-text-gray-700 hover:plasmo-bg-gray-200/90', - destructive: - 'plasmo-bg-red-600 plasmo-text-white hover:plasmo-bg-red-600/90', - outline: - 'plasmo-border plasmo-border-input plasmo-bg-background hover:plasmo-bg-accent hover:plasmo-text-accent-foreground', - secondary: - 'plasmo-bg-secondary plasmo-text-secondary-foreground hover:plasmo-bg-secondary/80', - ghost: 'hover:plasmo-bg-accent hover:plasmo-text-accent-foreground', - link: 'plasmo-text-gray-200 plasmo-underline-offset-4 hover:plasmo-underline', - }, - size: { - default: 'plasmo-h-10 plasmo-px-4 plasmo-py-2', - sm: 'plasmo-h-9 plasmo-rounded-md plasmo-px-3', - lg: 'plasmo-h-11 plasmo-rounded-md plasmo-px-8', - icon: 'plasmo-h-10 plasmo-w-10', - }, - }, - defaultVariants: { - variant: 'default', - size: 'default', - }, - }, -); - -export interface ButtonProps - extends React.ButtonHTMLAttributes, - VariantProps { - asChild?: boolean -} - -const Button = React.forwardRef( - ({ className, variant, size, asChild = false, ...props }, ref) => { - const Comp = asChild ? Slot : 'button' - return ( - - ) - }, -) -Button.displayName = 'Button' - -export { Button, buttonVariants } diff --git a/playground/browser-extension/src/content.tsx b/playground/browser-extension/src/content.tsx deleted file mode 100644 index 7713a6a1369..00000000000 --- a/playground/browser-extension/src/content.tsx +++ /dev/null @@ -1,24 +0,0 @@ -import cssText from "data-text:~style.css" -import type { PlasmoCSConfig } from "plasmo" - -import { CountButton } from "~features/count-button" - -export const config: PlasmoCSConfig = { - matches: ["https://www.plasmo.com/*"] -} - -export const getStyle = () => { - const style = document.createElement("style") - style.textContent = cssText - return style -} - -const PlasmoOverlay = () => { - return ( -
- -
- ) -} - -export default PlasmoOverlay diff --git a/playground/browser-extension/src/features/count-button.tsx b/playground/browser-extension/src/features/count-button.tsx deleted file mode 100644 index 9f7e9878264..00000000000 --- a/playground/browser-extension/src/features/count-button.tsx +++ /dev/null @@ -1,19 +0,0 @@ -import { useReducer } from "react" - -export const CountButton = () => { - const [count, increase] = useReducer((c) => c + 1, 0) - - return ( - - ) -} diff --git a/playground/browser-extension/src/popup/index.tsx b/playground/browser-extension/src/popup/index.tsx deleted file mode 100644 index 526c136e573..00000000000 --- a/playground/browser-extension/src/popup/index.tsx +++ /dev/null @@ -1,38 +0,0 @@ - -import "../style.css"; -import { RouterProvider, createMemoryRouter } from "react-router-dom"; - -// Import the layouts -import { RootLayout } from "./layouts/root-layout"; - -// Import the components -import { SignInPage } from "./routes/sign-in"; -import { SignUpPage } from "./routes/sign-up"; -import { Settings } from "./routes/settings"; -import { SDKFeatures } from "./routes/sdk-features"; -import { Home } from "./routes/home"; - -// Create the router -// This removes the need for an App.tsx file -const router = createMemoryRouter([ - { - element: , - children: [ - { path: "/", element: }, - { path: "/sign-in", element: }, - { path: "/sign-up", element: }, - { path: "/settings", element: }, - { path: "/sdk-features", element: } - ], - }, -], { - future: { - v7_relativeSplatPath: true - } -}); - -export default function PopupIndex() { - return ( - - ) -} diff --git a/playground/browser-extension/src/popup/layouts/root-layout.tsx b/playground/browser-extension/src/popup/layouts/root-layout.tsx deleted file mode 100644 index 27c5de3f773..00000000000 --- a/playground/browser-extension/src/popup/layouts/root-layout.tsx +++ /dev/null @@ -1,35 +0,0 @@ -import { Outlet, useNavigate } from "react-router-dom"; -import { ClerkProvider } from "@clerk/chrome-extension"; -import { NavBar } from "~components/nav-bar"; - -const PUBLISHABLE_KEY = process.env.PLASMO_PUBLIC_CLERK_PUBLISHABLE_KEY -const SYNC_HOST = process.env.PLASMO_PUBLIC_CLERK_SYNC_HOST - -if (!PUBLISHABLE_KEY || !SYNC_HOST) { - throw new Error('Please add the PLASMO_PUBLIC_CLERK_PUBLISHABLE_KEY and PLASMO_PUBLIC_CLERK_SYNC_HOST to the .env.development file') -} - -export const RootLayout = () => { - const navigate = useNavigate(); - - return ( - navigate(to)} - routerReplace={(to) => navigate(to, { replace: true })} - publishableKey={PUBLISHABLE_KEY} - afterSignOutUrl="/" - syncHost={SYNC_HOST} - debug - __experimental_syncHostListener - > -
-
- -
-
- -
-
-
- ); -}; diff --git a/playground/browser-extension/src/popup/routes/home.tsx b/playground/browser-extension/src/popup/routes/home.tsx deleted file mode 100644 index b71fd0e42ec..00000000000 --- a/playground/browser-extension/src/popup/routes/home.tsx +++ /dev/null @@ -1,13 +0,0 @@ -import heroIamge from "data-base64:~assets/light-logo.png" - -export const Home = () => { - return ( -
- Clerk Chrome Extension SDK 2.0 -

Clerk Chrome Extension Demo

-

- Sign in with the popup or sync your auth state with http://localhost:5173, explore an extension built with React Router for tabs and get a token from a tab-based content script using the new createClerkClient() function just for service workers. -

-
- ); -}; diff --git a/playground/browser-extension/src/popup/routes/sdk-features.tsx b/playground/browser-extension/src/popup/routes/sdk-features.tsx deleted file mode 100644 index abbc363c0f0..00000000000 --- a/playground/browser-extension/src/popup/routes/sdk-features.tsx +++ /dev/null @@ -1,24 +0,0 @@ -import { Button } from "~components/ui/button" - -export const SDKFeatures = () => { - return ( -
-

Background Service Worker Support

-

The @clerk/chrome-extension v2.0 SDK now includes support for interacting with Clerk through a Background Service Worker.

-

v2.0 of the SDK introduces the new `createClerkClient()` helper function. This will also the Background Service Worker to initialize a new Clerk instance and attempt to refresh the user's session.

-

Once done, you can then get a token or interact with many of Clerk's chrome.tabs.create({ url: "https://clerk.com/docs/references/javascript/overview" })}>Javascript functonality.

-

The button below will open a new tab and use a content script to send a message to a Background Servie Worker. Since you are signed in, you will end up seeing your session token displayed.

- - -
- ) -} diff --git a/playground/browser-extension/src/popup/routes/settings.tsx b/playground/browser-extension/src/popup/routes/settings.tsx deleted file mode 100644 index 8c8538d8c22..00000000000 --- a/playground/browser-extension/src/popup/routes/settings.tsx +++ /dev/null @@ -1,10 +0,0 @@ -import { UserProfile } from "@clerk/chrome-extension"; - -export const Settings = () => { - return ( - <> -

Settings

- - - ); -}; diff --git a/playground/browser-extension/src/popup/routes/sign-in.tsx b/playground/browser-extension/src/popup/routes/sign-in.tsx deleted file mode 100644 index 8ff9c5ddfd6..00000000000 --- a/playground/browser-extension/src/popup/routes/sign-in.tsx +++ /dev/null @@ -1,16 +0,0 @@ -import { SignIn } from "@clerk/chrome-extension"; - -export const SignInPage = () => { - return ( -
- -
- ); -}; diff --git a/playground/browser-extension/src/popup/routes/sign-up.tsx b/playground/browser-extension/src/popup/routes/sign-up.tsx deleted file mode 100644 index 3608f8aa2ce..00000000000 --- a/playground/browser-extension/src/popup/routes/sign-up.tsx +++ /dev/null @@ -1,17 +0,0 @@ -import { SignUp } from "@clerk/chrome-extension"; - -export const SignUpPage = () => { - return ( -
- -
- ); -}; diff --git a/playground/browser-extension/src/sidepanel/index.tsx b/playground/browser-extension/src/sidepanel/index.tsx deleted file mode 100644 index 3151e7c2811..00000000000 --- a/playground/browser-extension/src/sidepanel/index.tsx +++ /dev/null @@ -1,35 +0,0 @@ -import '../style.css'; -import { RouterProvider, createMemoryRouter } from 'react-router-dom'; - -// Import the layouts -import { RootLayout } from '../popup/layouts/root-layout'; - -// Import the components -import { SignInPage } from '../popup/routes/sign-in'; -import { SignUpPage } from '../popup/routes/sign-up'; -import { Home } from '../popup/routes/home'; -import { Settings } from '../popup/routes/settings'; -import { SDKFeatures } from '../popup/routes/sdk-features'; - -// Create the router -// This removes the need for an App.tsx file -const router = createMemoryRouter([ - { - element: , - children: [ - { path: '/', element: }, - { path: '/sign-in', element: }, - { path: '/sign-up', element: }, - { path: '/settings', element: }, - { path: '/sdk-features', element: }, - ], - }, -], { - future: { - v7_relativeSplatPath: true - } -}); - -export default function SidePanelIndex() { - return ; -} diff --git a/playground/browser-extension/src/style.css b/playground/browser-extension/src/style.css deleted file mode 100644 index 6e0335c910c..00000000000 --- a/playground/browser-extension/src/style.css +++ /dev/null @@ -1,5 +0,0 @@ -@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;700&display=swap"); - -@tailwind base; -@tailwind components; -@tailwind utilities; diff --git a/playground/browser-extension/src/tabs/background-worker-demo.html b/playground/browser-extension/src/tabs/background-worker-demo.html deleted file mode 100644 index dde599a9826..00000000000 --- a/playground/browser-extension/src/tabs/background-worker-demo.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - - Clerk Background Worker demo - - - - - - - diff --git a/playground/browser-extension/src/tabs/background-worker-demo.tsx b/playground/browser-extension/src/tabs/background-worker-demo.tsx deleted file mode 100644 index 06a02041b5b..00000000000 --- a/playground/browser-extension/src/tabs/background-worker-demo.tsx +++ /dev/null @@ -1,44 +0,0 @@ -import * as React from 'react'; - -import "../style.css"; -import { Button } from '~components/ui/button'; - -export default function NewTab() { - const [token, setToken] = React.useState(null); - - const getToken = async (e: React.MouseEvent) => { - e.preventDefault(); - - console.log('[Content Script]: Sending request to bakcground service worker'); - // send a message to the background service worker - chrome.runtime.sendMessage('test', response => { - console.log('[Content Script]:', JSON.stringify(response)); - setToken(response.token); - }); - }; - - return ( -
-
-

Clerk Background Service Worker demo

-
-

This new tab simluates a content page where you might want to access user information, or make a request to your backend server and include a user token in the request.

-

Make sure that you are signed into the extension. You can have the popup closed.

- -

Token:

-
- {token &&

{token}

} -
-
-
-
- ) -} - - - diff --git a/playground/browser-extension/src/utils/components.ts b/playground/browser-extension/src/utils/components.ts deleted file mode 100644 index 9ad0df4269e..00000000000 --- a/playground/browser-extension/src/utils/components.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { type ClassValue, clsx } from 'clsx'; -import { twMerge } from 'tailwind-merge'; - -export function cn(...inputs: ClassValue[]) { - return twMerge(clsx(inputs)); -} diff --git a/playground/browser-extension/tailwind.config.js b/playground/browser-extension/tailwind.config.js deleted file mode 100644 index 564630220b7..00000000000 --- a/playground/browser-extension/tailwind.config.js +++ /dev/null @@ -1,6 +0,0 @@ -/** @type {import('tailwindcss').Config} */ -module.exports = { - content: ["./src/**/*.{tsx,html}"], - darkMode: "media", - prefix: "plasmo-" -} diff --git a/playground/browser-extension/tsconfig.json b/playground/browser-extension/tsconfig.json deleted file mode 100644 index 6603b5b31d0..00000000000 --- a/playground/browser-extension/tsconfig.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "extends": "plasmo/templates/tsconfig.base", - "exclude": [ - "node_modules" - ], - "include": [ - ".plasmo/index.d.ts", - "./**/*.ts", - "./**/*.tsx" - ], - "compilerOptions": { - "jsx": "react-jsx", - "paths": { - "~*": [ - "./src/*" - ] - }, - "baseUrl": "." - } -} diff --git a/playground/cra-js/.gitignore b/playground/cra-js/.gitignore deleted file mode 100644 index 4d29575de80..00000000000 --- a/playground/cra-js/.gitignore +++ /dev/null @@ -1,23 +0,0 @@ -# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. - -# dependencies -/node_modules -/.pnp -.pnp.js - -# testing -/coverage - -# production -/build - -# misc -.DS_Store -.env.local -.env.development.local -.env.test.local -.env.production.local - -npm-debug.log* -yarn-debug.log* -yarn-error.log* diff --git a/playground/cra-js/README.md b/playground/cra-js/README.md deleted file mode 100644 index 552db95a646..00000000000 --- a/playground/cra-js/README.md +++ /dev/null @@ -1,70 +0,0 @@ -# Getting Started with Create React App - -This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app). - -## 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 your browser. - -The page will reload when you make changes.\ -You may 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. - -### `pnpm 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. - -### `pnpm 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/). - -### Code Splitting - -This section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting) - -### Analyzing the Bundle Size - -This section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size) - -### Making a Progressive Web App - -This section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app) - -### Advanced Configuration - -This section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration) - -### Deployment - -This section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment) - -### `pnpm build` fails to minify - -This section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify) diff --git a/playground/cra-js/package.json b/playground/cra-js/package.json deleted file mode 100644 index 3770ecd2ad7..00000000000 --- a/playground/cra-js/package.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "name": "cra", - "version": "0.1.0", - "private": true, - "dependencies": { - "@clerk/react": "workspace:*", - "@clerk/shared": "workspace:*", - "@clerk/types": "workspace:*", - "react": "^18.2.0", - "react-dom": "^18.2.0", - "react-scripts": "5.0.1", - "web-vitals": "^2.1.4" - }, - "scripts": { - "start": "react-scripts start", - "build": "react-scripts build", - "eject": "react-scripts eject" - }, - "eslintConfig": { - "extends": [ - "react-app" - ] - }, - "browserslist": { - "production": [ - ">0.2%", - "not dead", - "not op_mini all" - ], - "development": [ - "last 1 chrome version", - "last 1 firefox version", - "last 1 safari version" - ] - } -} diff --git a/playground/cra-js/public/favicon.ico b/playground/cra-js/public/favicon.ico deleted file mode 100644 index a11777cc471..00000000000 Binary files a/playground/cra-js/public/favicon.ico and /dev/null differ diff --git a/playground/cra-js/public/index.html b/playground/cra-js/public/index.html deleted file mode 100644 index 2e9d8dbcc51..00000000000 --- a/playground/cra-js/public/index.html +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - - - - - - - - React App - - - -
- - - diff --git a/playground/cra-js/public/logo192.png b/playground/cra-js/public/logo192.png deleted file mode 100644 index fc44b0a3796..00000000000 Binary files a/playground/cra-js/public/logo192.png and /dev/null differ diff --git a/playground/cra-js/public/logo512.png b/playground/cra-js/public/logo512.png deleted file mode 100644 index a4e47a6545b..00000000000 Binary files a/playground/cra-js/public/logo512.png and /dev/null differ diff --git a/playground/cra-js/public/manifest.json b/playground/cra-js/public/manifest.json deleted file mode 100644 index 080d6c77ac2..00000000000 --- a/playground/cra-js/public/manifest.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "short_name": "React App", - "name": "Create React App Sample", - "icons": [ - { - "src": "favicon.ico", - "sizes": "64x64 32x32 24x24 16x16", - "type": "image/x-icon" - }, - { - "src": "logo192.png", - "type": "image/png", - "sizes": "192x192" - }, - { - "src": "logo512.png", - "type": "image/png", - "sizes": "512x512" - } - ], - "start_url": ".", - "display": "standalone", - "theme_color": "#000000", - "background_color": "#ffffff" -} diff --git a/playground/cra-js/public/robots.txt b/playground/cra-js/public/robots.txt deleted file mode 100644 index e9e57dc4d41..00000000000 --- a/playground/cra-js/public/robots.txt +++ /dev/null @@ -1,3 +0,0 @@ -# https://www.robotstxt.org/robotstxt.html -User-agent: * -Disallow: diff --git a/playground/cra-js/src/App.css b/playground/cra-js/src/App.css deleted file mode 100644 index 74b5e053450..00000000000 --- a/playground/cra-js/src/App.css +++ /dev/null @@ -1,38 +0,0 @@ -.App { - text-align: center; -} - -.App-logo { - height: 40vmin; - pointer-events: none; -} - -@media (prefers-reduced-motion: no-preference) { - .App-logo { - animation: App-logo-spin infinite 20s linear; - } -} - -.App-header { - background-color: #282c34; - min-height: 100vh; - display: flex; - flex-direction: column; - align-items: center; - justify-content: center; - font-size: calc(10px + 2vmin); - color: white; -} - -.App-link { - color: #61dafb; -} - -@keyframes App-logo-spin { - from { - transform: rotate(0deg); - } - to { - transform: rotate(360deg); - } -} diff --git a/playground/cra-js/src/App.js b/playground/cra-js/src/App.js deleted file mode 100644 index 33fc0b085ab..00000000000 --- a/playground/cra-js/src/App.js +++ /dev/null @@ -1,25 +0,0 @@ -import logo from './logo.svg'; -import './App.css'; -import { ClerkProvider, SignIn } from '@clerk/react'; - -function App() { - return ( - -
-
- logo -

- Edit src/App.js and save to reload. -

- -
-
-
- ); -} - -export default App; diff --git a/playground/cra-js/src/index.css b/playground/cra-js/src/index.css deleted file mode 100644 index 7323ae85c54..00000000000 --- a/playground/cra-js/src/index.css +++ /dev/null @@ -1,11 +0,0 @@ -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; -} - -code { - font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', monospace; -} diff --git a/playground/cra-js/src/index.js b/playground/cra-js/src/index.js deleted file mode 100644 index 9168dc41355..00000000000 --- a/playground/cra-js/src/index.js +++ /dev/null @@ -1,17 +0,0 @@ -import React from 'react'; -import ReactDOM from 'react-dom/client'; -import './index.css'; -import App from './App'; -import reportWebVitals from './reportWebVitals'; - -const root = ReactDOM.createRoot(document.getElementById('root')); -root.render( - - - , -); - -// If you want to start measuring performance in your app, pass a function -// to log results (for example: reportWebVitals(console.log)) -// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals -reportWebVitals(); diff --git a/playground/cra-js/src/logo.svg b/playground/cra-js/src/logo.svg deleted file mode 100644 index 9dfc1c058ce..00000000000 --- a/playground/cra-js/src/logo.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/playground/cra-js/src/reportWebVitals.js b/playground/cra-js/src/reportWebVitals.js deleted file mode 100644 index 5253d3ad9e6..00000000000 --- a/playground/cra-js/src/reportWebVitals.js +++ /dev/null @@ -1,13 +0,0 @@ -const reportWebVitals = onPerfEntry => { - if (onPerfEntry && onPerfEntry instanceof Function) { - import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => { - getCLS(onPerfEntry); - getFID(onPerfEntry); - getFCP(onPerfEntry); - getLCP(onPerfEntry); - getTTFB(onPerfEntry); - }); - } -}; - -export default reportWebVitals; diff --git a/playground/expo/.env.example b/playground/expo/.env.example deleted file mode 100644 index 0fe4594cfe1..00000000000 --- a/playground/expo/.env.example +++ /dev/null @@ -1 +0,0 @@ -EXPO_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_test_YWM123 \ No newline at end of file diff --git a/playground/expo/.gitignore b/playground/expo/.gitignore deleted file mode 100644 index 9bee08c5692..00000000000 --- a/playground/expo/.gitignore +++ /dev/null @@ -1,40 +0,0 @@ -# Learn more https://docs.github.com/en/get-started/getting-started-with-git/ignoring-files - -# dependencies -node_modules/ - -# Expo -.expo/ -dist/ -web-build/ - -# Native -*.orig.* -*.jks -*.p8 -*.p12 -*.key -*.mobileprovision - -# Metro -.metro-health-check* - -# debug -npm-debug.* -yarn-debug.* -yarn-error.* - -# macOS -.DS_Store -*.pem - -# local env files -.env*.local - - -# typescript -*.tsbuildinfo -.env -ios -android -app.json \ No newline at end of file diff --git a/playground/expo/App.tsx b/playground/expo/App.tsx deleted file mode 100644 index efcf219bdf2..00000000000 --- a/playground/expo/App.tsx +++ /dev/null @@ -1,187 +0,0 @@ -import { ClerkProvider, Show, useAuth, useSignIn, useUser } from '@clerk/expo'; -import { passkeys } from '@clerk/expo/passkeys'; -import * as SecureStore from 'expo-secure-store'; -import React from 'react'; -import { StyleSheet, Text, TextInput, TouchableOpacity, View } from 'react-native'; - -const tokenCache = { - async getToken(key: string) { - try { - const item = await SecureStore.getItemAsync(key); - if (item) { - console.log(`${key} was used 🔐 \n`); - } else { - console.log('No values stored under key: ' + key); - } - return item; - } catch (error) { - console.error('SecureStore get item error: ', error); - await SecureStore.deleteItemAsync(key); - return null; - } - }, - async saveToken(key: string, value: string) { - try { - return SecureStore.setItemAsync(key, value); - } catch (err) { - console.log(err); - } - }, -}; - -const ProtectedView = () => { - const { user: clerkUser } = useUser(); - const auth = useAuth(); - - const handleCreatePasskey = async () => { - if (!clerkUser) { - return; - } - try { - return await clerkUser.createPasskey(); - } catch (e: any) { - console.error(e.clerkError ? e.errors[0].longMessage : e.message); - } - }; - - return ( - - - Create passkey - - { - auth.signOut(); - }} - > - Sign out - - {clerkUser && ( - - - User with id {clerkUser.id} and Username{' '} - {clerkUser.primaryEmailAddress?.toString()} is logged in{' '} - - - )} - - ); -}; - -const PublicView = () => { - const { signIn, setActive, isLoaded } = useSignIn(); - - const [emailAddress, setEmailAddress] = React.useState(''); - const [password, setPassword] = React.useState(''); - - const handlePasswordSignIn = async () => { - if (!isLoaded) { - return; - } - try { - const signInResponse = await signIn.create({ - identifier: emailAddress, - password, - }); - await setActive({ session: signInResponse.createdSessionId }); - } catch (err: any) { - console.error(err.clerkError ? err.errors[0].longMessage : err); - } - }; - - const handlePasskeySignIn = async () => { - if (!isLoaded) { - return; - } - try { - const signInResponse = await signIn.authenticateWithPasskey({ - flow: 'discoverable', - }); - await setActive({ session: signInResponse.createdSessionId }); - } catch (err: any) { - console.error(`With code${err.code}, and message ${err.message}`); - } - }; - - return ( - - - setEmailAddress(emailAddress)} - /> - - - - setPassword(password)} - /> - - - - Sign in - - - - Sign in with passkey - - - ); -}; - -export default function App() { - const publishableKey = process.env.EXPO_PUBLIC_CLERK_PUBLISHABLE_KEY!; - - return ( - - - - - - - - - - - ); -} - -const styles = StyleSheet.create({ - container: { - flex: 1, - backgroundColor: '#fff', - alignItems: 'center', - justifyContent: 'center', - }, - protectedContainer: { - gap: 12, - flex: 1, - justifyContent: 'center', - backgroundColor: '#1D3D47', - padding: 20, - }, - publicContainer: { - marginTop: 100, - marginLeft: 10, - gap: 15, - }, - input: { - // Add input styles - }, - userInfo: { - color: 'cyan', - }, - italic: { - fontStyle: 'italic', - }, -}); diff --git a/playground/expo/README.md b/playground/expo/README.md deleted file mode 100644 index c55113409ef..00000000000 --- a/playground/expo/README.md +++ /dev/null @@ -1,76 +0,0 @@ -# Running the Example Project with Clerk on Your iOS Simulator or Device - -## Prerequisites - -- Ensure you have Xcode installed and access to an Apple Developer Account. - -## Steps - -### Initiate project -In the project root, run: - -```bash - pnpm install -``` -```bash - cp app.json.example app.json -``` - -### Configure app.json - -Replace the following placeholder with your configs - -- ${YOUR_BUNDLE_IDENTIFIER} -- ${PACKAGE_NAME} - -If you don't want to test passkeys remove the `associatedDomains` and `intentFilters`. - - -### Set Up Environment Variables - -Add the `EXPO_PUBLIC_CLERK_PUBLISHABLE_KEY` to the `.env`. - - -### Prebuild the Project - -```bash - pnpm expo prebuild --clean -``` - -### Run the Project - -```bash - pnpm run ios -``` - -Or - -```bash - pnpm run android -``` - -### Troubleshooting - -If you get the following error `Error: TreeFS: Could not add directory node_modules`, -terminate the ios or android emulator and run again `npm i` - -## Testing the Passkey Feature - -### Configure Associated Domains for iOS - -1. Log into your Clerk Dashboard, open the Native applications, and, for testing purposes, consider using a development instance. -2. Set up your Associated Domains. To do this, you'll need: - - An Apple Developer account - - Your App ID Prefix and Bundle ID, available at Apple's Developer portal -3. In `app.json`, replace the `associatedDomains` entry with the front-end API domain provided by Clerk (e.g., `coyote-6.clerk.accounts.dev`). -4. Also update the `bundleIdentifier` in `app.json` to match your Bundle ID from the Apple Developer portal. - -### How to use the passkeys - -1. Go to your Clerk Dashboard and enable Passkeys in the Email, Phone, Username settings. -2. Create a user in the Users tab on the dashboard, using email and password as the authentication attributes. -3. Open the app on your device or simulator, sign in with the user you just created. -4. After signing in, select the option to Create a Passkey and follow the prompts to register your passkey. -5. Sign out, and on the login screen, choose the Sign in with Passkey option to test the feature. - - diff --git a/playground/expo/app.json.example b/playground/expo/app.json.example deleted file mode 100644 index 6135e8cc0b4..00000000000 --- a/playground/expo/app.json.example +++ /dev/null @@ -1,38 +0,0 @@ -{ - "expo": { - "name": "clerk-expo-passkeys-example", - "slug": "clerk-expo-passkeys-example", - "version": "1.0.0", - "orientation": "portrait", - "userInterfaceStyle": "light", - "splash": { - "resizeMode": "contain", - "backgroundColor": "#ffffff" - }, - "ios": { - "supportsTablet": true, - "bundleIdentifier": "${YOUR_BUNDLE_IDENTIFIER}", - "associatedDomains": ["applinks:${YOUR_DOMAIN}", "webcredentials:${YOUR_DOMAIN}"] - }, - "android": { - "adaptiveIcon": { - "backgroundColor": "#ffffff", - "compileSdkVersion": 35 - }, - "package": "${PACKAGE_NAME}", - "intentFilters": [ - { - "action": "VIEW", - "autoVerify": true, - "data": [ - { - "scheme": "https", - "host": "${YOUR_DOMAIN}" - } - ], - "category": ["BROWSABLE", "DEFAULT"] - } - ] - } - } -} diff --git a/playground/expo/babel.config.js b/playground/expo/babel.config.js deleted file mode 100644 index 9d89e131194..00000000000 --- a/playground/expo/babel.config.js +++ /dev/null @@ -1,6 +0,0 @@ -module.exports = function (api) { - api.cache(true); - return { - presets: ['babel-preset-expo'], - }; -}; diff --git a/playground/expo/metro.config.js b/playground/expo/metro.config.js deleted file mode 100644 index e5b4587e5d0..00000000000 --- a/playground/expo/metro.config.js +++ /dev/null @@ -1,35 +0,0 @@ -// Learn more https://docs.expo.io/guides/customizing-metro -const { getDefaultConfig } = require('expo/metro-config'); -const path = require('path'); - -const config = getDefaultConfig(__dirname); - -// npm v7+ will install ../node_modules/react and ../node_modules/react-native because of peerDependencies. -// To prevent the incompatible react-native between ./node_modules/react-native and ../node_modules/react-native, -// excludes the one from the parent folder when bundling. -config.resolver.blockList = [ - ...Array.from(config.resolver.blockList ?? []), - new RegExp(path.resolve('..', 'node_modules', 'react')), - new RegExp(path.resolve('..', 'node_modules', 'react-native')), -]; - -config.resolver.nodeModulesPaths = [ - path.resolve(__dirname, './node_modules'), - - path.resolve(__dirname, '../node_modules'), -]; - -config.resolver.extraNodeModules = { - 'expo-passkeys': '..', -}; - -config.watchFolders = [path.resolve(__dirname, '..')]; - -config.transformer.getTransformOptions = async () => ({ - transform: { - experimentalImportSupport: false, - inlineRequires: true, - }, -}); - -module.exports = config; diff --git a/playground/expo/package.json b/playground/expo/package.json deleted file mode 100644 index 639414318de..00000000000 --- a/playground/expo/package.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "name": "expo-passkeys-example", - "version": "1.0.0", - "private": true, - "main": "expo/AppEntry.js", - "scripts": { - "android": "expo run:android", - "ios": "expo run:ios", - "start": "expo start", - "web": "expo start --web", - "expo:update": "pnpm expo install --fix" - }, - "dependencies": { - "@clerk/expo": "workspace:*", - "@clerk/clerk-js": "workspace:*", - "@clerk/react": "workspace:*", - "@clerk/expo-passkeys": "workspace:*", - "@clerk/shared": "workspace:*", - "@clerk/types": "workspace:*", - "@expo/metro-runtime": "~3.2.3", - "@react-native-async-storage/async-storage": "1.23.1", - "expo": "~51.0.39", - "expo-auth-session": "^5.5.2", - "expo-build-properties": "^0.12.5", - "expo-secure-store": "^13.0.2", - "expo-web-browser": "^13.0.3", - "react": "18.3.1", - "react-native": "~0.75.0", - "react-native-web": "~0.19.10", - "react-native-reanimated": "~3.15.0", - "react-native-gesture-handler": "~2.18.1", - "react-native-screens": "~3.34.0" - }, - "devDependencies": { - "@babel/core": "^7.20.0", - "@types/react": "~18.2.45", - "typescript": "~5.3.3" - } -} diff --git a/playground/expo/tsconfig.json b/playground/expo/tsconfig.json deleted file mode 100644 index f7fbd097941..00000000000 --- a/playground/expo/tsconfig.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "extends": "expo/tsconfig.base", - "compilerOptions": { - "strict": true, - "paths": { - "expo-passkeys": ["../src/index"], - "expo-passkeys/*": ["../src/*"] - } - } -} diff --git a/playground/expo/webpack.config.js b/playground/expo/webpack.config.js deleted file mode 100644 index 8c3a4228574..00000000000 --- a/playground/expo/webpack.config.js +++ /dev/null @@ -1,17 +0,0 @@ -const createConfigAsync = require('@expo/webpack-config'); -const path = require('path'); - -module.exports = async (env, argv) => { - const config = await createConfigAsync( - { - ...env, - babel: { - dangerouslyAddModulePathsToTranspile: ['expo-passkeys'], - }, - }, - argv, - ); - config.resolve.modules = [path.resolve(__dirname, './node_modules'), path.resolve(__dirname, '../node_modules')]; - - return config; -}; diff --git a/playground/express/.env.sample b/playground/express/.env.sample deleted file mode 100644 index 6c916523188..00000000000 --- a/playground/express/.env.sample +++ /dev/null @@ -1,2 +0,0 @@ -CLERK_PUBLISHABLE_KEY=pk_test_************* -CLERK_SECRET_KEY=sk_test_************* diff --git a/playground/express/.gitignore b/playground/express/.gitignore deleted file mode 100644 index 5280f758c35..00000000000 --- a/playground/express/.gitignore +++ /dev/null @@ -1,35 +0,0 @@ -# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. - -# dependencies -/node_modules -/.pnp -.pnp.js - -# testing -/coverage - -# next.js -/.next/ -/out/ - -# production -/build - -# misc -.DS_Store -*.pem - -# debug -npm-debug.log* -yarn-debug.log* -yarn-error.log* -.pnpm-debug.log* - -# local env files -.env - -# vercel -.vercel - -# typescript -*.tsbuildinfo diff --git a/playground/express/README.md b/playground/express/README.md deleted file mode 100644 index fad18de14c2..00000000000 --- a/playground/express/README.md +++ /dev/null @@ -1,31 +0,0 @@ -## Setup development - -Execute in root folder: - -```bash -pnpm i -pnpm build -``` - -Execute in current folder: - -```bash -touch .env # set PUBLISHABLE_KEY, SECRET_KEY and JWT_KEY from Clerk Dashboard API keys -npm i -``` - -If you need to test local package changes, use pkglab to publish packages locally. - -## Getting Started - -First, run the development server: - -```bash -npm start -``` - -Open [http://localhost:3000](http://localhost:3000) with your browser to see the result. - -## Reload changes from packages/\* package - -Apply change in packages/\* project folder and run `pnpm build`. Then restart Express server by killing the current and executing `npm start` and the change should be visible. diff --git a/playground/express/package.json b/playground/express/package.json deleted file mode 100644 index ff99d9e6ab0..00000000000 --- a/playground/express/package.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "name": "@playground/express", - "version": "0.1.0", - "private": true, - "scripts": { - "start": "ts-node ./src/server.ts" - }, - "author": "", - "license": "ISC", - "dependencies": { - "@clerk/backend": "workspace:*", - "@clerk/express": "workspace:*", - "@clerk/shared": "workspace:*", - "@clerk/types": "workspace:*", - "dotenv": "^16.0.3", - "ejs": "^3.1.6", - "express": "^4.21.0", - "ts-node": "^10.9.1" - }, - "devDependencies": { - "@types/express": "^4.17.21", - "@types/node": "^18.17", - "eslint": "8.24.0", - "tslib": "^2.5.0", - "typescript": "4.8.4" - } -} diff --git a/playground/express/src/loadEnv.ts b/playground/express/src/loadEnv.ts deleted file mode 100644 index 5b5d1facc93..00000000000 --- a/playground/express/src/loadEnv.ts +++ /dev/null @@ -1,2 +0,0 @@ -import * as dotenv from 'dotenv'; -dotenv.config(); diff --git a/playground/express/src/routes/index.ts b/playground/express/src/routes/index.ts deleted file mode 100644 index 899775555c6..00000000000 --- a/playground/express/src/routes/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { privateRoutes } from './private'; -export { publicRoutes } from './public'; diff --git a/playground/express/src/routes/private.ts b/playground/express/src/routes/private.ts deleted file mode 100644 index 8164041a223..00000000000 --- a/playground/express/src/routes/private.ts +++ /dev/null @@ -1,39 +0,0 @@ -import { getAuth, requireAuth, UnauthorizedError, ForbiddenError } from '@clerk/express'; -import { - Router, - Request as ExpressRequest, - Response as ExpressResponse, - NextFunction -} from 'express'; - -const router = Router(); - -router.use(requireAuth); - -router.get('/me', async (req: ExpressRequest, res: ExpressResponse) => { - return res.json({ auth: getAuth(req) }); -}); - -router.get('/admin-only', async (req: ExpressRequest, res: ExpressResponse, next: NextFunction) => { - const auth = getAuth(req); - - if (!auth.has({ role: 'admin' })) { - return next(new ForbiddenError()); - } - - return res.json({ message: 'Hello admin!', auth }); -}) - -router.use((err: Error, _req: ExpressRequest, res: ExpressResponse, next: NextFunction) => { - if (err instanceof UnauthorizedError) { - return res.status(401).json({ error: 'Unauthorized' }); - } - - if (err instanceof ForbiddenError) { - return res.status(403).json({ error: 'Forbidden' }); - } - - return next(err) -}) - -export const privateRoutes = router; diff --git a/playground/express/src/routes/public.ts b/playground/express/src/routes/public.ts deleted file mode 100644 index fe4c62486ac..00000000000 --- a/playground/express/src/routes/public.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { Router, RequestHandler} from 'express'; - -const router = Router(); - -router.get('/public', async (_req, reply) => { - return reply.json({ hello: 'world' }); -}); - -const homeHandler: RequestHandler = function (_req, res) { - return res.render('home.ejs', { - publishableKey: process.env.CLERK_PUBLISHABLE_KEY, - domain: process.env.CLERK_DOMAIN, - isSatellite: process.env.CLERK_IS_SATELLITE, - signInUrl: process.env.CLERK_SIGN_IN_URL, - }); -}; - -router.get('/home', homeHandler); -router.get('/', homeHandler); - -export const publicRoutes = router; diff --git a/playground/express/src/server.ts b/playground/express/src/server.ts deleted file mode 100644 index c9efee78acc..00000000000 --- a/playground/express/src/server.ts +++ /dev/null @@ -1,27 +0,0 @@ -import type { Application, Request, Response, NextFunction } from 'express'; - -import { clerkMiddleware } from '@clerk/express'; -import * as express from 'express'; -import { privateRoutes, publicRoutes } from './routes'; - -import './loadEnv'; - -const port = process.env.PORT || 3000; -const app: Application = express(); - -app.set('view engine', 'ejs'); -app.set('views', 'src/views'); - -app.use(clerkMiddleware()); - -app.use(publicRoutes); -app.use(privateRoutes); - -app.use((err: Error, _req: Request, res: Response, _next: NextFunction) => { - console.error(err.stack); - res.status(401).send('Unauthenticated!'); -}); - -app.listen(port, () => { - console.log(`Example app listening at http://localhost:${port}`); -}); diff --git a/playground/express/src/views/home.ejs b/playground/express/src/views/home.ejs deleted file mode 100644 index 7fe10c1bcc7..00000000000 --- a/playground/express/src/views/home.ejs +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - diff --git a/playground/express/tsconfig.json b/playground/express/tsconfig.json deleted file mode 100644 index 064ad8da546..00000000000 --- a/playground/express/tsconfig.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "compilerOptions": { - "baseUrl": "", - "moduleResolution": "NodeNext" - }, - "exclude": ["node_modules", "tmp", "dist"], - "extends": "../../tsconfig.json" -} diff --git a/playground/fastify/.env.sample b/playground/fastify/.env.sample deleted file mode 100644 index 1886a694541..00000000000 --- a/playground/fastify/.env.sample +++ /dev/null @@ -1,4 +0,0 @@ -CLERK_PUBLISHABLE_KEY= -CLERK_SECRET_KEY= -PUBLIC_CLERK_SIGN_IN_URL=/sign-in -FRONTEND_API_URL= diff --git a/playground/fastify/.gitignore b/playground/fastify/.gitignore deleted file mode 100644 index 5280f758c35..00000000000 --- a/playground/fastify/.gitignore +++ /dev/null @@ -1,35 +0,0 @@ -# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. - -# dependencies -/node_modules -/.pnp -.pnp.js - -# testing -/coverage - -# next.js -/.next/ -/out/ - -# production -/build - -# misc -.DS_Store -*.pem - -# debug -npm-debug.log* -yarn-debug.log* -yarn-error.log* -.pnpm-debug.log* - -# local env files -.env - -# vercel -.vercel - -# typescript -*.tsbuildinfo diff --git a/playground/fastify/README.md b/playground/fastify/README.md deleted file mode 100644 index 248dac4e79a..00000000000 --- a/playground/fastify/README.md +++ /dev/null @@ -1,26 +0,0 @@ -# playground-fastify - -Use this example app to test `@clerk/fastify`. - -## Usage - -1. Install dependencies - -```shell -npm install -``` - -1. Use [`@clerk/dev-cli`](https://github.com/clerk/javascript/tree/main/packages/dev-cli) to build all repository packages and install the local version into this playground. - -1. Start the server: - -```shell -pnpm start -``` - -You can visit these routes: - -- `/` -- `/sign-in` -- `/me` (requires sign-in) -- `/private` (requires sign-in) \ No newline at end of file diff --git a/playground/fastify/package.json b/playground/fastify/package.json deleted file mode 100644 index 800c5457569..00000000000 --- a/playground/fastify/package.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "name": "@playground/fastify", - "version": "0.1.0", - "private": true, - "scripts": { - "start": "ts-node ./src/server.ts" - }, - "dependencies": { - "@clerk/backend": "workspace:*", - "@clerk/fastify": "workspace:*", - "@clerk/shared": "workspace:*", - "@clerk/types": "workspace:*", - "@fastify/view": "^10.0.1", - "dotenv": "^16.4.5", - "ejs": "^3.1.10", - "fastify": "^5.0.0", - "ts-node": "^10.9.2" - }, - "devDependencies": { - "@types/ejs": "^3.1.5", - "@types/node": "^20.14.8", - "tslib": "^2.7.0", - "typescript": "5.0.4" - } -} diff --git a/playground/fastify/src/loadEnv.ts b/playground/fastify/src/loadEnv.ts deleted file mode 100644 index a4e52bbebb9..00000000000 --- a/playground/fastify/src/loadEnv.ts +++ /dev/null @@ -1,2 +0,0 @@ -import * as dotenv from 'dotenv'; -dotenv.config({ path: ['.env.local', '.env.production', '.env'] }); diff --git a/playground/fastify/src/routes/index.ts b/playground/fastify/src/routes/index.ts deleted file mode 100644 index 9db6a0dd54d..00000000000 --- a/playground/fastify/src/routes/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './private'; -export * from './public'; diff --git a/playground/fastify/src/routes/private.ts b/playground/fastify/src/routes/private.ts deleted file mode 100644 index d2bbeb94013..00000000000 --- a/playground/fastify/src/routes/private.ts +++ /dev/null @@ -1,20 +0,0 @@ -import type { FastifyReply, FastifyRequest, FastifyInstance } from 'fastify'; -import { clerkPlugin, getAuth } from '@clerk/fastify'; - -export const privateRoutes = async (fastify: FastifyInstance, _opts: any) => { - fastify.register(clerkPlugin); - - fastify.get('/me', async (req, _reply) => { - return { auth: getAuth(req) }; - }); - - fastify.get('/private', async (req: FastifyRequest, reply: FastifyReply) => { - const auth = getAuth(req); - - if (!auth.userId) { - return reply.code(403).send(); - } - - return { hello: 'world', auth }; - }); -}; diff --git a/playground/fastify/src/routes/public.ts b/playground/fastify/src/routes/public.ts deleted file mode 100644 index cfefc2246e8..00000000000 --- a/playground/fastify/src/routes/public.ts +++ /dev/null @@ -1,15 +0,0 @@ -import type { FastifyInstance } from 'fastify'; - -export const publicRoutes = async (fastify: FastifyInstance, _opts: any) => { - fastify.get('/', async (_req, _reply) => { - return { hello: 'world' }; - }); - - fastify.get('/sign-in', async (_req, reply) => { - return reply.viewAsync('/src/templates/sign-in.ejs', { - CLERK_PUBLISHABLE_KEY: process.env.CLERK_PUBLISHABLE_KEY, - PUBLIC_CLERK_SIGN_IN_URL: process.env.PUBLIC_CLERK_SIGN_IN_URL, - FRONTEND_API_URL: process.env.FRONTEND_API_URL, - }); - }); -}; diff --git a/playground/fastify/src/server.ts b/playground/fastify/src/server.ts deleted file mode 100644 index 59a0f8d26a6..00000000000 --- a/playground/fastify/src/server.ts +++ /dev/null @@ -1,28 +0,0 @@ -import './loadEnv'; - -import Fastify from 'fastify'; -import type { FastifyInstance } from 'fastify'; -import { privateRoutes, publicRoutes } from './routes'; -import FastifyView from '@fastify/view'; -import * as ejs from 'ejs'; - -const server: FastifyInstance = Fastify({ logger: true }); - -// ejs view engine to render templates -server.register(FastifyView, { engine: { ejs } }); - -// private routes (with clerkPlugin) -server.register(privateRoutes); - -// public routes (without clerkPlugin) -server.register(publicRoutes); - -const start = async () => { - try { - await server.listen({ port: 3000 }); - } catch (err) { - server.log.error(err); - process.exit(1); - } -}; -start(); diff --git a/playground/fastify/src/templates/sign-in.ejs b/playground/fastify/src/templates/sign-in.ejs deleted file mode 100644 index f1e1be4eb30..00000000000 --- a/playground/fastify/src/templates/sign-in.ejs +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - diff --git a/playground/fastify/tsconfig.json b/playground/fastify/tsconfig.json deleted file mode 100644 index 6702ef852d4..00000000000 --- a/playground/fastify/tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "baseUrl": "" - }, - "exclude": ["node_modules", "tmp", "dist"], - "extends": "../../tsconfig.json" -} diff --git a/playground/nextjs/.env.example b/playground/nextjs/.env.example deleted file mode 100644 index 923c9b7e0a7..00000000000 --- a/playground/nextjs/.env.example +++ /dev/null @@ -1,6 +0,0 @@ -NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_test_ -CLERK_SECRET_KEY=sk_test_ -NEXT_PUBLIC_CLERK_SIGN_IN_URL=/sign-in -NEXT_PUBLIC_CLERK_SIGN_UP_URL=/sign-up -NEXT_PUBLIC_CLERK_AFTER_SIGN_IN_URL=/ -NEXT_PUBLIC_CLERK_AFTER_SIGN_UP_URL=/ \ No newline at end of file diff --git a/playground/nextjs/.gitignore b/playground/nextjs/.gitignore deleted file mode 100644 index c87c9b392c0..00000000000 --- a/playground/nextjs/.gitignore +++ /dev/null @@ -1,36 +0,0 @@ -# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. - -# dependencies -/node_modules -/.pnp -.pnp.js - -# testing -/coverage - -# next.js -/.next/ -/out/ - -# production -/build - -# misc -.DS_Store -*.pem - -# debug -npm-debug.log* -yarn-debug.log* -yarn-error.log* -.pnpm-debug.log* - -# local env files -.env*.local - -# vercel -.vercel - -# typescript -*.tsbuildinfo -next-env.d.ts diff --git a/playground/nextjs/.vscode/settings.json b/playground/nextjs/.vscode/settings.json deleted file mode 100644 index d0679104bda..00000000000 --- a/playground/nextjs/.vscode/settings.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "typescript.tsdk": "node_modules/typescript/lib", - "typescript.enablePromptUseWorkspaceTsdk": true -} \ No newline at end of file diff --git a/playground/nextjs/README.md b/playground/nextjs/README.md deleted file mode 100644 index 30b04287633..00000000000 --- a/playground/nextjs/README.md +++ /dev/null @@ -1,50 +0,0 @@ -This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app). - -## Setup - -At repository level: - -```bash -pnpm build -``` - -At current directory level: - -```bash -npm i -``` - -## Run development server - -```bash -pnpm dev -# or -yarn dev -``` - -This starts your app in development mode, rebuilding assets on file changes. - -## Getting Started - -Open [http://localhost:3000](http://localhost:3000) with your browser to see the result. - -You can start editing the page by modifying `pages/index.tsx`. The page auto-updates as you edit the file. - -[API routes](https://nextjs.org/docs/api-routes/introduction) can be accessed on [http://localhost:3000/api/hello](http://localhost:3000/api/hello). This endpoint can be edited in `pages/api/hello.ts`. - -The `pages/api` directory is mapped to `/api/*`. Files in this directory are treated as [API routes](https://nextjs.org/docs/api-routes/introduction) instead of React pages. - -## Learn More - -To learn more about Next.js, take a look at the following resources: - -- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API. -- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial. - -You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome! - -## Deploy on Vercel - -The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js. - -Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details. diff --git a/playground/nextjs/app/api/route.ts b/playground/nextjs/app/api/route.ts deleted file mode 100644 index e8c1f790c8c..00000000000 --- a/playground/nextjs/app/api/route.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { NextResponse } from 'next/server'; - -export async function GET() { - return NextResponse.json({}); -} - -export const revalidate = 50; diff --git a/playground/nextjs/app/app-dir/client-component.tsx b/playground/nextjs/app/app-dir/client-component.tsx deleted file mode 100644 index cc286b6ebb1..00000000000 --- a/playground/nextjs/app/app-dir/client-component.tsx +++ /dev/null @@ -1,11 +0,0 @@ -'use client'; - -import React from 'react'; -import { isClerkAPIResponseError, isEmailLinkError, isKnownError, isMetamaskError } from '@clerk/nextjs/errors'; - -export const ClientComponent = () => { - React.useEffect(() => { - console.log({ isClerkAPIResponseError, isEmailLinkError, isKnownError, isMetamaskError }); - }); - return
Client Component
; -}; diff --git a/playground/nextjs/app/app-dir/client/page.tsx b/playground/nextjs/app/app-dir/client/page.tsx deleted file mode 100644 index a3853dfefcd..00000000000 --- a/playground/nextjs/app/app-dir/client/page.tsx +++ /dev/null @@ -1,11 +0,0 @@ -'use client'; -import { Show } from '@clerk/nextjs'; - -export default function Page() { - return ( -
- Hello In - Hello Out -
- ); -} diff --git a/playground/nextjs/app/app-dir/create-organization/page.tsx b/playground/nextjs/app/app-dir/create-organization/page.tsx deleted file mode 100644 index 11b0f33fa32..00000000000 --- a/playground/nextjs/app/app-dir/create-organization/page.tsx +++ /dev/null @@ -1,5 +0,0 @@ -import { CreateOrganization } from '@clerk/nextjs'; - -export default function Page() { - return ; -} diff --git a/playground/nextjs/app/app-dir/discover/page.tsx b/playground/nextjs/app/app-dir/discover/page.tsx deleted file mode 100644 index f5594685216..00000000000 --- a/playground/nextjs/app/app-dir/discover/page.tsx +++ /dev/null @@ -1,10 +0,0 @@ -import { OrganizationList } from '@clerk/nextjs'; - -export default function Page() { - return ( - - ); -} diff --git a/playground/nextjs/app/app-dir/organization/page.tsx b/playground/nextjs/app/app-dir/organization/page.tsx deleted file mode 100644 index 89185e27612..00000000000 --- a/playground/nextjs/app/app-dir/organization/page.tsx +++ /dev/null @@ -1,10 +0,0 @@ -import { OrganizationProfile, OrganizationSwitcher } from '@clerk/nextjs'; - -export default function Page() { - return ( -
- - -
- ); -} diff --git a/playground/nextjs/app/app-dir/page.tsx b/playground/nextjs/app/app-dir/page.tsx deleted file mode 100644 index 244c6050d92..00000000000 --- a/playground/nextjs/app/app-dir/page.tsx +++ /dev/null @@ -1,51 +0,0 @@ -import { OrganizationSwitcher, Show, SignIn, UserButton } from '@clerk/nextjs'; -import { auth, clerkClient, currentUser } from '@clerk/nextjs/server'; -import Link from 'next/link'; - -export default async function Page() { - const { userId } = await auth(); - const currentUser_ = await currentUser(); - const user = userId ? await (await clerkClient()).users.getUser(userId) : null; - - return ( -
-
    -
  • - Sign in page -
  • -
  • - Sign up page -
  • -
  • - User profile page -
  • -
  • - User examples -
  • -
-
-

Hello, Next.js!

- {userId ?

Signed in as: {userId}

:

Signed out

} - {/* @ts-ignore */} - - - -
{JSON.stringify(user)}
-
{JSON.stringify(currentUser_)}
-
- {/* @ts-ignore */} - - - -
-
- ); -} diff --git a/playground/nextjs/app/app-dir/sign-in/page.tsx b/playground/nextjs/app/app-dir/sign-in/page.tsx deleted file mode 100644 index a4b5ade423d..00000000000 --- a/playground/nextjs/app/app-dir/sign-in/page.tsx +++ /dev/null @@ -1,11 +0,0 @@ -import { SignIn } from '@clerk/nextjs'; - -export default function Page() { - return ( - - ); -} diff --git a/playground/nextjs/app/app-dir/sign-up/page.tsx b/playground/nextjs/app/app-dir/sign-up/page.tsx deleted file mode 100644 index d40d7e4c74f..00000000000 --- a/playground/nextjs/app/app-dir/sign-up/page.tsx +++ /dev/null @@ -1,11 +0,0 @@ -import { SignUp } from '@clerk/nextjs'; - -export default function Page() { - return ( - - ); -} diff --git a/playground/nextjs/app/app-dir/user/page.tsx b/playground/nextjs/app/app-dir/user/page.tsx deleted file mode 100644 index 51856dc1d8f..00000000000 --- a/playground/nextjs/app/app-dir/user/page.tsx +++ /dev/null @@ -1,5 +0,0 @@ -import { UserProfile } from '@clerk/nextjs'; - -export default function Page() { - return ; -} diff --git a/playground/nextjs/app/layout.tsx b/playground/nextjs/app/layout.tsx deleted file mode 100644 index 5d37631f682..00000000000 --- a/playground/nextjs/app/layout.tsx +++ /dev/null @@ -1,19 +0,0 @@ -import type { Metadata } from 'next'; -import React from 'react'; -import { ClerkProvider } from '@clerk/nextjs'; - -export const metadata: Metadata = { - title: 'Next.js 13 with Clerk', -}; -export default function RootLayout({ children }: { children: React.ReactNode }) { - return ( - <> - {/* @ts-ignore */} - - - {children} - - - - ); -} diff --git a/playground/nextjs/middleware.ts b/playground/nextjs/middleware.ts deleted file mode 100644 index cf79854ca19..00000000000 --- a/playground/nextjs/middleware.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { clerkMiddleware } from '@clerk/nextjs/server'; - -export default clerkMiddleware(); - -export const config = { - matcher: ['/((?!.+\\.[\\w]+$|_next).*)', '/', '/(api|trpc)(.*)'], -}; diff --git a/playground/nextjs/next.config.js b/playground/nextjs/next.config.js deleted file mode 100644 index aab0bc034af..00000000000 --- a/playground/nextjs/next.config.js +++ /dev/null @@ -1,17 +0,0 @@ -/** @type {import('next').NextConfig} */ -const nextConfig = { - reactStrictMode: true, - swcMinify: true, - // Configure webpack NOT to ignore node_modules changes for HMR - webpack: config => { - config.snapshot = { - ...(config.snapshot ?? {}), - // Add all node_modules but @next module to managedPaths - // Allows for hot refresh of changes to @next module - managedPaths: [/^(.+?[\\/]node_modules[\\/])(?!@next)/], - }; - return config; - }, -}; - -module.exports = nextConfig; diff --git a/playground/nextjs/package.json b/playground/nextjs/package.json deleted file mode 100644 index 20c306f7efd..00000000000 --- a/playground/nextjs/package.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "name": "@playground/nextjs", - "version": "0.1.0", - "private": true, - "scripts": { - "dev": "rm -rf .next && next dev --port 4011", - "build": "next build", - "start": "next start", - "lint": "next lint" - }, - "dependencies": { - "@clerk/nextjs": "canary", - "@clerk/ui": "canary", - "@clerk/types": "canary", - "next": "^15.5.15", - "react": "^19.1.1", - "react-dom": "^19.1.1" - }, - "devDependencies": { - "@types/node": "18.8.3", - "@types/react": "19.1.10", - "@types/react-dom": "19.1.7", - "eslint": "9.31.0", - "eslint-config-next": "15.5.0", - "typescript": "5.8.3" - }, - "packageManager": "pnpm@10.16.1" -} diff --git a/playground/nextjs/pages/_app.tsx b/playground/nextjs/pages/_app.tsx deleted file mode 100644 index e3e34c87001..00000000000 --- a/playground/nextjs/pages/_app.tsx +++ /dev/null @@ -1,170 +0,0 @@ -import type { AppProps } from 'next/app'; -import '../styles/globals.css'; - -import { - ClerkProvider, - OrganizationSwitcher, - Show, - SignInButton, - SignOutButton, - UserButton, -} from '@clerk/nextjs'; -import { dark, __experimental_simple, neobrutalism, shadesOfPurple } from '@clerk/themes'; -import Link from 'next/link'; -import React, { FunctionComponent, useEffect, useState } from 'react'; - -const themes = { default: undefined, dark, neobrutalism, shadesOfPurple }; - -function MyApp({ Component, pageProps }: AppProps) { - const [selectedTheme, setSelectedTheme] = useState('default'); - const [selectedSmoothing, setSelectedSmoothing] = useState(true); - const [styleReset, setStyleReset] = useState(false); - const [animations, setAnimations] = useState(true); - const [primaryColor, setPrimaryColor] = useState(undefined); - const [disableDevMode, setDisableDevMode] = useState(false); - - const onToggleDark = () => { - if (window.document.body.classList.contains('dark-mode')) { - setSelectedTheme('default'); - window.document.body.classList.remove('dark-mode'); - } else { - setSelectedTheme('dark'); - window.document.body.classList.add('dark-mode'); - } - }; - - const onToggleAnimations = () => { - setAnimations(s => !s); - }; - - const onToggleDevMode = () => { - setDisableDevMode(s => !s); - } - - const onToggleSmooth = () => { - if (window.document.body.classList.contains('font-smoothing')) { - setSelectedSmoothing(false); - window.document.body.classList.remove('font-smoothing'); - } else { - setSelectedSmoothing(true); - window.document.body.classList.add('font-smoothing'); - } - }; - - useEffect(() => { - window.document.body.classList.add('font-smoothing'); - }, []); - - const C = Component as FunctionComponent; - - return ( - <> - {/* @ts-ignore */} - - setSelectedTheme(e.target.value as any)} - onToggleDark={onToggleDark} - onToggleSmooth={onToggleSmooth} - onResetStyles={() => setStyleReset(s => !s)} - onToggleAnimations={onToggleAnimations} - devMode={disableDevMode} - onToggleDevMode={onToggleDevMode} - animations={animations} - styleReset={styleReset} - smooth={selectedSmoothing} - onPrimaryColorChange={setPrimaryColor} - /> - - - - ); -} - -type AppBarProps = { - onChangeTheme: React.ChangeEventHandler; - onToggleDark: React.MouseEventHandler; - onToggleSmooth: React.MouseEventHandler; - onResetStyles: React.MouseEventHandler; - onToggleAnimations: React.MouseEventHandler; - onToggleDevMode: React.MouseEventHandler; - smooth: boolean; - styleReset: boolean; - animations: boolean; - devMode: boolean; - onPrimaryColorChange: (primaryColor: string | undefined) => void; -}; - -const AppBar = (props: AppBarProps) => { - return ( -
- - - - -

Nextjs Playground

- - - - -
- - - -
- props.onPrimaryColorChange(e.target.value)} - /> - - - {/* @ts-ignore */} - - - - - {/* @ts-ignore */} - - - -
- ); -}; - -export default MyApp; diff --git a/playground/nextjs/pages/api/hello-edge.ts b/playground/nextjs/pages/api/hello-edge.ts deleted file mode 100644 index 46366127750..00000000000 --- a/playground/nextjs/pages/api/hello-edge.ts +++ /dev/null @@ -1,23 +0,0 @@ -import type { NextRequest } from 'next/server'; -import { getAuth } from '@clerk/nextjs/server'; - -export const config = { - runtime: 'edge', -}; - -export default async function handler(req: NextRequest) { - // @ts-ignore - const { userId } = getAuth(req); - - return new Response( - JSON.stringify({ - userId, - }), - { - status: 200, - headers: { - 'content-type': 'application/json', - }, - }, - ); -} diff --git a/playground/nextjs/pages/api/hello.ts b/playground/nextjs/pages/api/hello.ts deleted file mode 100644 index 21ec7c494ea..00000000000 --- a/playground/nextjs/pages/api/hello.ts +++ /dev/null @@ -1,11 +0,0 @@ -// Next.js API route support: https://nextjs.org/docs/api-routes/introduction -import type { NextApiRequest, NextApiResponse } from 'next'; -import { getAuth } from '@clerk/nextjs/server'; - -export default function handler(req: NextApiRequest, res: NextApiResponse) { - const { userId, debug } = getAuth(req); - - console.log('hello:debug', debug()); - console.log('/api/hello ', userId, req.query); - res.status(200).json({ userId }); -} diff --git a/playground/nextjs/pages/create-organization/[[...index]].tsx b/playground/nextjs/pages/create-organization/[[...index]].tsx deleted file mode 100644 index 398c93b0d5b..00000000000 --- a/playground/nextjs/pages/create-organization/[[...index]].tsx +++ /dev/null @@ -1,14 +0,0 @@ -import { CreateOrganization } from '@clerk/nextjs'; -import type { NextPage } from 'next'; - -const CreateOrganizationPage: NextPage = () => { - return ( -
- -
- ); -}; - -export default CreateOrganizationPage; diff --git a/playground/nextjs/pages/custom/forgotPassword.tsx b/playground/nextjs/pages/custom/forgotPassword.tsx deleted file mode 100644 index 1f4d9555c28..00000000000 --- a/playground/nextjs/pages/custom/forgotPassword.tsx +++ /dev/null @@ -1,144 +0,0 @@ -import React, { SyntheticEvent, useState } from 'react'; -import { useSignIn } from '@clerk/nextjs'; -import type { NextPage } from 'next'; - -type PasswordState = 'neutral' | 'success' | 'warn' | 'fail'; -const colors: { [k in PasswordState]?: string } = { - fail: 'red', - success: 'green', - warn: 'orange', -}; - -const SignInPage: NextPage = () => { - const [email, setEmail] = useState(''); - const [password, setPassword] = useState(''); - const [code, setCode] = useState(''); - const [successfulCreation, setSuccessfulCreation] = useState(false); - const [complete, setComplete] = useState(false); - const [secondFactor, setSecondFactor] = useState(false); - const [passwordState, setPasswordState] = useState('neutral'); - - const { isLoaded, signIn, setActive } = useSignIn(); - - if (!isLoaded) { - return null; - } - - async function create(e: SyntheticEvent) { - e.preventDefault(); - await signIn - ?.create({ - strategy: 'reset_password_email_code', - identifier: email, - }) - .then(_ => { - setSuccessfulCreation(true); - }) - .catch(err => console.error('error', err.errors[0].longMessage)); - } - - async function reset(e: SyntheticEvent) { - e.preventDefault(); - await signIn - ?.attemptFirstFactor({ - strategy: 'reset_password_email_code', - code, - password, - }) - .then(result => { - if (result.status === 'needs_second_factor') { - setSecondFactor(true); - } else if (result.status === 'complete') { - setActive({ session: result.createdSessionId }); - setComplete(true); - } else { - console.log(result); - } - }) - .catch(err => console.error('error', err.errors[0].longMessage)); - } - - return ( -
-

Forgot Password ?

-
- {!successfulCreation && !complete && ( - <> - - setEmail(e.target.value)} - /> - - - - )} - - {successfulCreation && !complete && ( - <> - - { - signIn.validatePassword(e.target.value, { - onValidation(res) { - if (Object.values(res?.complexity || {}).length > 0) { - return setPasswordState('fail'); - } - - // Strength that fails - if (res?.strength?.state === 'fail') { - return setPasswordState('fail'); - } - - // Strength that can be better - if (res?.strength?.state === 'pass') { - return setPasswordState('warn'); - } - - // Perfection - return setPasswordState('success'); - }, - }); - setPassword(e.target.value); - }} - /> - - - setCode(e.target.value)} - /> - - - - )} - - {complete && 'You successfully changed you password'} - {secondFactor && '2FA is required, this UI does not handle that'} -
-
- ); -}; - -export default SignInPage; diff --git a/playground/nextjs/pages/discover/index.tsx b/playground/nextjs/pages/discover/index.tsx deleted file mode 100644 index e1100da5e0c..00000000000 --- a/playground/nextjs/pages/discover/index.tsx +++ /dev/null @@ -1,18 +0,0 @@ -import { OrganizationList } from '@clerk/nextjs'; -import type { NextPage } from 'next'; -import React from 'react'; - -const Discover: NextPage = () => { - return ( -
- -
- ); -}; - -export default Discover; diff --git a/playground/nextjs/pages/index.tsx b/playground/nextjs/pages/index.tsx deleted file mode 100644 index a259da9765a..00000000000 --- a/playground/nextjs/pages/index.tsx +++ /dev/null @@ -1,62 +0,0 @@ -import type { NextPage } from 'next'; -import Head from 'next/head'; -import Link from 'next/link'; -import styles from '../styles/Home.module.css'; - - -const Home: NextPage = () => { - return ( -
- - Create Next App - - - - -
-

Clerk x Nextjs

-

Get started by editing visiting one of the pages below

-
    -
  • - Sign in page -
  • -
  • - Sign up page -
  • -
  • - User profile page -
  • -
  • - Organization profile -
  • -
  • - Create organization -
  • -
  • - Organization List -
  • -
  • - Redirect helpers -
  • -
  • - Session Examples -
  • -
  • - User examples -
  • -
  • - Waitlist -
  • -
-
-
- ); -}; - -export default Home; diff --git a/playground/nextjs/pages/organization-list/[[...index]].tsx b/playground/nextjs/pages/organization-list/[[...index]].tsx deleted file mode 100644 index 624db62d924..00000000000 --- a/playground/nextjs/pages/organization-list/[[...index]].tsx +++ /dev/null @@ -1,14 +0,0 @@ -import { OrganizationList } from '@clerk/nextjs'; -import type { NextPage } from 'next'; - -const OrganizationListPage: NextPage = () => { - return ( -
- -
- ); -}; - -export default OrganizationListPage; diff --git a/playground/nextjs/pages/organization/[[...index]].tsx b/playground/nextjs/pages/organization/[[...index]].tsx deleted file mode 100644 index d758415f60f..00000000000 --- a/playground/nextjs/pages/organization/[[...index]].tsx +++ /dev/null @@ -1,15 +0,0 @@ -import { OrganizationProfile } from '@clerk/nextjs'; -import type { NextPage } from 'next'; -import React from 'react'; - -const OrganizationProfilePage: NextPage = () => { - return ( -
- -
- ); -}; - -export default OrganizationProfilePage; diff --git a/playground/nextjs/pages/redirect-helpers/index.tsx b/playground/nextjs/pages/redirect-helpers/index.tsx deleted file mode 100644 index 50a034795c9..00000000000 --- a/playground/nextjs/pages/redirect-helpers/index.tsx +++ /dev/null @@ -1,37 +0,0 @@ -import type { NextPage } from 'next'; -import React, { useState } from 'react'; -import * as allExports from '@clerk/nextjs'; - -const UserProfilePage: NextPage = () => { - const controlComponents = Object.fromEntries(Object.entries(allExports).filter(e => e[0].startsWith('RedirectTo'))); - - return ( -
- {Object.entries(controlComponents).map(entry => { - return ( - - ); - })} -
- ); -}; - -const RenderRedirectToggle = (props: any) => { - const [open, setOpen] = useState(false); - const { name, Component } = props; - - return ( -
- - {open && } -
- ); -}; - -export default UserProfilePage; diff --git a/playground/nextjs/pages/session-examples/index.tsx b/playground/nextjs/pages/session-examples/index.tsx deleted file mode 100644 index 09827464c4c..00000000000 --- a/playground/nextjs/pages/session-examples/index.tsx +++ /dev/null @@ -1,33 +0,0 @@ -import { useSession } from '@clerk/nextjs'; -import { PublicUserData } from '@clerk/types'; -import type { NextPage } from 'next'; -import React from 'react'; - -function Template({ publicUserData }: { publicUserData: PublicUserData | undefined }) { - return ( -
-

Public Metadata

-
{JSON.stringify(publicUserData, null, 4)}
-
- ); -} - -function PublicMetadataWithHook() { - // Use the useUser hook to get the Clerk.user object - // This hook causes a re-render on user changes - const { session } = useSession(); - - return