You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/fern/docs/pages/getting-started/overview.mdx
+22-16Lines changed: 22 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@ subtitle: Welcome to Stack!
7
7
<Card
8
8
title="Setup Guide"
9
9
icon="fa-regular fa-play"
10
-
href="./setup.mdx"
10
+
href="../getting-started/setup.mdx"
11
11
>
12
12
Setup Stack in your project
13
13
</Card>
@@ -16,14 +16,14 @@ subtitle: Welcome to Stack!
16
16
icon="fa-regular fa-file-lines"
17
17
href="../sdk/user.mdx"
18
18
>
19
-
Learn how to use Stack SDKs
19
+
Learn how to use Stack's SDKs for Next.js
20
20
</Card>
21
21
<Card
22
-
title="API Reference"
22
+
title="REST API Reference"
23
23
icon="fa-solid fa-code"
24
24
href="/rest-api"
25
25
>
26
-
Explore Stack REST API
26
+
Explore Stack's REST API for frameworks that aren't natively supported yet
27
27
</Card>
28
28
<Card
29
29
title="Discord"
@@ -36,38 +36,42 @@ subtitle: Welcome to Stack!
36
36
37
37
## Why Stack?
38
38
39
-
You might wonder: "With so many authentication libraries available, why create Stack?"
39
+
Authentication is inherently difficult. There are only few things more sensitive than user data, and only few things more difficult than cryptography. It's not surprising that a majority of online businesses struggle to get it right.
40
40
41
-
The answer is straightforward: **They all suck at developer experience**.
41
+
The optimal authentication solution is secure, yet approachable. If a developer has to worry about JWTs, OAuth flows, or password hashing, then we have failed. If an authentication solution uses closed-source, unauditable code for the most critical parts of your application, then we have failed.
42
42
43
-
As developers, we don't want to be bothered by decisions about using JWT or session tokens, handling token refreshes, or managing user data synchronization with frontend states. **Auth should be a 5 minutes job**, not 5 days. Our focus should be on building the core product.
43
+
The truth is; as the authentication services industry, we have collectively failed. It is dominated by proprietary giants with predatory "bait-and-switch" pricing who provide no transparency into their codebase, and a terrible developer experience because they have determined that enterprises are willing to pay more if setting up auth systems is painful.
44
44
45
-
Stack abstract all these complexities away by deeply integrate into the frontend and backend framework. It offers a simple and intuitive interface, while remains highly flexible, customizable, and powerful.
45
+
That's why we built Stack. Integrating secure authentication into your app should be a matter of **5 minutes**, rather than 5 days.
46
46
47
-
Here is an example. To use the current user, simply call:
47
+
At the core of this are deep integrations into frontend and backend frameworks. We give the best developer experience to anyone using our supported tech stacks; at the moment, this is Next.js with Postgres and TypeScript or Python backends. Instead of giving mediocre support for a lot of frameworks, we chose to make a few integrations as excellent as possible before adding new ones (though we do offer a cross-compatible REST API as a fallback).
48
+
49
+
Here is an example. To retrieve the current user, simply call:
48
50
49
51
```tsx
50
52
exportfunction MyComponent() {
51
-
const user =useUser();
53
+
const user =useUser({ or: "redirect" });
52
54
return <div>{user?`Hi, ${user.displayName}`:'You are not logged in'}</div>;
53
55
}
54
56
```
55
57
56
-
That's it! You don't need to worry about fetching the user, storing the user data, handling loading states, or refreshing user data. Stack manages all of that for you.
58
+
That's it! Stack will either return a User object or redirect the user to the login page.
57
59
58
60
You can also add a button to change the user's name:
59
61
60
62
```tsx
61
-
<buttononClick={async () =>awaitapp.update({ displayName: "New Name" })}>
63
+
<buttononClick={async () =>awaituser.update({ displayName: "New Name" })}>
62
64
Change Name
63
65
</button>
64
66
```
65
-
The user data will be updated in both the frontend and backend automatically. The updated user data will also reflect in `MyComponent` as well.
67
+
The user data will update in both the frontend and backend automatically. The updated user data will be reflected in all other components on your page as well.
66
68
67
-
You also get pages and components for authentication flow out-of-the-box. This for example the sign-in page is what you get without writing a single line of code:
69
+
You also get pages and components for authentication flow out-of-the-box. This is the sign-in page that you get without writing a single line of code:
68
70
69
71

70
72
73
+
Notably, there's no branding on any of our components. We believe that we should grow by building the best product, not by forcing our brand on your users — but this means that we **rely on you to spread the word about Stack**. If you like what you're reading, we'd love if you could take a second to tell one or two of your friends about us.
74
+
71
75
If you prefer a fully customized UI, you can use our low-level functions like `signInWithOAuth` or `signInWithCredential` to build your own sign-in page:
72
76
73
77
```tsx
@@ -85,8 +89,10 @@ To manage everything efficiently, there is a powerful admin dashboard:
85
89
86
90

87
91
88
-
Best of all, Stack is **100% open-source**.
92
+
Best of all, Stack is **100% open-source**. That means client, server, dashboard, and even this very documentation you're reading right now. Feel free to check out our [GitHub](https://github.com/stack-auth/stack) and open an issue or pull request.
89
93
90
94
This is just a glimpse of what Stack can do. Stack also handles many other tasks like backend integration, data storage, emails, teams, permissions, and more, which you will learn later in the documentation.
91
95
92
-
If this sounds interesting, let's get started with setting up Stack in your project!
96
+
If this sounds interesting, [get started](../getting-started/setup.mdx) with our interactive setup wizard, or join [our Discord community](https://discord.stack-auth.com) to ask questions and get help from our team.
0 commit comments