Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
ab6bfdd
Patched /Users/codelion/Documents/GitHub/stack/docs/fern/docs/pages/s…
Aug 27, 2024
d1ea616
Patched /Users/codelion/Documents/GitHub/stack/docs/fern/docs/pages/s…
Aug 27, 2024
bd9dd12
Patched /Users/codelion/Documents/GitHub/stack/docs/fern/docs/pages/s…
Aug 27, 2024
482c042
Patched /Users/codelion/Documents/GitHub/stack/docs/fern/docs/pages/s…
Aug 27, 2024
3924c49
Patched /Users/codelion/Documents/GitHub/stack/docs/fern/docs/pages/s…
Aug 27, 2024
68dff53
Patched /Users/codelion/Documents/GitHub/stack/docs/fern/docs/pages/s…
Aug 27, 2024
ca0878c
Patched /Users/codelion/Documents/GitHub/stack/docs/fern/docs/pages/s…
Aug 27, 2024
e20e399
Patched /Users/codelion/Documents/GitHub/stack/docs/fern/docs/pages/s…
Aug 27, 2024
0737455
Patched /Users/codelion/Documents/GitHub/stack/docs/fern/docs/pages/s…
Aug 27, 2024
42137ca
Patched /Users/codelion/Documents/GitHub/stack/docs/fern/docs/pages/s…
Aug 27, 2024
7f04082
Patched /Users/codelion/Documents/GitHub/stack/docs/fern/docs/pages/s…
Aug 27, 2024
bc0bff7
Patched /Users/codelion/Documents/GitHub/stack/docs/fern/docs/pages/s…
Aug 27, 2024
2d63164
Patched /Users/codelion/Documents/GitHub/stack/docs/fern/docs/pages/s…
Aug 27, 2024
4194c88
Patched /Users/codelion/Documents/GitHub/stack/docs/fern/docs/pages/s…
Aug 27, 2024
b1094e2
Patched /Users/codelion/Documents/GitHub/stack/docs/fern/docs/pages/s…
Aug 27, 2024
5cc39dd
Patched /Users/codelion/Documents/GitHub/stack/docs/fern/docs/pages/s…
Aug 27, 2024
e249107
Patched /Users/codelion/Documents/GitHub/stack/docs/fern/docs/pages/s…
Aug 27, 2024
bab0670
Patched /Users/codelion/Documents/GitHub/stack/docs/fern/docs/pages/s…
Aug 27, 2024
c5e1ee4
Patched /Users/codelion/Documents/GitHub/stack/docs/fern/docs/pages/s…
Aug 27, 2024
ee8090a
Patched /Users/codelion/Documents/GitHub/stack/docs/fern/docs/pages/s…
Aug 27, 2024
7aa41db
added two more
codelion Aug 27, 2024
a3acc8e
Patched /tmp/tmp9u5n8f6u/docs/fern/docs/pages/sdk/use-stack-app.mdx
Oct 4, 2024
9beb1f0
Patched /tmp/tmpd2qa_8id/docs/fern/docs/pages/sdk/use-stack-app.mdx
Oct 4, 2024
9597b58
Patched /private/var/folders/19/08z9_xys69v3f1xfqtyn9jyw0000gn/T/tmp9…
Oct 4, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions docs/fern/docs/pages/sdk/account-settings.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
title: AccountSettings
---

# AccountSettings

A component that renders account settings with various sections in a sidebar layout. It can be displayed as a full page or embedded.

## Props

- `fullPage` (optional): `boolean` - If true, wraps the component in a container for full-page display. Default is `false`.

## Example

```tsx
import { AccountSettings } from '@stackframe/stack';

// Embedded version
function MyComponent() {
return <AccountSettings />;
}

// Full-page version
function MyFullPageComponent() {
return <AccountSettings fullPage={true} />;
}
```
35 changes: 35 additions & 0 deletions docs/fern/docs/pages/sdk/auth-page.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
title: AuthPage
---

# AuthPage

Renders an authentication page for sign-in or sign-up functionality.

## Props

