|
| 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 | +``` |
0 commit comments