Skip to content

Commit

Permalink
remove script
Browse files Browse the repository at this point in the history
  • Loading branch information
victoriaxyz committed Nov 8, 2024
1 parent 99ccf10 commit f789165
Show file tree
Hide file tree
Showing 33 changed files with 21 additions and 3,722 deletions.
22 changes: 0 additions & 22 deletions docs/advanced-usage/using-proxies.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,6 @@ When using a proxy, all requests to the Frontend API will be made through your d
<Tab>
To configure your proxy setup using properties in your JavaScript application, pass the `proxyUrl` option to the [`load()`](/docs/references/javascript/clerk/clerk#load) method.

<CodeBlockTabs options={["NPM module", "<script>"]}>
```js {{ filename: 'main.js' }}
import { Clerk } from '@clerk/clerk-js'

Expand All @@ -296,27 +295,6 @@ When using a proxy, all requests to the Frontend API will be made through your d
proxyUrl: 'https://app.dev/__clerk',
})
```

```html {{ filename: 'index.html' }}
<!-- Initialize Clerk with your
Clerk Publishable key and Frontend API URL -->
<script
async
crossorigin="anonymous"
data-clerk-publishable-key="{{pub_key}}"
src="https://{{fapi_url}}/npm/@clerk/clerk-js@latest/dist/clerk.browser.js"
type="text/javascript"
></script>

<script>
window.addEventListener('load', async function () {
await Clerk.load({
proxyUrl: 'https://app.dev/__clerk',
})
})
</script>
```
</CodeBlockTabs>
</Tab>
</Tabs>

Expand Down
96 changes: 4 additions & 92 deletions docs/components/authentication/google-one-tap.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,8 @@ function openGoogleOneTap(params: GoogleOneTapProps): void

#### `openGoogleOneTap()` usage

<CodeBlockTabs options={['NPM module', '<script>']}>
```js {{ filename: 'index.js', mark: [[7, 12]] }}
import { Clerk } from '@clerk/clerk-js'
import { Clerk } from '@clerk/clerk-js'
// Initialize Clerk with your Clerk publishable key
const clerk = new Clerk('{{pub_key}}')
Expand All @@ -127,32 +126,7 @@ function openGoogleOneTap(params: GoogleOneTapProps): void
}
clerk.openGoogleOneTap(params)
```

```html {{ filename: 'index.html', mark: [[14, 19]] }}
<!-- Initialize Clerk with your
Clerk Publishable key and Frontend API URL -->
<script
async
crossorigin="anonymous"
data-clerk-publishable-key="{{pub_key}}"
src="https://{{fapi_url}}/npm/@clerk/clerk-js@latest/dist/clerk.browser.js"
type="text/javascript"
></script>

<script>
window.addEventListener('load', async function () {
await Clerk.load()
const params = {
cancelOnTapOutside: false,
itpSupport: false,
fedCmSupport: false,
}
Clerk.openGoogleOneTap(params)
})
</script>
```
</CodeBlockTabs>


### `closeGoogleOneTap()`

Closes the `<GoogleOneTap />` component.
Expand All @@ -163,9 +137,8 @@ function closeGoogleOneTap(): void

#### `closeGoogleOneTap()` usage

<CodeBlockTabs options={['NPM module', '<script>']}>
```js {{ filename: 'index.js', mark: [16] }}
import { Clerk } from '@clerk/clerk-js'
import { Clerk } from '@clerk/clerk-js'
// Initialize Clerk with your Clerk publishable key
const clerk = new Clerk('{{pub_key}}')
Expand All @@ -182,39 +155,7 @@ function closeGoogleOneTap(): void
clerk.closeGoogleOneTap()
```

```html {{ filename: 'index.html', mark: [26] }}
<!-- Add a <div id="sign-in"> element to your HTML -->
<div id="sign-in"></div>

<!-- Initialize Clerk with your
Clerk Publishable key and Frontend API URL -->
<script
async
crossorigin="anonymous"
data-clerk-publishable-key="{{pub_key}}"
src="https://{{fapi_url}}/npm/@clerk/clerk-js@latest/dist/clerk.browser.js"
type="text/javascript"
></script>

<script>
window.addEventListener('load', async function () {
await Clerk.load()
const params = {
cancelOnTapOutside: false,
itpSupport: false,
fedCmSupport: false,
}
Clerk.openGoogleOneTap(params)
// Do something else
Clerk.closeGoogleOneTap()
})
</script>
```
</CodeBlockTabs>


### `authenticateWithGoogleOneTap()`

Authenticates the user with a token generated from Google identity services. Also sets the user's current session to active.
Expand All @@ -236,7 +177,6 @@ function authenticateWithGoogleOneTap(

#### `authenticateWithGoogleOneTap()` usage

<CodeBlockTabs options={['NPM module', '<script>']}>
```js {{ filename: 'index.js', mark: [[7, 15]] }}
import { Clerk } from '@clerk/clerk-js'
Expand All @@ -255,34 +195,6 @@ function authenticateWithGoogleOneTap(
await clerk.handleGoogleOneTapCallback(signInOrUp, customUrls)
```

```html {{ filename: 'index.html', mark: [[14, 22]] }}
<!-- Initialize Clerk with your
Clerk Publishable key and Frontend API URL -->
<script
async
crossorigin="anonymous"
data-clerk-publishable-key="{{pub_key}}"
src="https://{{fapi_url}}/npm/@clerk/clerk-js@latest/dist/clerk.browser.js"
type="text/javascript"
></script>

<script>
window.addEventListener('load', async function () {
await Clerk.load()
// Optionally, you can set redirect URLs.
const customUrls = {
signInUrl: '/sign-in',
signUpUrl: '/sign-up',
}
// Initiate the authentication flow.
const signInOrUp = await clerk.authenticateWithGoogleOneTap({ token: 'xxxx' })
// Set the session as active, and handle any navigation or redirects
await clerk.handleGoogleOneTapCallback(signInOrUp, customUrls)
})
</script>
```
</CodeBlockTabs>

### `handleGoogleOneTapCallback()`

Completes a Google One Tap redirection flow started by [`authenticateWithGoogleOneTap()`](#authenticate-with-google-one-tap). Also calls [`Clerk.setActive()`](/docs/references/javascript/clerk/session-methods#set-active) and performs a custom navigation if given a custom navigation function.
Expand Down
106 changes: 0 additions & 106 deletions docs/components/authentication/sign-in.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,6 @@ function mountSignIn(node: HTMLDivElement, props?: SignInProps): void

#### `mountSignIn()` usage

<CodeBlockTabs options={['NPM module', '<script>']}>
```js {{ filename: 'index.js', mark: [13] }}
import { Clerk } from '@clerk/clerk-js'
Expand All @@ -199,32 +198,6 @@ function mountSignIn(node: HTMLDivElement, props?: SignInProps): void
clerk.mountSignIn(signInDiv)
```

```html {{ filename: 'index.html', mark: [20] }}
<!-- Add a <div id="sign-in"> element to your HTML -->
<div id="sign-in"></div>

<!-- Initialize Clerk with your
Clerk Publishable key and Frontend API URL -->
<script
async
crossorigin="anonymous"
data-clerk-publishable-key="{{pub_key}}"
src="https://{{fapi_url}}/npm/@clerk/clerk-js@latest/dist/clerk.browser.js"
type="text/javascript"
></script>

<script>
window.addEventListener('load', async function () {
await Clerk.load()

const signInDiv = document.getElementById('sign-in')

Clerk.mountSignIn(signInDiv)
})
</script>
```
</CodeBlockTabs>
### `unmountSignIn()`

Unmount and run cleanup on an existing `<SignIn />` component instance.
Expand All @@ -244,7 +217,6 @@ function unmountSignIn(node: HTMLDivElement): void

#### `unmountSignIn()` usage

<CodeBlockTabs options={['NPM module', '<script>']}>
```js {{ filename: 'index.js', mark: [17] }}
import { Clerk } from '@clerk/clerk-js'
Expand All @@ -265,36 +237,6 @@ function unmountSignIn(node: HTMLDivElement): void
clerk.unmountSignIn(signInDiv)
```

```html {{ filename: 'index.html', mark: [24] }}
<!-- Add a <div id="sign-in"> element to your HTML -->
<div id="sign-in"></div>
<!-- Initialize Clerk with your
Clerk Publishable key and Frontend API URL -->
<script
async
crossorigin="anonymous"
data-clerk-publishable-key="{{pub_key}}"
src="https://{{fapi_url}}/npm/@clerk/clerk-js@latest/dist/clerk.browser.js"
type="text/javascript"
></script>
<script>
window.addEventListener('load', async function () {
await Clerk.load()
const signInDiv = document.getElementById('sign-in')
Clerk.mountSignIn(signInDiv)
// ...
Clerk.unmountSignIn(signInDiv)
})
</script>
```
</CodeBlockTabs>

### `openSignIn()`

Opens the `<SignIn />` component as an overlay at the root of your HTML `body` element.
Expand All @@ -314,7 +256,6 @@ function openSignIn(props?: SignInProps): void

#### `openSignIn()` usage

<CodeBlockTabs options={['NPM module', '<script>']}>
```js {{ filename: 'index.js', mark: [7] }}
import { Clerk } from '@clerk/clerk-js'
Expand All @@ -325,27 +266,6 @@ function openSignIn(props?: SignInProps): void
clerk.openSignIn()
```

```html {{ filename: 'index.html', mark: [15] }}
<!-- Initialize Clerk with your
Clerk Publishable key and Frontend API URL -->
<script
async
crossorigin="anonymous"
data-clerk-publishable-key="{{pub_key}}"
src="https://{{fapi_url}}/npm/@clerk/clerk-js@latest/dist/clerk.browser.js"
type="text/javascript"
></script>
<script>
window.addEventListener('load', async function () {
await Clerk.load()
Clerk.openSignIn()
})
</script>
```
</CodeBlockTabs>

### `closeSignIn()`

Closes the sign in overlay.
Expand All @@ -356,7 +276,6 @@ function closeSignIn(): void

#### `closeSignIn()` usage

<CodeBlockTabs options={['NPM module', '<script>']}>
```js {{ filename: 'index.js', mark: [11] }}
import { Clerk } from '@clerk/clerk-js'
Expand All @@ -371,31 +290,6 @@ function closeSignIn(): void
clerk.closeSignIn()
```

```html {{ filename: 'index.html', mark: [19] }}
<!-- Initialize Clerk with your
Clerk Publishable key and Frontend API URL -->
<script
async
crossorigin="anonymous"
data-clerk-publishable-key="{{pub_key}}"
src="https://{{fapi_url}}/npm/@clerk/clerk-js@latest/dist/clerk.browser.js"
type="text/javascript"
></script>
<script>
window.addEventListener('load', async function () {
await Clerk.load()
Clerk.openSignIn()
// ...
Clerk.closeSignIn()
})
</script>
```
</CodeBlockTabs>

## Customization

To learn about how to customize Clerk components, see the [customization documentation](/docs/customization/overview).
Loading

0 comments on commit f789165

Please sign in to comment.