- `fullPage` (optional): `boolean` - Whether to render the auth page in full-page mode. Defaults to `false`.
- `type`: `'sign-in' | 'sign-up'` - The type of authentication page to render.
- `automaticRedirect` (optional): `boolean` - Whether to automatically redirect after successful authentication.
- `mockProject` (optional): `object` - Mock project configuration for testing purposes.
- `config`: `object`
- `signUpEnabled`: `boolean`
- `credentialEnabled`: `boolean`
- `magicLinkEnabled`: `boolean`
- `oauthProviders`: `Array<{ id: string }>`

## Example

```tsx
import { AuthPage } from '@stackframe/stack';

// Sign-in page
<AuthPage type='sign-in' />

// Sign-up page with full-page mode and automatic redirect
<AuthPage
type='sign-up'
fullPage={true}
automaticRedirect={true}
/>
```
26 changes: 26 additions & 0 deletions docs/fern/docs/pages/sdk/credential-sign-in.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
title: CredentialSignIn
---

# CredentialSignIn

A React component that renders a sign-in form using email and password credentials.

## Props

This component does not accept any props.

## Example

```tsx
import { CredentialSignIn } from '@stackframe/stack';

function SignInPage() {
return (
<div>
<h1>Sign In</h1>
<CredentialSignIn />
</div>
);
}
```
28 changes: 28 additions & 0 deletions docs/fern/docs/pages/sdk/credential-sign-up.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
title: CredentialSignUp
---

# CredentialSignUp

A React component that renders a sign-up form for credential-based authentication.

## Props

This component does not accept any props.

## Example

```tsx
import { CredentialSignUp } from '@stackframe/stack';

function SignUpPage() {
return (
<div>
<h1>Sign Up</h1>
<CredentialSignUp />
</div>
);
}
```

This component renders a form with email and password fields, handles form submission, and manages the sign-up process using the Stack SDK.
31 changes: 31 additions & 0 deletions docs/fern/docs/pages/sdk/email-verification.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
title: EmailVerification
---

# EmailVerification

A component for handling email verification processes. It displays different messages based on the verification status.

## Props

- `searchParams` (optional): `Record<string, string>` - An object containing search parameters. It should have a `code` property for the verification code.
- `fullPage` (optional): `boolean` - Determines if the component should be displayed in full-page mode. Default is `false`.

## Example

```tsx
import { EmailVerification } from '@stackframe/stack';

// Basic usage
<EmailVerification />

// With search params and full-page mode
<EmailVerification
searchParams={{ code: 'abc123' }}
fullPage={true}
/>

// Using with URL search params
const searchParams = new URLSearchParams(window.location.search);
<EmailVerification searchParams={Object.fromEntries(searchParams)} />
```
23 changes: 23 additions & 0 deletions docs/fern/docs/pages/sdk/forgot-password.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
title: ForgotPassword
---

# ForgotPassword

A component that renders a forgot password form or relevant messages based on the user's state.

## Props

- `fullPage` (optional): `boolean` - Determines if the component should be rendered in full-page mode. Default is `false`.

## Example

```tsx
import { ForgotPassword } from '@stackframe/stack';

// Default usage
<ForgotPassword />

// Full-page mode
<ForgotPassword fullPage={true} />
```
28 changes: 28 additions & 0 deletions docs/fern/docs/pages/sdk/magic-link-sign-in.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
title: MagicLinkSignIn
---

# MagicLinkSignIn

A React component that renders a form for magic link sign-in functionality.

## Props

This component does not accept any props.

## Example

```tsx
import { MagicLinkSignIn } from '@stackframe/stack';

function SignInPage() {
return (
<div>
<h1>Sign In</h1>
<MagicLinkSignIn />
</div>
);
}
```

The `MagicLinkSignIn` component renders a form with an email input and a submit button. When the form is submitted, it sends a magic link to the provided email address.
37 changes: 37 additions & 0 deletions docs/fern/docs/pages/sdk/message-card.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
title: MessageCard
---

# MessageCard

Renders a message card component with optional buttons and full-page display.

## Props

