Skip to content

Commit 6813730

Browse files
andre-geraldesjackmurdoch
authored andcommitted
Add custom theme documentation
1 parent 0a83755 commit 6813730

7 files changed

Lines changed: 109 additions & 75 deletions

File tree

docs/customization.md

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
---
2+
sidebar_position: 8
3+
---
4+
5+
# Customization
6+
7+
## Initial screen
8+
9+
The initial screen on Topper is the amount and asset selection.
10+
11+
To skip this screen on initialization and go straight to authentication, simply add the `initial_screen` query parameter to the URL like `https://app.topperpay.com/?bt=<bootstrap token>&initial_screen=authentication`.
12+
13+
14+
15+
| Amount selection screen | Authentication screen |
16+
|-------------------------|-------------------------|
17+
| <img src="/images/amount-selection-screen.jpg" alt="Amount selection screen" width="300"/> | <img src="/images/get-started-screen.jpg" alt="Authentication screen" width="300"/> |
18+
19+
20+
**What other initial screens are supported?**
21+
22+
Currently only the Authentication screen is supported.
23+
24+
25+
**Using the [Web SDK](./web-sdk.md):**
26+
27+
```js
28+
const topper = new TopperWebSdk({ initial_screen: TOPPER_INITIAL_SCREENS.AUTHENTICATION });
29+
30+
topper.initialize({ bootstrapToken: <bootstrap token> });
31+
```
32+
33+
34+
## Locale
35+
36+
**Which languages are supported by Topper?**
37+
38+
Topper supports English, Brazilian Portuguese and Spanish.
39+
40+
**How to set a specific locale?**
41+
42+
By default, Topper will use the locale set on the user's browser. If that locale is not supported it will default to English.
43+
44+
To set a specific locale, you can set it as query parameter such as: `https://app.topperpay.com/?bt=<bootstrap token>&locale=en`. The supported values are `en`, `en-US`, `pt`, `pt-BR`, `es` and `es-ES`.
45+
46+
When the user authenticates in Topper, the locale will be set accordingly to the user preferences.
47+
48+
**Using the [Web SDK](./web-sdk.md):**
49+
50+
```js
51+
const topper = new TopperWebSdk({ locale: TOPPER_LOCALES.PT });
52+
53+
topper.initialize({ bootstrapToken: <bootstrap token> });
54+
```
55+
56+
57+
## Theming
58+
59+
### Custom
60+
61+
Topper supports custom themes so you can seamlessly integrate our widget with your brand's look and feel. You can customize colors, logo, or both to match your website or app.
62+
63+
**What can be customized?**
64+
65+
- **Colors**: Personalize the colors of various elements, including backgrounds, buttons, text and more.
66+
67+
- **Logo**: Display your own logo in the header. You can provide separate logos for desktop and mobile views (or use the same for both). You also have the option to position your logo on the left or in the center (which is the default).
68+
69+
- **Maximum dimensions**: 180px x 40px
70+
- **Supported formats**: SVG or PNG
71+
72+
**How to use your custom theme?**
73+
74+
Once your custom theme is set up, it will be associated with a unique theme name (e.g. `foo-theme`). To apply it, simply include the theme name in your bootstrap URL like this `https://app.topperpay.com/?bt=<bootstrap token>&theme=foo-theme`.
75+
76+
**Using the [Web SDK](./web-sdk.md):**
77+
78+
```js
79+
const topper = new TopperWebSdk({ theme: 'foo-theme' });
80+
81+
topper.initialize({ bootstrapToken: <bootstrap token> });
82+
```
83+
84+
:::info
85+
Custom themes need to be configured on our end. Please reach out to your account manager for more details.
86+
:::
87+
88+
**Theme validation**
89+
90+
Custom themes are validated and tied exclusively to their associated widget, ensuring they cannot be used by unauthorized parties. If an invalid theme name is provided, we'll default to our dark theme.
91+
92+
93+
### Default
94+
95+
Topper also supports by default `light` and `dark` themes.
96+
97+
The default is the dark theme, but you can easily switch by adding `&theme=light` to the URL, such as `https://app.topperpay.com/?bt=<bootstrap token>&theme=light`.
98+
99+
**Using the [Web SDK](./web-sdk.md):**
100+
101+
```js
102+
const topper = new TopperWebSdk({ theme: TOPPER_THEMES.LIGHT });
103+
104+
topper.initialize({ bootstrapToken: <bootstrap token> });
105+
```

docs/initial-screen.md

Lines changed: 0 additions & 29 deletions
This file was deleted.

docs/locale.md

Lines changed: 0 additions & 25 deletions
This file was deleted.

docs/mobile.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
sidebar_position: 14
2+
sidebar_position: 10
33
---
44

55
# Mobile

docs/security.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
---
2-
sidebar_position: 14
2+
sidebar_position: 12
33
---
44

55
# Security
66

77
## Protect your signing keys
88

9-
Never expose or share your private keys. If compromised, attackers can initiate sessions on your behalf.
9+
Never expose or share your private keys. If compromised, attackers can initiate sessions on your behalf.
1010

1111
Never share your private keys with anyone (including us), and never expose them in a public code repository or website source code. To further protect your keys, you should consider rotating your private keys regularly.
1212

docs/single-sign-on.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
sidebar_position: 8
2+
sidebar_position: 11
33
---
44

55
# Single Sign-On

docs/theming.md

Lines changed: 0 additions & 17 deletions
This file was deleted.

0 commit comments

Comments
 (0)