Skip to content

Commit 9e39b40

Browse files
committed
docs: bring your ui
1 parent 7ebada9 commit 9e39b40

File tree

3 files changed

+66
-2
lines changed

3 files changed

+66
-2
lines changed
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
---
2+
sidebar_label: Bring your UI
3+
sidebar_position: 6
4+
---
5+
6+
import Availability from '@components/Availability';
7+
8+
# Bring your own sign-in experience UI
9+
10+
<Availability cloud oss={false} />
11+
12+
In addition to all the customization methods we introduced above, you can deeply customize your sign-in experience by bringing your own UI to completely replace the built-in Logto sign-in interface. This feature enables you to upload a zip file containing your custom UI assets (HTML, CSS, JavaScript, images, etc.), have it hosted on Logto Cloud servers, and use it as the sign-in experience for your tenant users.
13+
14+
:::note
15+
16+
Please note that this feature requires your custom UI to be Single Page Application (SPA) compatible, and it's recommended to always use a production build for optimal performance.
17+
18+
:::
19+
20+
## Upload your custom UI assets
21+
22+
:::note
23+
24+
Proceed with caution when using this feature in production, since it will immediately affect your users' sign-in experience.
25+
26+
:::
27+
28+
Navigate to "Sign-in experience > Branding > Custom UI > Bring your UI" in the Logto Console.
29+
30+
Click to select or drag and drop your zip file containing your custom UI assets, and the upload process will start automatically. Once the upload is complete, save the changes, and your custom UI will be served immediately.
31+
32+
The "Sign-in preview" window will be disabled when you use your custom sign-in UI. However, you can still click the "Live preview" button to test your custom sign-in page in a new opened browser tab.
33+
34+
### Custom UI assets requirements
35+
36+
- The upload assets should be packed as a single zip file.
37+
- The zip file should contain an `index.html` file in the root directory.
38+
- The zip file should not exceed 20MB in size.
39+
- The zip file should not contain any file that exceeds 10MB in size.
40+
- The zip file should not contain more than 200 files in total.
41+
42+
### Tips to quickly get started
43+
44+
At this point, the fastest way to initiate a custom sign-in UI is to clone the [Logto experience project](https://github.com/logto-io/logto/tree/master/packages/experience). This is the built-in Logto sign-in experience UI that covers all features and Logto's best practices. You can customize it to fit your needs.
45+
46+
After checking out the code, just simply run:
47+
48+
```
49+
pnpm install && pnpm start
50+
```
51+
52+
Note: The whole Logto project is a [pnpm monorepo](https://pnpm.io/workspaces), and you can find workspace protocol dependencies in package.json. Replace it with regular semver if you are not using pnpm, and want to run it as a standalone project.
53+
54+
Moreover, we are working on providing more simplified and scenario-based sample projects to cover the most common use cases. Stay tuned for our future updates!
55+
56+
## Interact with Logto experience API
57+
58+
When developing your custom UI pages, you can interact with Logto's experience API to perform various actions such as sign-in, sign-up, password reset, binding social accounts, enabling MFA, and more. Refer to [Logto experience API documentation](https://openapi.logto.io/group/endpoint-interaction) for more details.
59+
60+
Other sign-in experience configurations, such as branding colors, company logo, favicon, password policy, localized language phrases, even custom CSS, can still be fetched from the [sign-in experience API endpoint](https://openapi.logto.io/operation/operation-getsigninexperienceconfig).
61+
62+
## Restore to Logto built-in sign-in experience
63+
64+
If you wish to restore to Logto's built-in sign-in experience, simply click the delete button on the custom UI card. After saving the changes, the sign-in experience UI will be reverted back to Logto's default.

docs/docs/recipes/customize-sie/check-out-the-live-preview.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
sidebar_label: Check out the live preview
3-
sidebar_position: 6
3+
sidebar_position: 7
44
---
55

66
# Check out the live preview

docs/docs/recipes/customize-sie/custom-css.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Logto continually enhances the user sign-in experience and has added a brand col
99

1010
## Custom CSS in Logto Console
1111

12-
Go to "Sign-in Experience > Branding > Custom CSS" in the Logto Console.
12+
Go to "Sign-in Experience > Branding > Custom UI > Custom CSS" in the Logto Console.
1313

1414
Editing CSS code in the left editor, it will render lively in the right preview modal immediately. Please note, the code editor only supports the CSS code so far. Not HTML or Javascript.
1515

0 commit comments

Comments
 (0)