- `title`: `string` - The title of the message card.
- `children` (optional): `React.ReactNode` - The content of the message card.
- `fullPage` (optional): `boolean` - Whether to display the card in full-page mode. Default is `false`.
- `primaryButtonText` (optional): `string` - Text for the primary button.
- `primaryAction` (optional): `() => Promise<void> | void` - Function to execute when the primary button is clicked.
- `secondaryButtonText` (optional): `string` - Text for the secondary button.
- `secondaryAction` (optional): `() => Promise<void> | void` - Function to execute when the secondary button is clicked.

## Example

```tsx
import { MessageCard } from '@stackframe/stack';

function ExampleMessage() {
return (
<MessageCard
title='Welcome'
primaryButtonText='Get Started'
primaryAction={() => console.log('Getting started')}
secondaryButtonText='Learn More'
secondaryAction={() => console.log('Learning more')}
>
<p>This is an example message card.</p>
</MessageCard>
);
}
```
32 changes: 32 additions & 0 deletions docs/fern/docs/pages/sdk/oauth-button-group.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
title: OAuthButtonGroup
---

# OAuthButtonGroup

Renders a group of OAuth buttons for sign-in or sign-up functionality.

## Props

- `type`: `'sign-in' | 'sign-up'` - Specifies whether the buttons are for sign-in or sign-up.
- `mockProject` (optional): `{ config: { oauthProviders: { id: string }[] } }` - Mocked project configuration for testing purposes.

## Example

```tsx
import { OAuthButtonGroup } from '@stackframe/stack';

// Basic usage
<OAuthButtonGroup type='sign-in' />

// With mock project
const mockProject = {
config: {
oauthProviders: [
{ id: 'google' },
{ id: 'github' }
]
}
};
<OAuthButtonGroup type='sign-up' mockProject={mockProject} />
```
27 changes: 27 additions & 0 deletions docs/fern/docs/pages/sdk/oauth-button.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
title: OAuthButton
---

# OAuthButton

A customizable OAuth button component for sign-in or sign-up functionality.

## Props

- `provider`: `string` - The OAuth provider (e.g., 'google', 'github', 'facebook', 'microsoft', 'spotify').
- `type`: `'sign-in' | 'sign-up'` - The type of action, either 'sign-in' or 'sign-up'.

## Example

```tsx
import { OAuthButton } from '@stackframe/stack';

function SignInPage() {
return (
<div>
<OAuthButton provider='google' type='sign-in' />
<OAuthButton provider='github' type='sign-up' />
</div>
);
}
```
29 changes: 29 additions & 0 deletions docs/fern/docs/pages/sdk/password-reset.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
title: PasswordReset
---

# PasswordReset

A component for handling password reset functionality. It displays different messages based on the validity and state of the password reset code.

## Props

- `searchParams`: `Record<string, string>` - An object containing search parameters, including the password reset code.
- `fullPage` (optional): `boolean` - Determines if the component should be displayed in full-page mode. Defaults to `false`.

## Example

```tsx
import { PasswordReset } from '@stackframe/stack';

function ResetPasswordPage() {
const searchParams = { code: 'reset123' };

return (
<PasswordReset
searchParams={searchParams}
fullPage={true}
/>
);
}
```
29 changes: 29 additions & 0 deletions docs/fern/docs/pages/sdk/selected-team-switcher.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
title: SelectedTeamSwitcher
---

# SelectedTeamSwitcher

A component that allows users to switch between teams and manage team-related actions.

## Props

- `urlMap` (optional): A function that takes a `Team` object and returns a URL string for navigation.
- `selectedTeam` (optional): `Team` - The currently selected team.
- `noUpdateSelectedTeam` (optional): `boolean` - If true, prevents updating the selected team when a new team is chosen.

## Example

```tsx
import { SelectedTeamSwitcher } from '@stackframe/stack';

function TeamManagement() {
return (
<SelectedTeamSwitcher
urlMap={(team) => `/team/${team.id}`}
selectedTeam={currentTeam}
noUpdateSelectedTeam={false}
/>
);
}
```
Loading