Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
1c2f786
Patched /tmp/tmp_ww_t69h/docs/fern/docs/pages/sdk/use-user.mdx
Sep 3, 2024
83f34b4
Patched /tmp/tmp_ww_t69h/docs/fern/docs/pages/sdk/sign-in.mdx
Sep 3, 2024
98794bd
Patched /tmp/tmp_ww_t69h/docs/fern/docs/pages/sdk/account-settings.mdx
Sep 3, 2024
6dd71d8
Patched /tmp/tmp_ww_t69h/docs/fern/docs/pages/sdk/forgot-password.mdx
Sep 3, 2024
878a8d2
Patched /tmp/tmp_ww_t69h/docs/fern/docs/pages/sdk/use-stack-app.mdx
Sep 3, 2024
62bbe9c
Patched /tmp/tmp_ww_t69h/docs/fern/docs/pages/sdk/sign-up.mdx
Sep 3, 2024
2ca6d31
Patched /tmp/tmp_ww_t69h/docs/fern/docs/pages/sdk/password-reset.mdx
Sep 3, 2024
392e626
Patched /tmp/tmp_ww_t69h/docs/fern/docs/pages/sdk/user-button.mdx
Sep 3, 2024
4bddf9c
Patched /tmp/tmp_ww_t69h/docs/fern/docs/pages/sdk/stack-provider.mdx
Sep 3, 2024
9416df0
Patched /tmp/tmp_ww_t69h/docs/fern/docs/pages/sdk/selected-team-switc…
Sep 3, 2024
689722a
Patched /tmp/tmp_ww_t69h/docs/fern/docs/pages/sdk/stack-theme.mdx
Sep 3, 2024
c71fb98
Patched /tmp/tmp_ww_t69h/docs/fern/docs/pages/sdk/email-verification.mdx
Sep 3, 2024
5901067
Patched /tmp/tmp_ww_t69h/docs/fern/docs/pages/sdk/credential-sign-up.mdx
Sep 3, 2024
370441a
Patched /tmp/tmp_ww_t69h/docs/fern/docs/pages/sdk/oauth-button-group.mdx
Sep 3, 2024
67aec0f
Patched /tmp/tmp_ww_t69h/docs/fern/docs/pages/sdk/message-card.mdx
Sep 3, 2024
f8cf8a1
Patched /tmp/tmp_ww_t69h/docs/fern/docs/pages/sdk/auth-page.mdx
Sep 3, 2024
515ccc9
Patched /tmp/tmp_ww_t69h/docs/fern/docs/pages/sdk/magic-link-sign-in.mdx
Sep 3, 2024
3336008
Patched /tmp/tmp_ww_t69h/docs/fern/docs/pages/sdk/oauth-button.mdx
Sep 3, 2024
9c88114
Patched /tmp/tmp_ww_t69h/docs/fern/docs/pages/sdk/credential-sign-in.mdx
Sep 3, 2024
63f39aa
Patched /tmp/tmp_ww_t69h/docs/fern/docs/pages/sdk/stack-handler.mdx
Sep 3, 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
23 changes: 23 additions & 0 deletions docs/fern/docs/pages/sdk/account-settings.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
title: AccountSettings
---

# AccountSettings

Renders an account settings component with sections for profile, security, and general settings.

## Props

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

## Example

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

// Render as a section
<AccountSettings />

// Render as a full page
<AccountSettings fullPage={true} />
```
54 changes: 54 additions & 0 deletions docs/fern/docs/pages/sdk/auth-page.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
---
title: AuthPage
---

# AuthPage

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

## Props

- `fullPage` (optional): `boolean` - Determines if the component should be rendered in full-page mode. Default is `false`.
- `type`: `'sign-in' | 'sign-up'` - Specifies whether the page is for sign-in or sign-up.
- `automaticRedirect` (optional): `boolean` - If `true`, automatically redirects the user after successful authentication.
- `mockProject` (optional): `object` - Mocks the project configuration for testing purposes.
- `config`: `object`
- `signUpEnabled`: `boolean`
- `credentialEnabled`: `boolean`
- `magicLinkEnabled`: `boolean`
- `oauthProviders`: `Array<{ id: string }>`

## Example

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

function MyAuthPage() {
return (
<AuthPage
type="sign-in"
fullPage={true}
automaticRedirect={true}
/>
);
}

// With mock project for testing
function TestAuthPage() {
const mockProject = {
config: {
signUpEnabled: true,
credentialEnabled: true,
magicLinkEnabled: false,
oauthProviders: [{ id: 'google' }],
},
};

return (
<AuthPage
type="sign-up"
mockProject={mockProject}
/>
);
}
```
34 changes: 34 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,34 @@
---
title: CredentialSignIn
---

