Customizable SDK
Full control over the checkout appearance, layout, and field visibility. Match the SDK to your brand without building a form from scratch.
Overview
The Customizable SDK uses the same reliable checkout logic as the Plug & Play SDK, but gives you complete control over how it looks and behaves. Set mode: 'custom' to unlock theme configuration, layout options, field visibility controls, and pre-filled customer data.
Theme Configuration
Pass a theme object to override the default CSS variables. Every visual aspect of the checkout can be controlled through these variables.
GlinCheckout.mount('#checkout', {
publicKey: 'YOUR_PUBLIC_KEY',
remittanceId: 'REMITTANCE_ID',
mode: 'custom',
theme: {
primaryColor: '#059669',
primaryColorLight: '#10B981',
bgColor: '#0F0F0F',
textColor: '#F9FAFB',
borderColor: '#2D2D2D',
inputBorderColor: '#1F3D2E',
sectionTitleColor: '#34D399',
borderRadius: '12px',
},
onPaymentReady: async ({ remittanceId, paymentData }) => {
const res = await fetch('/api/confirm-payment', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ remittanceId, paymentData }),
});
return res.json();
},
});Theme Variables
| Name | Type | Required | Description |
|---|---|---|---|
primaryColor | string | — | Main accent color for buttons, focus rings, and active elements. |
primaryColorLight | string | — | Lighter variant of the primary color, used for hover states and highlights. |
bgColor | string | — | Background color of the checkout container. |
textColor | string | — | Primary text color for labels, values, and headings. |
textSecondaryColor | string | — | Secondary text color for hints and placeholder text. |
borderColor | string | — | Border color for dividers and section borders. |
errorColor | string | — | Color for validation error messages and error state borders. |
successColor | string | — | Color for success indicators and confirmed states. |
inputBgColor | string | — | Background color for input fields. |
inputBorderColor | string | — | Border color for input fields. |
sectionTitleColor | string | — | Color for section headings (e.g. "Dados pessoais", "Pagamento"). Defaults to textColor. |
borderRadius | string | — | Border radius for inputs and buttons (e.g. "8px", "0.5rem"). |
fontFamily | string | — | Font family stack for all checkout text (e.g. "'Inter', sans-serif"). |
fontSize | string | — | Tamanho base da fonte (padrao: "14px"). |
fontSizeSmall | string | — | Tamanho de fonte pequeno para dicas e mensagens de erro (padrao: "12px"). |
fontSizeLarge | string | — | Tamanho de fonte grande para titulos e valores (padrao: "18px"). |
labelFontSize | string | — | Tamanho da fonte dos labels do formulario (padrao: "14px"). |
formMaxWidth | string | — | Largura maxima do formulario de checkout (padrao: "480px"). |
summaryMaxWidth | string | — | Largura maxima do painel de resumo (padrao: "520px"). |
summaryMinWidth | string | — | Largura minima do painel de resumo (padrao: "300px"). |
Layout Options
Control how the checkout sections are arranged using the layout option.
| Name | Type | Required | Description |
|---|---|---|---|
vertical | default | — | All sections stacked in a single scrollable column. Best for narrow containers and mobile. |
For a multi-step wizard experience, use the paginated option instead of layout. This shows one section at a time with next/back navigation and a step indicator.
GlinCheckout.mount('#checkout', {
publicKey: 'YOUR_PUBLIC_KEY',
remittanceId: 'REMITTANCE_ID',
mode: 'custom',
paginated: true,
onPaymentReady: async ({ remittanceId, paymentData }) => {
const res = await fetch('/api/confirm-payment', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ remittanceId, paymentData }),
});
return res.json();
},
onSuccess: (data) => console.log('Paid!', data),
});Summary Position
Control where the remittance summary panel (merchant info, amount breakdown, conversion rate, fees) appears relative to the checkout form.
| Name | Type | Required | Description |
|---|---|---|---|
right | default | — | Summary panel appears to the right of the checkout form. Best for wide containers (desktop). This is the default. |
left | string | — | Summary panel appears to the left of the checkout form. |
top | string | — | Summary panel appears above the checkout form. Best for narrow containers and mobile layouts. |
bottom | string | — | Summary panel appears below the checkout form. |
hidden | string | — | Hides the summary panel entirely. Use when you display order details in your own UI. |
GlinCheckout.mount('#checkout', {
publicKey: 'YOUR_PUBLIC_KEY',
remittanceId: 'REMITTANCE_ID',
mode: 'custom',
summaryPosition: 'left',
onPaymentReady: async ({ remittanceId, paymentData }) => {
const res = await fetch('/api/confirm-payment', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ remittanceId, paymentData }),
});
return res.json();
},
onSuccess: (data) => console.log('Paid!', data),
});On mobile viewports, the summary panel automatically stacks above the form regardless of this setting.
Language
The SDK renders its own card form, so it carries its own strings, independent of any translation your page already does. Set locale to choose the language of the field labels, the installment options and the card validation messages.
| Name | Type | Required | Description |
|---|---|---|---|
pt-BR | default | — | Portuguese (Brazil). Used when no locale is given, so existing integrations are unchanged. |
en | string | — | English. Matches on the language subtag, so en-US and en_GB also resolve here. |
GlinCheckout.mount('#checkout', {
publicKey: 'YOUR_PUBLIC_KEY',
remittanceId: 'REMITTANCE_ID',
// Card form labels, installments and validation messages.
// Defaults to 'pt-BR' when omitted.
locale: 'en',
onPaymentReady: async ({ remittanceId, paymentData }) => {
const res = await fetch('/api/confirm-payment', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ remittanceId, paymentData }),
});
return res.json();
},
}); Available from SDK 1.1.0. Earlier builds ignored locale and always rendered Portuguese — if you set it previously and saw no effect, that is why. Tags are matched leniently (pt, pt_BR, PT-br all resolve to pt-BR), and a language we do not ship falls back to Portuguese rather than failing.
Field Visibility
Control which fields are shown, hidden, or read-only. Visibility can be set per section (applies to all fields in that section) or per individual field.
Visibility Modes
| Name | Type | Required | Description |
|---|---|---|---|
auto | default | — | Field is visible and editable. This is the default for all fields. |
hidden | string | — | Field is completely hidden from the form. If you hide a required field, you must provide its value via the data option. |
readOnly | string | — | Field is visible but not editable. Useful for displaying pre-filled data the customer should see but not change. |
Example: Hidden Customer, Partial Address
In this example, the entire customer section is hidden (with values provided via data), and the address section has specific field overrides.
GlinCheckout.mount('#checkout', {
publicKey: 'YOUR_PUBLIC_KEY',
remittanceId: 'REMITTANCE_ID',
mode: 'custom',
visibility: {
customer: 'hidden',
address: {
complement: 'hidden',
neighborhood: 'readOnly',
},
},
data: {
customer: {
taxId: '12345678900',
name: 'John',
email: 'john@example.com',
phone: '+5511999999999', // required, E.164
},
address: { neighborhood: 'Centro' },
},
onPaymentReady: async ({ remittanceId, paymentData }) => {
const res = await fetch('/api/confirm-payment', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ remittanceId, paymentData }),
});
return res.json();
},
onSuccess: (data) => console.log('Paid!', data),
});taxId, name, or email), you must provide their values through the data option. The SDK will validate that all required data is present before allowing payment submission. Pre-filling Customer Data
Use the data option to pre-fill form fields. This is especially useful when you already have the customer's information from a previous step in your checkout flow.
GlinCheckout.mount('#checkout', {
publicKey: 'YOUR_PUBLIC_KEY',
remittanceId: 'REMITTANCE_ID',
mode: 'custom',
data: {
customer: {
taxId: '12345678900',
name: 'Maria Silva',
email: 'maria@example.com',
phone: '+5511999999999', // required, E.164
},
address: {
zipCode: '01001000',
street: 'Praca da Se',
number: '100',
neighborhood: 'Centro',
city: 'Sao Paulo',
state: 'SP',
},
},
onPaymentReady: async ({ remittanceId, paymentData }) => {
const res = await fetch('/api/confirm-payment', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ remittanceId, paymentData }),
});
return res.json();
},
onSuccess: (data) => console.log('Paid!', data),
});CSS Class Overrides
For advanced styling beyond theme variables, you can target the SDK's CSS classes directly. All SDK elements use the glin- prefix to avoid conflicts with your existing styles.
/* Override the submit button */
.glin-btn-primary {
text-transform: uppercase;
letter-spacing: 0.05em;
}
/* Override input fields */
.glin-input {
border-width: 2px;
}
/* Override the card form section */
.glin-card-form {
padding: 1.5rem;
border: 1px solid var(--glin-border-color);
border-radius: var(--glin-border-radius);
}Personalizacao de Tamanhos
Alem das cores e fontes, o tema suporta propriedades de dimensionamento que controlam o tamanho da tipografia e a largura dos paineis. Todas as propriedades possuem valores padrao e sao opcionais.
| Propriedade | Padrao | Descricao |
|---|---|---|
| fontSize | 14px | Tamanho base da fonte utilizado em todo o checkout. |
| fontSizeSmall | 12px | Tamanho de fonte menor para dicas, mensagens de erro e textos auxiliares. |
| fontSizeLarge | 18px | Tamanho de fonte maior para titulos e valores monetarios. |
| labelFontSize | 14px | Tamanho da fonte dos labels dos campos do formulario. |
| formMaxWidth | 480px | Largura maxima do formulario de checkout. |
| summaryMaxWidth | 520px | Largura maxima do painel de resumo da remessa. |
| summaryMinWidth | 300px | Largura minima do painel de resumo da remessa. |
GlinCheckout.mount('#checkout', {
publicKey: 'YOUR_PUBLIC_KEY',
remittanceId: 'REMITTANCE_ID',
mode: 'custom',
theme: {
primaryColor: '#059669',
fontSize: '16px',
fontSizeSmall: '13px',
fontSizeLarge: '20px',
labelFontSize: '15px',
formMaxWidth: '520px',
summaryMaxWidth: '560px',
summaryMinWidth: '320px',
},
onPaymentReady: async ({ remittanceId, paymentData }) => {
const res = await fetch('/api/confirm-payment', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ remittanceId, paymentData }),
});
return res.json();
},
}); Ajuste formMaxWidth e summaryMaxWidth para controlar a proporcao entre o formulario e o resumo em telas grandes. Em viewports moveis, ambos os paineis ocupam 100% da largura automaticamente.
Interactive Playground
Experiment with all customization options in real time. Adjust the theme, layout, and visibility settings and see the result instantly.
Try the Interactive Playground →