# CredentialSignIn

A 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>
);
}
```

The `CredentialSignIn` component renders a form with the following elements:
- Email input field
- Password input field
- 'Forgot password?' link
- 'Sign In' submit button

It handles form validation, submission, and displays error messages if the sign-in fails.
34 changes: 34 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,34 @@
---
title: CredentialSignUp
---

# CredentialSignUp

A React component that renders a sign-up form for user registration using email and password credentials.

## 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>
);
}
```

The `CredentialSignUp` component renders a form with the following fields:
- Email input
- Password input
- Repeat password input
- Sign Up button

It handles form validation, error display, and submission automatically. Upon successful sign-up, it uses the `signUpWithCredential` method from the Stack app instance.
32 changes: 32 additions & 0 deletions docs/fern/docs/pages/sdk/email-verification.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
title: EmailVerification
---

# EmailVerification

Renders an email verification component based on the provided verification code and display preferences.

## Props

- `searchParams`: `Record<string, string>` (optional) - An object containing search parameters. It should include a `code` property for the verification code.
- `code`: `string` (optional) - The email verification code. Defaults to an empty string if not provided.
- `fullPage`: `boolean` (optional) - Determines whether to display the component in full-page mode. Defaults to `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 URL search params
const searchParams = new URLSearchParams(window.location.search);
<EmailVerification searchParams={Object.fromEntries(searchParams)} />
```
29 changes: 29 additions & 0 deletions docs/fern/docs/pages/sdk/forgot-password.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
title: ForgotPassword
---

# ForgotPassword

A component that renders a password reset interface for users who have forgotten their password.

## Props

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

## Example

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

function App() {
return (
<div>
{/* Default usage */}
<ForgotPassword />

{/* Full-page mode */}
<ForgotPassword fullPage={true} />
</div>
);
}
```
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 field and a submit button. When the form is submitted, it sends a magic link to the provided email address. The component handles form validation, submission, and displays appropriate feedback to the user.
45 changes: 45 additions & 0 deletions docs/fern/docs/pages/sdk/message-card.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
---
title: MessageCard
---

# MessageCard

A component for displaying a card with a title, optional content, and action buttons.

## Props

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

## Example

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

function ExampleComponent() {
const handlePrimaryAction = () => {
console.log('Primary action clicked');
};

const handleSecondaryAction = () => {
console.log('Secondary action clicked');
};

return (
<MessageCard
title="Welcome"
primaryButtonText="Get Started"
primaryAction={handlePrimaryAction}
secondaryButtonText="Learn More"
secondaryAction={handleSecondaryAction}
>
<p>This is a message card example.</p>
</MessageCard>
);
}
```
41 changes: 41 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,41 @@
---
title: OAuthButtonGroup
---

# OAuthButtonGroup

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

## Props

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

## Example

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

function SignInPage() {
return (
<div>
<h1>Sign In</h1>
<OAuthButtonGroup type='sign-in' />
</div>
);
}

// With mock project (for testing)
const mockProject = {
config: {
oauthProviders: [
{ id: 'google' },
{ id: 'github' }
]
}
};

function TestSignUpPage() {
return <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

Renders a customized OAuth button for different providers.

## Props

- `provider`: `string` - The OAuth provider (e.g., 'google', 'github', 'facebook', 'microsoft', 'spotify').
- `type`: `'sign-in' | 'sign-up'` - Determines whether the button is for sign-in or sign-up.

## Example

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

function LoginPage() {
return (
<div>
<OAuthButton provider="google" type="sign-in" />
<OAuthButton provider="github" type="sign-up" />
</div>
);
}
```
Loading